Packaging Debian From Git Repository

Posted on Posted in debian, linux, open source, packages, technotes

Using the Libvirt project as an example, here is how to create a Debian package from using a Git repository clone:

git clone git://git.debian.org/pkg-libvirt/libvirt.git
cd libvirt
git-buildpackage --git-pristine-tar --git-upstream-branch=origin/upsgtream

If your upstream uses the source code management system (VCS) to maintain their code, you should consider to use them. That makes merging and cherry-picking upstream patches much easier. There are several specialized wrapper script packages for the Debian package building for each VCS.

  • git-buildpackage: Suite to help with Debian packages in Git repositories.
  • topgit: a Git patch queue manager
  • svn-buildpackage: helper programs to maintain Debian packages with Subversion.
  • cvs-buildpackage: A set of Debian package scripts for CVS source trees.

These packages offer more elegant working environment than manual use of the quilt commands for advanced audiences to automate building of packages.

Also on the note of Debian and package management, here is a nice way to handle package dependencies: http://github.com/palfrey/dh-builddep-metapackage

Leave a Reply

Your email address will not be published. Required fields are marked *