Alex Rivera | Logout

How to build a Debian/Ubuntu package from source?

Asked 2008-09-25T01:01:39.837
124

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?
Edit
Report

2 Answers

7

Sample Ubuntu-based build for ccache:

sudo apt-get update
sudo apt-get build-dep ccache
apt-get -b source ccache
sudo dpkg -i ccache*.deb

More details: http://blog.aplikacja.info/2011/11/building-packages-from-sources-in-debianubuntu/

answered 2012-09-18T21:16:43.690
3

I believe this is the Debian package 'bible'.

Well, it's the Debian new maintainer's guide, so a lot of it won't be applicable, but they do cover what goes where.

answered 2008-09-25T01:06:32.913

Your Answer