如何从源代码打包?

如何从源代码打包?

我想在 Ubuntu 上打包 Nagios 4。从源代码安装涉及多个 make 命令和一个 configure 命令。

wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.3.4.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.3.4/
./configure --with-httpd-conf=/etc/apache2/sites-enabled
make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf 

我怎样才能用它制作 deb 或 apt 包?

我尝试按照 Ubuntu 的说明进行操作 http://packaging.ubuntu.com/html/packaging-new-software.html 当我运行bzr dh-make package version package.tar.gz,我收到以下错误

bzr: ERROR: Either run the command from an existing branch of upstream, or move nagioscore-nagios-4.3.4 aside and a new branch will be created there.

答案1

https://help.ubuntu.com/community/CompilingEasyHowTo

如果你已经做到了这一点,那么最困难的部分已经完成了。现在你需要做的就是运行命令

make which does the actual building (compiling) of the program. 

如果程序很大或者您的计算机运行速度很慢,那就去喝杯咖啡或做点别的。如果您有多核处理器,您还可以将变量 CONCURRENCY_LEVEL 设置为处理器/核心的数量,以便稍微加快速度。

完成后,安装该程序。您可能希望使用sudo checkinstall将程序放入包管理器中,以便以后干净、轻松地删除。这取代了旧sudo make install 命令。

相关内容