Posted 29 August 2011 on andypeace.com. Updated 9 April 2012.
Update: Newer version 2.2.1 packages for Ubuntu 11.04 available. I have left this page up as useful documentation of using git and Debian packaging together.
We recently upgraded a Mac in our house to OS X Lion to discover, as did many others, that changes in AFP (the Apple File Protocol) meant that our home-built NAS could no longer be used as a target in Time Machine. This had apparently been fixed in the newest version of the netatalk package, 2.2.0, but as the NAS is running Ubuntu 11.04 Server there so wasn't a .deb nice package ready. Various forums suggested upgrading to 2.2.0~beta4 for which packages were available, but I didn't really feel like running a file server on beta software. Since the final release of 2.2.0 was available upstream, I decided to build my own packages for it and have included the results here.
The binary package for amd64:
The source package files:
Since last time I'd paid any attention to this stuff, it seems that Ubuntu (and presumably Debian) are using git for version control of at least some of their packaging of upstream sources. I decided to attempt to DTRT (do the right thing) and properly package my changes. After hitting a brick wall with documentation, I made some notes here for others to either use or correct my misunderstandings. (I assume you are familiar with the apt-get, quilt, and git tools so won't go into much explanation on these.)
Firstly, I had assumed that the right tool to use was git-dpm (there are further notes on the Debian wiki). Apparently not; this is a separate system and isn't used at least for this package. There does seem to be a plethora of options around packaging and managing packages, but in our case we need to use the git-* packaging tools. You'll need to install the
Here's what I did:
~/nat/tmp$ git clone git://git.debian.org/git/collab-maint/netatalk.git Cloning into netatalk... remote: Counting objects: 4482, done. remote: Compressing objects: 100% (1515/1515), done. remote: Total 4482 (delta 2866), reused 4429 (delta 2815) Receiving objects: 100% (4482/4482), 3.94 MiB | 1.11 MiB/s, done. Resolving deltas: 100% (2866/2866), done.
~/nat/tmp$ wget -O netatalk-2.2.0.orig.tar.bz2 \ "http://prdownloads.sourceforge.net/netatalk/netatalk-2.2.0.tar.bz2?download"
~/nat/tmp/netatalk$ git branch -t upstream origin/upstream branch upstream set up to track remote branch upstream from origin. ~/nat/tmp/netatalk$ git branch -t pristine-tar origin/pristine-tar Branch pristine-tar set up to track remote branch pristine-tar from origin.
~/nat/tmp/netatalk$ git-import-orig --no-sign-tags ../netatalk-2.2.0.orig.tar.bz2 What is the upstream version? [2.2.0.orig] 2.2.0 gbp:info: Importing '../netatalk-2.2.0.orig.tar.bz2' to branch 'upstream'... gbp:info: Source package is netatalk gbp:info: Upstream version is 2.2.0 /usr/bin/pristine-tar: committed netatalk_2.2.0.orig.tar.bz2.delta to branch pristine-tar gbp:info: Merging to 'master' Auto-merging include/atalk/globals.h Removing libatalk/unicode/ucs2_casetable.h Merge made by recursive. gbp:info: Succesfully imported version 2.2.0 of ../netatalk-2.2.0.orig.tar.bz2
netatalk (2.2.0-1) unstable; urgency=low * New upstream release. * Fix build breakage from upstream: + Wrong globals include in etc/afpd/afp_asp.c + Misordered #define in include/atalk/paths.h -- Andy Peace <email@example.com> Mon, 29 Aug 2011 15:38:00 +0000
~/nat/tmp/netatalk$ git-buildpackage -us -ucThis will produce quite a large amount of output. Note that the options not specific to git-buildpackage are passed through to debuild, which in turn passes through options not specific to it to dpkg-buildpackage. The -us and -uc options tell dpkg-buildskip signing the .dsc and changes files.
After all this, there should be a source and binary package one level up:
~/nat/tmp$ ls -l ... drwxr-xr-x 16 andy andy 4096 2011-08-29 20:02 netatalk -rw-r--r-- 1 andy andy 346495 2011-08-29 20:02 netatalk_2.2.0-1_amd64.build -rw-r--r-- 1 andy andy 1585 2011-08-29 20:02 netatalk_2.2.0-1_amd64.changes -rw-r--r-- 1 andy andy 1638742 2011-08-29 20:02 netatalk_2.2.0-1_amd64.deb -rw-r--r-- 1 andy andy 45382 2011-08-29 19:53 netatalk_2.2.0-1.debian.tar.gz -rw-r--r-- 1 andy andy 1181 2011-08-29 19:53 netatalk_2.2.0-1.dsc -rw-r--r-- 1 andy andy 1216174 2011-07-27 14:15 netatalk_2.2.0.orig.tar.bz2
The relevant files are available for you to download above, though I only have a system running a 64-bit kernel so if anyone wishes to provide a link to 32-bit package, please let me know and I can add it above.