Serge's basic recipes for packaging

Mainly for my own sake.


Updating a package

Important Note

(Daviey (Dave Walker) points out that this is the case only for packages which either are not available as, or maintained separately from, upstream Debian packages - and those should be few)

Here is an example of forwarding an existing package to newest upstream:

   apt-get source qemu-kvm
   cd qemu-kvm-*
   (make any changes)
   dch -i
   debuild -S
   cd ..
   sbuild -d maverick -A package-newversion.dsc

Install the resulting .debs in a VM or schroot using 'dpkg -i', and test. If all passes, you can push the package with

   dput ppa:your-name/ppaname package-newversion.changes

Sponsorship, and alternative package updating

The above works for uploading a new package, with all work local. There is an alternative way, more streamlined with bzr. If you seek sponsorship to get your package upstream, then you'll follow this example.

To start, see

Now you will check out the upstream package bzr tree, create a new branch for your work, ask bzr to upstream it, push your changes, then request sponsorship.

        sudo apt-get install bzr-builddeb
        bzr init-repo <package>
        cd <package>
        bzr co lp:ubuntu/<package> original
        bzr branch original merge-VERSION
        cd merge-VERSION
        # download the newest upstream tarball
        bzr merge-upstream ../NEW_TARBALL --version VERSION-0ubuntu1 --distribution maverick --last-version=LAST_UPSTREAM_VERSION
        # make any needed changes to the source
        # edit debian/changelog
        bzr ci # check in bzr changes
        bzr bd -S  # build source package
        bzr push lp:~username/ubuntu/maverick/<package>/merge-VERSION
        # build and test backages
        cd ..
        sbuild -d maverick -A <package>-version-0ubuntu1.dsc
        # test as above
        # now request sponsorship/merge using 'bzr lp-open' as shown in

Creating a new package

Let's say I downloaded dmenu-4.1.1.tar.gz. I extract it into dmenu-4.1.1, and make some personalization changes there. Now I want to upload a package with those changes. I cd back into dmenu-4.1.1, and then:

        dh_make -f ../dmenu-4.1.1.tar.gz
        cp debian/watch.ex debian/watch
        vi debian/watch
        edit debian/control
           # fill in source, homepage, maintainer, and description
           # Also add recommends, depends, and build-depends
           # remove any debian/*.ex files
        debuild -S -sa
        cd ..
        to test package building locally:
                sbuild -d lucid qemu-kvm_0.12.4-0ubuntu3.dsc
        to put into ppa:
                dput ppa:serge-hallyn/suckless dmenu_4.1.1-1_source.changes 

misc notes

dpkg-source -x <package>.dsc


  • extracts the source directory so we can then do

    # gunzip -c ../<package>.diff.gz | patch fakeroot debian/rules binary


how vmbuilder is packaged

vmbuilder package uploads:

  1. source code is in lp:vmbuilder
  2. debian/ is in lp:vmbuilder-dev/vmbuilder/packaging
  3. the release name in changelog entry in packaging tree
    • should reference 'bzr-#' where # is the latest bzr version of lp:vmbuilder I want included
  4. then do 'bzr-buildpackage -S'
  5. build, test the package
  6. try 'bzr merge-upstream' and see if that requests the dput


SergeHallyn_packaging (last edited 2011-01-08 00:26:30 by serge-hallyn)