我有一个非常简单的命令行程序,它实际上由一个python脚本和一些助手shell脚本组成。我想学习如何打包这个程序,尽管它很琐碎。
根据我收集到的信息,我选择了configure/make/install路线。因为我没有任何东西要配置,也没有任何东西要做,所以我简单地创建了一个只有一个安装节的Makefile:
install:
cp ./myProgram /usr/bin/my-program
chown root:root /usr/bin/my-program
chmod 777 /usr/bin/my-program
cp -r ./ProgramResources /usr/lib/my-program
chown -hR root:root /usr/lib/my-program
chmod -R 777 /usr/lib/my-program此时,我的程序使用sudo make install安装并运行良好。
然后,我尝试使用checkinstall创建一个deb文件,如下所示:
sudo checkinstall sudo make install它似乎通过了安装部分,因为它报告成功,但随后失败:
======================== Installation successful ==========================
cp: cannot stat `//var/tmp/tmp.jKCmESc0v7/newfiles.tmp': No such file or directory
Copying files to the temporary directory...OK
Stripping ELF binaries and libraries...OK
Compressing man pages...OK
Building file list... FAILED!
Building Debian package...OK
Installing Debian package...OK
Erasing temporary files...OK
Deleting temp dir...OK
**********************************************************************
Done. The new package has been installed and saved to
...该程序已安装,但据我所知,这个新创建的.deb文件没有任何作用。dpkg -L my-program仅生成
/.手动删除它并从deb文件安装似乎没有任何作用-它实际上不会在任何地方放置任何文件。
那么,(1)我的方法有什么问题吗?和(2)如何解决checkinstall问题?
非常感谢你的回答,尽管我对代码很在行,但我对打包/分发一无所知。
发布于 2014-05-21 21:22:55
sudo的双重使用就是问题所在。
使用像这样的文件install.sh
#! /bin/bash
set -x
touch useless
cp useless /usr/share/useless命令
sudo checkinstall --pkgname useless -y ./install.sh工作时
sudo checkinstall --pkgname useless -y sudo ./install.sh
^^^^显示
cp: cannot stat ‘//var/tmp/tmp.Au4ympTNlT/newfiles.tmp’: No such file or directory并产生一个空的包。
发布于 2014-04-04 20:50:17
我也遇到过类似的问题。最后,我遵循了this非常简单但相当手动的方法。
例如,将您想要打包的文件放在debian/usr/bin中。不需要完成通常的configure, make, make install步骤。
https://stackoverflow.com/questions/6027118
复制相似问题