Netatalk 2.2.0

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.

Download Netatalk 2.2.0 packages for Ubuntu

The binary package for amd64:

The source package files:

Building Ubuntu packages using git for the Debian source

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 git-buildpackage package.

Here's what I did:

  1. The netatalk packaging is hosted at git://git.debian.org/git/collab-maint/netatalk.git - check it out:
    ~/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.
  2. Get the new upstream source:
    ~/nat/tmp$ wget -O netatalk-2.2.0.orig.tar.bz2 \
    	"http://prdownloads.sourceforge.net/netatalk/netatalk-2.2.0.tar.bz2?download"
  3. Set up tracking branches for the upstream and pristine-tar branches:
    ~/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.
  4. Import it into the git repository. I didn't bother to sign tags here - if we were a Debian maintainer then presumably this would be standard practise. (You might also want be more careful about verifying the upstream source, e.g. using a shasum or md5sum.)
    ~/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
  5. Apply any patches and commit. Note that changes outside debian/ should be done in the quilt patchqueue in debian/patches. Here is a patch file that I created that fixes build breakage.
  6. Put the appropriate changelog entry into debian/changelog and commit:
    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 <andrew.peace@cantab.net>  Mon, 29 Aug 2011 15:38:00 +0000
  7. Build the package:
    ~/nat/tmp/netatalk$ git-buildpackage -us -uc
    This 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.