0

created the following bash script to create a .deb package from a git url & revision tag:https://github.com/GlassGhost/GitDeb

I tested it with:

bash /path/to/GitDeb.sh git://repo.or.cz/tinycc.git tcc 0.9.26 release_0_9_26

but on calling line 36 of https://github.com/GlassGhost/GitDeb/blob/d0c24db46244cc34c0cffded57903fddb290d790/GitDeb.sh

fakeroot checkinstall --install=no --pkgname="$PkgName" --pkgversion="$PkgVersion" -y -D make install

it fails with the following:

Installing with make install...

========================= Installation results ===========================
make -C lib native
make[1]: Entering directory `/home/owner/Documents/GitDeb/tcc/lib'
make[1]: Nothing to be done for `native'.
make[1]: Leaving directory `/home/owner/Documents/GitDeb/tcc/lib'
mkdir -p "/usr/local/bin"
install -m755 tcc "/usr/local/bin"
install: cannot create regular file ‘/usr/local/bin/tcc’: Permission denied
make: *** [install] Error 1

****  Installation failed. Aborting package creation.
3
  • Your script works for me and I don't get why you would have such error. Please paste the complete output of your script on pastebin.com and share the link here.
    – janos
    Nov 24, 2013 at 10:31
  • @janos I tried the answer below adding fstrans, still getting an error link in that comment
    – GlassGhost
    Nov 24, 2013 at 15:17
  • 1
    That error is easy to fix, create the directory /usr/local/share/doc and rerun your script. If you get another error, post it again.
    – janos
    Nov 24, 2013 at 16:33

1 Answer 1

3
+200

The checkinstall documentation suggests using --fstrans. So use this flag.

Update: I've downloaded your repo and run your code in an lxc container. Just adding --fstrans definitely allows me to create a complete deb by running your command.

fakeroot fakes some file operations but it does not allow the command it launches to install things where permissions are needed. That's why --fstrans is needed.

ETA: The command mkdir -p "/usr/local/share/doc/tcc" may fail. That's because the directory /usr/local/share/doc does not already exist when checkinstall is started. Yes, -p means create all the parents so it should work but for some reason --fstrans is unable to handle it. The solution is to precreate /usr/local/share/doc/ before running checkinstall:

sudo mkdir /usr/local/share/doc

This is something I would do manually before trying to build. Just like I had to manually install packages with apt-get so that the build would work. (Adding a check in the script for the existence of this directory would be helpful though for other folks who may run your script.)

3
  • updated github trying it with --fstrans, now I'm getting a different error. gist.github.com/GlassGhost/7628249
    – GlassGhost
    Nov 24, 2013 at 15:17
  • I added ./configure --prefix=/usr, fixed the new error I was having. github.com/GlassGhost/GitDeb/commit/… Question marked as solved!!! Looking back I should have read more into checkinstall documentation. Can't believe I spent 200 rep, but really; I think it was worth it.
    – GlassGhost
    Nov 24, 2013 at 16:47
  • Regarding --prefix, I thought about that but I had decided that you already had decided you wanted it where it was installing. :)
    – Louis
    Nov 24, 2013 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.