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.
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.)