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

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

问题描述

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

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:

  • 这是一个旧版本(缺少我需要的功能)
  • 我需要的编译选项与默认选项略有不同.

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

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

  • 如何检查我是否正确列出了所有依赖项?(我可以通过查看旧版本所依赖的内容来获得一些提示,但可能已经添加了新的依赖项.)
  • 如何防止更新系统在更新时在 repo 中安装旧版本?
  • 如何防止系统安装更新的版本(当它过期时)覆盖我的自定义包?

推荐答案

你可以使用特殊的包checkinstall"来安装所有在 debian/ubuntu 中还没有的包.

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

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

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

libdrm2 示例:

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天全站免登陆