Installing Debianized Netatalk 3.1.3 on Ubuntu 14.04[Edited]

2016年6月4日netatalk,パソコン・インターネット

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 Finder OK
Creating a folder OK
Copying a file from Mac to Ubuntu OK
Copying a file from Ubuntu to Mac OK
Permission of the copied file OK
Time stamp of the copied file OK
File extended attributes OK
Special characters such as “:” OK
Long file name (255 bytes) OK
Backup by TimeMachine OK

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
[amazonjs asin="B00KKVP5ZY" locale="JP"]

Posted by お市のかた