如何从源代码构建Debian / Ubuntu包? [英] How to build a Debian/Ubuntu package from source?

查看:342
本文介绍了如何从源代码构建Debian / Ubuntu包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序的源码(取自cvs / svn / git / ...),我想为它构建一个Debian / Ubuntu软件包。该软件包存在于存储库中,但是:




  • 这是一个较旧的版本(缺少需要的功能)

  • 我需要与默认的编译选项略有不同。



最简单的方法是什么?我担心几件事情




  • 如何正确列出所有依赖项? (我可以通过查看旧版本取决于某些提示,但可能添加了新的依赖关系。)

  • 我如何阻止更新系统在旧版本中安装旧版本更新?

  • 如何防止系统安装较新的版本(当它出来时)覆盖我的自定义包?


解决方案

您可以对debian / ubuntu中的所有软件包使用特殊软件包checkinstall。



您可以使用uupdate( apt-get install devscripts )从源代码创建一个包含现有debian源的包:



libdrm2的示例:

  apt-get build-dep libdrm2 
apt-get源libdrm2
cd libdrm-2.3.1
uupdate〜/ Downloads / libdrm-2.4.1.tar.gz
cd ../libdrm-2.4.1
dpkg-buildpackage -us -uc -nc


I have the source of a program (taken from cvs/svn/git/...) and I'd like to build a Debian/Ubuntu package for it. The package is present in the repositories, but:

  • It is an older version (lacking features I need)
  • I need slightly different compile options than the default.

What is the easiest way of doing it? I am concerned about a couple of things

  • How can I check if I have listed all the dependencies correctly? (I can get some hints by looking on what the older version depended, but new dependencies may have been added.)
  • How I can I prevent the update system installing the older version in the repo on an update?
  • How I can prevent the system installing a newer version (when its out), overwriting my custom package?

解决方案

you can use the special package "checkinstall" for all packages which are not even in debian/ubuntu yet.

You can use "uupdate" (apt-get install devscripts) to build a package from source with existing debian sources:

Example for libdrm2:

apt-get build-dep libdrm2
apt-get source libdrm2
cd libdrm-2.3.1
uupdate ~/Downloads/libdrm-2.4.1.tar.gz
cd ../libdrm-2.4.1
dpkg-buildpackage -us -uc -nc

这篇关于如何从源代码构建Debian / Ubuntu包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆