从git url的修订标签创建.deb包



创建了以下bash脚本,以从git-url&修订标签:https://github.com/GlassGhost/GitDeb

我用测试了它

bash/path/to/GitDeb.shgit://repo.or.cz/tinycc.gittcc 0.9.26版本0_9_26

但拨打的是https://github.com/GlassGhost/GitDeb/blob/d0c24db46244cc34c0cffded57903fddb290d790/GitDeb.sh

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

它失败的原因如下:

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.

checkinstall文档建议使用--fstrans。所以使用这个标志。

更新:我已经下载了您的repo并在lxc容器中运行了您的代码。仅仅添加--fstrans就可以让我通过运行您的命令创建一个完整的deb。

fakeroot伪造了一些文件操作,但它确实允许它启动的命令在需要权限的地方安装东西。这就是为什么需要--fstrans

ETA:命令mkdir -p "/usr/local/share/doc/tcc"可能会失败。这是因为当checkinstall启动时,目录/usr/local/share/doc还不存在。是的,-p意味着创建所有的父级,这样它就可以工作,但由于某种原因,--fstrans无法处理它。解决方案是在运行checkinstall:之前预创建/usr/local/share/doc/

sudo mkdir /usr/local/share/doc

这是我在尝试构建之前手动做的事情。就像我必须手动安装带有apt-get的软件包一样,这样构建才能正常工作。(在脚本中添加一个检查该目录是否存在的检查会对其他可能运行脚本的人有所帮助。)

最新更新