プラスα空間

ブログ in お市 のーと

Installing Debianized Netatalk 3.1.3 on Ubuntu 14.04[Edited]

One year ago, I’ve installed netatalk 3.0 with a debian style.

“debianize” means to create a deb package from a released software. It called by me. :)

I’ve known the patch does not work on netatalk 3.1.3 from its comment by babo, so I’ve try to install netatalk 3.1.3 with debian style. It seems work well.

I’m not a debian maintainer, so the below is an ad hoc way to use dpkg.

I want to say thanks to original packagers.

Then, this installing way is based on the below page.

Thank you very much.

I’ll describe how to install netatalk 3.1.3 on Ubuntu 14.04 as below steps.

  1. Install required package to make a debian package
  2. Prepare build
  3. Install required package to build netatalk
  4. Build a deb
  5. Install the deb
  6. Setup netatalk (afp.conf)
  7. Start netatalk service
  8. Confirm netatalk

If you have any questions, please feel free to ask me.

1. Install required package to make a debian package

Install required packages to make a debian package.

$ sudo apt-get install build-essential dpkg-dev fakeroot dh-make

2. Prepare build

Extract netatalk 3.1.3 and the original debian package for 2.2.2.

$ tar xvf netatalk-3.1.3.tar.bz2 
$ tar xvf netatalk_2.2.2-1ubuntu2.debian.tar.gz 

You can get netatalk 3.1.3 and netatalk 2.2.2 debian from below websites.

(Edited 2014-07-19 10:54 Or, you can get the original netalk 2.2.2 source package by apt-get.

$ apt-get source netatalk
$ ls
netatalk-2.2.2  netatalk_2.2.2-1ubuntu2.debian.tar.gz  netatalk_2.2.2-1ubuntu2.dsc  netatalk_2.2.2.orig.tar.gz

Please use the “netatalk_2.2.2-1ubuntu2.debian.tar.gz”.

)

Next, make a debian environment by dh_make.

$ ls
debian  netatalk-3.1.3  netatalk-3.1.3.tar.bz2  netatalk_2.2.2-1ubuntu2.debian.tar.gz
$ cd netatalk-3.1.3/
$ dh_make --createorig --single
Maintainer name  : oichi
Email-Address    : oichi@example.com 
Date             : Sun, 13 Jul 2014 11:10:16 +0900
Package Name     : netatalk
Version          : 3.1.3
License          : blank
Type of Package  : Single
Hit  to confirm: 
Done. Please edit the files in the debian/ subdirectory now. netatalk
uses a configure script, so you probably don't have to edit the Makefiles.

Copy the original “rules” and “control” from 2.2.2 package.

$ cp -p ../debian/rules debian/rules 
$ cp -p ../debian/control debian/control 

At first, you have to modify debian/rules.

 040|DEB_CONFIGURE_EXTRA_FLAGS := \
 041|        --with-init-style=debian \
 042|        --with-cracklib \
 043|        --enable-krbV-uam \
 044|        --with-pam-confdir=/etc/pam.d \
 045|        --with-dbus-sysconf-dir=/etc/dbus-1/system.d \
 046|        --with-tracker-pkgconfig-version=0.16 \
 047|        --enable-fhs \

There are a lot of changes, so you have to change the original “contorl” of 2.2.2 package. Therefore, I’ve make a patch file for debian/rules and debian/control. You can download it from below link. Please download it by the right click of mouse button.

Then patch with the patch file.

$ patch -p0 < ~/Downloads/debian-netatalk-3.1.3.patch

(Edited 2014-07-19 10:54 I pasted the patched “rules” and “control” at the end of this article.)

3. Install required package to build netatalk

Then, install required packages.

$ sudo apt-get install cdbs devscripts debhelper dh-buildinfo libltdl3-dev d-shlibs libssl-dev libgcrypt11-dev libkrb5-dev libpam0g-dev libwrap0-dev libdb-dev libmysqlclient-dev libavahi-client-dev libacl1-dev libldap2-dev libcrack2-dev systemtap-sdt-dev libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev tracker libtracker-sparql-0.16-dev libtracker-miner-0.16-dev hardening-includes

4. Build a deb

Build the package.

$ dpkg-buildpackage -us -uc -rfakeroot -d

This step takes time for a while.

“-us -uc” option is for no sign, so you are prohibited to upload this package. On the other hand, “-d” option is for ignoring dependency.

5. Install the deb

You can find “deb” file at the upper directory that is made from previous step.

$ cd ..
$ ls
debian                  netatalk_2.2.2-1ubuntu2.debian.tar.gz  netatalk_3.1.3-1_amd64.changes
netatalk-3.1.3          netatalk_3.1.3-1.debian.tar.gz         netatalk_3.1.3-1_amd64.deb
netatalk-3.1.3.tar.bz2  netatalk_3.1.3-1.dsc                   netatalk_3.1.3.orig.tar.xz
$ sudo dpkg -i netatalk_3.1.3-1_amd64.deb 

Check installed program.

$ which afpd
/sbin/afpd
$ afpd -V
afpd 3.1.3 - Apple Filing Protocol (AFP) daemon of Netatalk

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. Please see the file COPYING for further information and details.

afpd has been compiled with support for these features:

          AFP versions:	2.2 3.0 3.1 3.2 3.3 3.4 
         CNID backends:	dbd last tdb mysql 
      Zeroconf support:	Avahi
  TCP wrappers support:	Yes
         Quota support:	Yes
   Admin group support:	Yes
    Valid shell checks:	Yes
      cracklib support:	Yes
            EA support:	ad | sys
           ACL support:	Yes
          LDAP support:	Yes
         D-Bus support:	Yes
     Spotlight support:	Yes
         DTrace probes:	Yes

              afp.conf:	/etc/afp.conf
           extmap.conf:	/etc/extmap.conf
       state directory:	/var/netatalk/
    afp_signature.conf:	/var/netatalk/afp_signature.conf
      afp_voluuid.conf:	/var/netatalk/afp_voluuid.conf
       UAM search path:	/lib/netatalk/
  Server messages path:	/var/netatalk/msg/

6. Setup netatalk (afp.conf)

At first, you have to stop the current service. After that you can edit the “/etc/afp.conf”.

$ sudo service netatalk stop
$ sudo vi /etc/afp.conf

This is a sample to check installed netatalk is working.

[Global]
    mac charset = MAC_JAPANESE

[Homes]
    basedir regex = /home

[Test Volume]
    path = /export/test1

[My Time Machine Volume]
    path = /export/timemachine
    time machine = yes

If you don’t have these directories, then you have to prepare them.

$ sudo mkdir -p /export/test1
$ sudo chmod 777 /export/test1/
$ sudo mkdir /export/timemachine
$ sudo chmod 777 /export/timemachine/

This package require ACL and EA (Extended Attribute). If you have not activated them, you have to modify “/etc/fstab”.

$ vi /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#                
# / was on /dev/sda1 during installation
UUID=oooooooo-oooo-oooo-oooo-oooooooooooo /               ext4    defaults,user_xattr,acl,errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=oooooooo-oooo-oooo-oooo-oooooooooooo none            swap    sw              0       0

After modification, then remount “/”.

$ sudo mount -o remount /

You will be able to use ACL and EA.

7. Start netatalk service

You can start netatalk service. Avahi-daemon is needed to find the netatalk service by Finder.

$ sudo service avahi-daemon start
$ sudo service netatalk start

You will find the Ubuntu netatalk server on your Finder.

8. Confirm netatalk

I’m checking this table when I’ve installed netatalk always.

OS X 10.9.4
Finding the server on FinderOK
Creating a folderOK
Copying a file from Mac to UbuntuOK
Copying a file from Ubuntu to MacOK
Permission of the copied fileOK
Time stamp of the copied fileOK
File extended attributesOK
Special characters such as “:”OK
Long file name (255 bytes)OK
Backup by TimeMachineOK

It seems working well.

Appendix: The patched “rules” and “control”

This is a part of patched “rules”.

 040|DEB_CONFIGURE_EXTRA_FLAGS := \
*041|        --with-init-style=debian \
*042|        --with-cracklib \
*043|        --enable-krbV-uam \
*044|        --with-pam-confdir=/etc/pam.d \
*045|        --with-dbus-sysconf-dir=/etc/dbus-1/system.d \
*046|        --with-tracker-pkgconfig-version=0.16 \
*047|        --enable-fhs \
 048|
*049|#DEB_INSTALL_EXAMPLES_netatalk = debian/examples/*
 077|# Rename files w/ manpage references to avoid namespace conflicts
 078|# * uniconv → netatalk-uniconv
 079|# * install netatalk-uniconv as system binary
 080|bindir=debian/netatalk/usr/bin
 081|man1dir=debian/netatalk/usr/share/man/man1
*082|binary-post-install/netatalk::
*083|#mv $(bindir)/uniconv $(bindir)/../sbin/netatalk-uniconv
*084|#perl -p -e 's/(?>!Title: )(uniconv)\\b/netatalk(?(1)\\-)$$2/g;s/(TH "UNICONV" )"1"/$$1"8"/' <$(man1dir)/uniconv.1 >$(man1dir)/../man8/netatalk-uniconv.8
 086|#rm $(man1dir)/uniconv.1
 092|# Remove unnecessary files
*093|binary-post-install/netatalk::
*094|#rm debian/netatalk/usr/bin/netatalk-config
 095|#rm debian/netatalk/usr/lib/libatalk.*
 096|rm debian/netatalk/usr/share/man/man1/afppasswd.1
 097|rm -r debian/netatalk/usr/include
*098|rm -r debian/netatalk/usr/share/aclocal
*099|#rm -r debian/netatalk/var
 100|#rm debian/netatalk/usr/lib/netatalk/*.la

This is a part of patched “control”.

 006|Build-Depends: autotools-dev,
 007| cdbs (>= 0.4.72~),
 008| devscripts,
 009| debhelper,
 010| dh-buildinfo,
*011| libltdl3-dev,
*012| d-shlibs,
 013| libssl-dev,
*014| libgcrypt11-dev,
*015| libkrb5-dev,
*016| libpam0g-dev,
*017| libwrap0-dev,
*018| libdb-dev,
 019| libmysqlclient-dev,
 020| libavahi-client-dev,
*021| libacl1-dev,
*022| libldap2-dev,
*023| libcrack2-dev,
*024| systemtap-sdt-dev,
*025| libdbus-1-dev,
*026| libdbus-glib-1-dev,
*027| libglib2.0-dev,
*028| tracker,
*029| libtracker-sparql-0.16-dev,
 030| libtracker-miner-0.16-dev,
 031| hardening-includes
Installing Debianized Netatalk 3.1.3 on Ubuntu 14.04[Edited]”に“15”個のコメント
  • babo より:

    Hello again,

    Just trying this out in my test area :)

    When I get to the patching part for the rules and control file, the patch complains – probably because the line spacing on my control and rules file is marginally different to that it expects to find (could that be the cause?).

    The only deviation from the instructions is that I got my 2.2.2 source using:
    apt-get source netatalk

    This is what I see for HUNK1:

    =================================================================

    packages@wheezy-64-build:~/netatalk-3.1.3$ patch -p0 < ~/Downloads/debian-netatalk-3.1.3.patch
    patching file debian/control
    Hunk #1 succeeded at 7 (offset -1 lines).
    patching file debian/rules
    Hunk #1 FAILED at 38.
    Hunk #2 succeeded at 79 (offset -5 lines).
    Hunk #3 succeeded at 90 (offset -5 lines).
    1 out of 3 hunks FAILED — saving rejects to file debian/rules.rej
    packages@wheezy-64-build:~/netatalk-3.1.3$ cat debian/rules.rej
    *** debian-org/rules 2012-10-06 03:17:50.000000000 +0900
    — debian/rules 2014-07-13 16:35:38.819875000 +0900
    ***************
    *** 38,56 ****
    CPPFLAGS += -D_IPP_PRIVATE_STRUCTURES

    DEB_CONFIGURE_EXTRA_FLAGS := \
    ! –with-shadow –enable-fhs \
    ! –enable-tcp-wrappers \
    ! –enable-timelord –enable-overwrite \
    ! –with-pkgconfdir=/etc/netatalk \
    ! –enable-krb4-uam –enable-krbV-uam \
    ! –with-cnid-dbd-txn \
    ! –with-libgcrypt-dir \
    ! –with-cracklib=/var/cache/cracklib/cracklib_dict \
    ! –disable-srvloc –enable-zeroconf \
    ! –enable-ddp \
    ! –enable-debian

    ! DEB_INSTALL_EXAMPLES_netatalk = debian/examples/*

    openssl_build_depends = libssl-dev

    — 38,52 —-
    CPPFLAGS += -D_IPP_PRIVATE_STRUCTURES

    DEB_CONFIGURE_EXTRA_FLAGS := \
    ! –with-init-style=debian \
    ! –with-cracklib \
    ! –enable-krbV-uam \
    ! –with-pam-confdir=/etc/pam.d \
    ! –with-dbus-sysconf-dir=/etc/dbus-1/system.d \
    ! –with-tracker-pkgconfig-version=0.16 \
    ! –enable-fhs \

    ! #DEB_INSTALL_EXAMPLES_netatalk = debian/examples/*

    openssl_build_depends = libssl-dev

    =================================================================

    Would the instructions be simpler to just post the final rules and control file examples?

    I think I can manually get around this, but it just occurred to me that others may bump into the same thing?

    I'm having great fun working through this and learning a lot on the way.

    You are a real star, thanks for posting this :)

    Babo

    • Hi, Babo.
      Thank you for you feedback. I am glad for your successful.
      I’m sorry to late reply, because my website was attacked by bot, so I constructed more powerful security settings.
      I’ve tried to get netatalk source package via apt-get source. Then, my patch works well. I’m afraid your rules file was corrupted.
      I revised my article with changing the rules and control. Would you see them?

      By the way, is my English improved than before article? I’m not at good English, so I’m studying English everyday.

  • babo より:

    Your English is very very good actually :-)

    I apologies for the delay in writing back, I’ve been away from keyboard for sometime actually.

    Hope the security settings are better now. The site seems to be running well for me.

    Did you try building for 3.1.6 yet?

    I noticed that there are problems because the rules now need to be:

    DEB_CONFIGURE_EXTRA_FLAGS := \
    –with-init-style=debian-sysv \ <——————————-
    –with-cracklib \
    –enable-krbV-uam \
    –with-pam-confdir=/etc/pam.d \
    –with-dbus-sysconf-dir=/etc/dbus-1/system.d \
    –with-tracker-pkgconfig-version=0.16 \
    –enable-fhs \

    • Hi babo,
      Thank you for your commant.
      I’ve not installed the 3.1.6 yet.
      It seems “with-init-style” is changed, so I’ll write an article for 3.1.6.
      Thank you.

      Then, thank you also for praise my English.

  • babo より:

    PS.

    On 12.04 I found that I had to change the following to get the build going…

    CONTROL:

    libltdl3-dev –> libltdl-dev
    libtracker-sparql-0.16-dev –> libtracker-sparql-0.14-dev,
    libtracker-miner-0.16-dev –> libtracker-sparql-0.14-dev,

    RULES:

    –with-tracker-pkgconfig-version=0.16 \ –> –with-tracker-pkgconfig-version=0.14 \

    /debian/source/format

    3.0 (quilt) –> 3.0 (native)

    The process went for quite some time, then hung at this part:

    dh_installudev -pnetatalk
    dh_lintian -pnetatalk
    dh_bugfiles -pnetatalk
    dh_install -pnetatalk
    dh_link -pnetatalk
    dh_buildinfo -pnetatalk
    dh_installmime -pnetatalk
    dh_installgsettings -pnetatalk
    perl -i -pe ‘s/^#AFPD_UAMLIST=.*/#AFPD_UAMLIST=”-U uams_dhx2.so,uams_clrtxt.so”/’ debian/netatalk/etc/default/netatalk
    Can’t open debian/netatalk/etc/default/netatalk: No such file or directory.
    perl -i -pe ‘s/^AFPD_UAMLIST=.*/AFPD_UAMLIST=”-U uams_dhx2.so,uams_clrtxt.so”/’ debian/netatalk/etc/init.d/netatalk
    binary-post-install/netatalk::
    make: binary-post-install/netatalk::: Command not found
    make: *** [binary-post-install/netatalk] Error 127
    dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

    I quite like messing about with trying to build packages for netatalk, although it would be nice if Ubuntu/Debian eventually got up to date packages sorted out :-)

    Let me know how you are getting on with this. I’ll let you know if I manage to fix it over here..

  • babo より:

    No rush my friend, I’m just playing about with this stuff, so its not urgent. This is fun research for me :-)

    If I get anywhere I will share my findings back too.

  • babo より:

    I agree, they are good instructions.

    My aim was to build it as a package first, but as you say it can be installed that way too.

  • babo より:

    Hello again!

    I succeeded in building 3.1.6 packages for Debian Wheezy.

    It is largely the same as building for Ubuntu 14.04, but you have to use:

    $ ./configure \
    –with-init-style=debian-sysv \
    –with-cracklib \
    –enable-krbV-uam \
    –with-pam-confdir=/etc/pam.d \
    –with-dbus-sysconf-dir=/etc/dbus-1/system.d \
    –with-tracker-pkgconfig-version=0.14

    In particular pkgconfig is 0.14 in Wheezy.

    I also modified rules to:

    DEB_UPDATE_RCD_PARAMS = start 50 2 3 4 5 stop 50 0 1 6

    Its a subtle change, but if you don’t remove the “.” you see the following warning:

    Setting up netatalk (3.1.6) …
    update-rc.d: warning: stop runlevel arguments (1) do not match netatalk Default-Stop values (0 6)
    insserv: warning: current stop runlevel(s) (0 1 6) of script `netatalk’ overrides LSB defaults (0 6)

    I also managed to succeed in signing my own packages, by simply generating my own key and using:

    dpkg-buildpackage -rfakeroot

    Exactly how much of this is right, I don’t know – but its been a lot of fun messing about with it :-)

    Happy days and thank you for maintaining this blog.

    • Hi babo,
      Thank you for comment again.
      You got it! You are great!
      I’m going to make the package, but my Macbook pro 15 (Early 2011) was broken.
      Its GPU should be failure. However, I’ve fixed it by myself. The way is baking its logic board.
      MBP15 works well right now.

  • babo より:

    Glad the MacBook is fixed.

    Is that the reflow trick where you bake the logic board? Sounds risky, but if it works then happy days :-)

  • […] be as root, or that the user running make can run ldconfig. This is not the case when building debian pacakges. Searching for NETA_LDCONFIG returned this url: http://oichinote.com/plus/2014/07/installing-debianized-netatalk-3-1-3-on-ubuntu-14-04.html […]

コメントを残す