What I've done so far

  • I downloaded the source of an official deb-package from the ubuntu-repositories.
  • I applied a patch.
  • Ran configure and make successfully.
  • Tested the program.

What I'd like to do

  • I'd like to create a deb package from that using all the information (dependencies etc) from the old package.

My question is (They are closely related)

  1. Is there an easy (=mostly automated) way to do that?
  2. Can I just copy the binaries into the old deb file?
  3. Will my changes be overwritten once the original package gets updated in the repos?
  4. If so, how to avoid that?
  5. Is there a way to mark it as an "alternative" version that satisfies all the "incoming" dependencies of the original package?

Additional info

  • I run Ubuntu 9.04, 32bit, I do not care about others archs/versions at the moment.
  • The package in question is compiz-gnome.
  • The change is very minor and doesn't add any dependencies.

I found the following guide on the Ubuntu forums for rebuilding the network manager package here

Re: how to patch the source of a deb

Quote: Originally Posted by cord

I want to basically rebuild the network manager package with a custom patch of sorts to test something. So I want to: 1. get the source code for the ubuntu "version" of network manager

Code:

sudo apt-get source network-manager

Quote: 2. patch it with my patch The source files will be downloaded to the working directory. See this for more information.

Quote: 3. make a deb file that I can install in place of the current network manager.

Execute Code:

dpkg-buildpackage -rfakeroot -uc -b
in the directory created.

Also found this article : Debian New Maintainers' Guide Chapter 6 - Building the package


As for your changes being lost by an update from the official repositories I'm not sure. You could always just send your patch back upstream to the compiz-gnome package maintainers or create your own repository for the updated package.


The procedure I use is this:

Get the source (via apt-get src).

Apply a patch, or do whatever needs changing.

run debchange --nmu and type in a description of the change you made. This will auto-incremement the version number so that the system will not try to "upgrade" your custom package back to the standard one.

Run debuild.

Enjoy your deb files.