プラスα空間

ブログ in お市 のーと

Installing Debianized Netatalk 3.0 on Ubuntu 10.04 [edited]

Netatalk 3.0 has just released.

Please check changing netatalk 3.0 from netatalk 2.X.

I tried to install it by below steps.

I am not a Debian developer, so this Debinaizing process may not exact. But the .deb package works well. If you have any comments, please leave it.

I will start to describe these steps, I add a prompt where I am. If there is not any directory, it can take any where.

My test environment is below:

0. Preparing

If you installed old netatalk, you should uninstall it. It may cause some troubles.

To uninstall netatalk, you have some way.

If you have installed netatalk by Synapic or apt-get install, you can choose below:

If you have installed netatalk from original source package, you can uninstall below:

$ cd ~/src/netatalk-*/
$ sudo make uninstall

1. Debianize Netatalk 3.0 (to make .deb package)

  1. Install packages to build Debian package
  2. Download and extract Netatalk tar ball
  3. Download and extract debian package of netatalk 2.2.2
  4. Make a Debian package
  5. Edit files in the package
  6. Install related packages

1.1 Install packages to build Debian package

Install below packages to build and make a Debian package.

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

1.2 Download and extract Netatalk tar ball

Download the original Netatalk source tar ball.

[work dir]$ wget http://sourceforge.net/projects/netatalk/files/netatalk/3.0/netatalk-3.0.tar.bz2
[work dir]$ tar xvjf netatalk-3.0.tar.bz2

1.3 Download and extract debian package of netatalk 2.2.2

Click a triangle sign at 2.2.2-1, then download netatalk_2.2.2-1.debian.tar.gz.

[work dir]$ wget https://launchpad.net/ubuntu/+archive/primary/+files/netatalk_2.2.2-1.debian.tar.gz
[work dir]$ tar xvzf netatalk_2.2.2-1.debian.tar.gz

1.4 Make a Debian package

This step is main part of this article.

  1. Make “debian” directry by dh_make
  2. Overwrite files by 2.2.2-1 files
1.4.1 Make “debian” directry by dh_make
[work dir]$ ls
debian  netatalk-3.0  netatalk-3.0.tar.bz2  netatalk_2.2.2-1.debian.tar.gz
[work dir]$ cd netatalk-3.0
[pkg dir]$ dh_make --createorig --single
ldap_sasl_interactive_bind_s: Local error (-2)
    additional info: SASL(0): successful result: 
Maintainer name : Foo Bar
Email-Address   : foo@example.com 
Date            : Mon, 09 Jul 2012 21:54:11 +0900
Package Name    : netatalk
Version         : 3.0
License         : blank
Using dpatch    : no
Using quilt     : no
Type of Package : Single
Hit <enter> 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.

1.5 Edit the package

This is the most important step.

  1. Edit [pkg dir]/debian/rules (configure option)
  2. Edit [pkg dir]/debian/shlibs.local (library dependency)
  3. Edit [pkg dir]/debian/rules (cheats)
  4. Edit [pkg dir]/debian/rules (other changes)
1.5.1 Edit [pkg dir]/debian/rules (configure option)

configure option is changed on Netatalk 3.0, so you have to change rules file.

DEB_CONFIGURE_EXTRA_FLAGS := \
        --with-shadow --enable-fhs              \
        --enable-overwrite      \
        --enable-krbV-uam       \
        --with-libgcrypt-dir                    \
        --with-cracklib=/var/cache/cracklib/cracklib_dict       \
        --enable-zeroconf       \
        --with-init-style=debian
1.5.2 Edit [pkg dir]/debian/shlibs.local (library dependency)

This file is written about library dependencies. If there is not this file, you will occur below error.

dpkg-shlibdeps: error: no dependency information found for /usr/lib/libatalk.so.0 (used by debian/netatalk/usr/sbin/cnid_dbd).

To resolve this, I add a file “debian/shlibs.local”.

libatalk 0 libdb-dev

This may not exact dependency, but it is enough to build this package.

1.5.3 Edit [pkg dir]/debian/rules (a cheat)

The standard Ubuntu 10.04 cannot satisfy a package “cdbs (>= 0.4.72~)” defined in debian/control.

You have two way to resolve this problem.

If you choose “Ignoring requirement”, you have to edit debian/rules. (not debian/control) Add “#” at the top of line.

#include /usr/share/cdbs/1/rules/upstream-tarball.mk

And add a build option when build.

This article this way.

1.5.4 Edit [pkg dir]/debian/rules (other changes)

There are other some changes.

You can download the patch files for debian/rules from here.

[pkg dir]$ gzip -dc debian-rules-3.0_20121004.patch_.gz | patch debian/rules

1.6 Install related packages

Install other packages described in debian/control.

$ sudo apt-get install\
cdbs\
autotools-dev\
devscripts\
debhelper\
dh-buildinfo\
libdb-dev\
libwrap0-dev\
libpam0g-dev\
libcups2-dev\
libkrb5-dev\
libltdl3-dev\
libgcrypt11-dev\
libcrack2-dev\
libavahi-client-dev\
d-shlibs\
hardening-includes

2. Build it

You can start to build by this command.

[pkg dir]$ dpkg-buildpackage -us -uc -rfakeroot -d

It takes time for a while.

-us -uc” option is for no sign, so you are prohibited to upload this package.

“-d” option is for ignoring dependency.

Then you can find .deb packages in the [work dir].

[work dir]$ ls
netatalk-3.0                    netatalk_3.0-1.dsc
netatalk-3.0.tar.bz2            netatalk_3.0-1_powerpc.changes
netatalk_2.2.2-1.debian.tar.gz  netatalk_3.0-1_powerpc.deb
netatalk_3.0-1.diff.gz          netatalk_3.0.orig.tar.gz

3. Install it

If you have not run avahi-daemon yet, start it.

$ sudo service avahi-daemon start
avahi-daemon start/running, process 17177

Finally you can install Netatalk 3.0. And check the configuration.

[work dir]$ sudo dpkg -i netatalk_3.0-1_powerpc.deb
$ sudo service netatalk stop
$ /sbin/afpd -V
afpd 3.0 - 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 
         CNID backends:    dbd last tdb 
      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

              afp.conf:    /etc/afp.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/

After that change the “/etc/afp.conf”. Below is an example.

;
; Netatalk 3.x configuration file
;

[Global]
    vol preset = default_for_all_volumes
    log file = /var/log/netatalk.log

[default_for_all_volumes]
    file perm = 0600
    directory perm = 0700

[Homes]
    basedir regex = /home

[MY_TIMEMACHINE]
    path = /afp/time_capsule
    time machine = yes
    vol size limit = 1024

[Shared]
    path = /afp/shared
    file perm = 0666
    directory perm = 0777

Finally you can start netatalk service.

$ sudo service netatalk start
Starting Netatalk services:  netatalk.

Then check behavior the netatalk.

Mac OS X 10.6.8OS X 10.7.4
To find the server from finderOKOK
To make a folderOKOK
To copy a file from Mac to UbuntuOKOK
To copy a file from Ubuntu to MacOKOK
Permission of the copied fileOKOK
Time stamp of the copied fileOKOK
File extended attributesOKOK
Special characters such as “:”OKOK
Long file nameOKOK
Backup by TimeMachineOKOK

File extended attributes are different between Mac and Ubuntu.

Mac

$ xattr ScreenShot.png
com.apple.FinderInfo
com.apple.metadata:kMDItemIsScreenCapture
com.apple.metadata:kMDItemScreenCaptureType

Ubuntu

$ getfattr ScreenShot.png
# file: Screen Shot 2012-06-02 at 0.46.46.png
user.com.apple.metadata:kMDItemIsScreenCapture
user.com.apple.metadata:kMDItemScreenCaptureType
user.org.netatalk.Metadata

The name of the file extended attributes are different between Mac and Ubuntu. But they have same contents.

HAT taught me its meaning by comments.

OS Xnetatalk
File Extended Attributecom.apple.FinderInfouser.org.netatalk.Metadata

“user.org.netatalk.Metadata” contains “com.apple.FinderInfo” as an AppleDouble format. This is implemented from netatalk 3.0.

“com.apple.FinderInfo” was stored in the “.AppleDouble/FILE” until netatalk 2.x.

You can check the contents of “user.org.netatalk.Metadata” by “apple_dump” command on netatalk. It dumps AppleSingle/AppleDouble format data.

If you want to uninstall netatalk, you can use following way.

$ sudo dpkg --purge netatalk

Don’t forget to backup /etc/netatalk/afp.conf, if necessary.

(edited 2012-09-26 22:42)

This article has some errors. This package will fail to install at first and to purge netatalk.

I have resolved this problem, but I don’t have time to revise.

Below steps are needed.

(edited 2012-10-04 21:07)

I updated the patch file for debin/rules. It has a minimum changing to fix fatal installing error.

HAT told me this problem, and this problem founded in blow article. Thank you!

(edited 2014-07-16 06:23)

There is a new article. Please refer it.

 

 

[References]

[Related Articles]

Installing Debianized Netatalk 3.0 on Ubuntu 10.04 [edited]”に“20”個のコメント
  • Netatalk インストールお疲れ様です~。

    7周年ブログでご自身が書かれていた通り、意味は通じるのですが英語的な表現ではない箇所がところどころあると思います。

    無償でのお勧めは言語相互学習サイト”lang-8” https://lang-8.com/login 。エントリを書くとネイティブにまたは準ネイティブに修正してもらえます。

    英語は学習希望者/英語ネイティブメンバー率比の片寄りのため、添削してもらえる割合が低いのですがアメリカ西海岸の夕方から夜を狙って投稿すると添削してもらえる確率が高いようです。

    また、100 words 程度ごとに区切って投稿するのも効果があります(私も日本語を添削しますが、結構大変なのですよ…)

    良かったら使ってみてください♪

    • makisy_kida_loveさんへ、いつもコメントありがとうございます。
      やはり、英語表現としておかしい所がありますよね?
      それ以前に、技術文章としておかしい所もあります…。
      ご紹介のsiteに、sign upしてみました。
      直してもらう様にしようかな…。

  • nono より:

    Pls share the package, I cant get it to work…I would like to download your .deb package.
    Help plsss….! Thanks very much.

    • Hello nono,
      Thank you for your comment at the first time.
      I’m sorry I can’t upload my .deb package, because I’m not a Debian developer.
      When I want to upload a .deb package, I have to sign to the package with a GPG key that is provided by the Debian keyring. I don’t have the GPG key.

      Please read the following:

      Kind Regards,
      Oichinokata

  • babo より:

    Do you happen to know how to setup where the afp.conf file ends up? I think it usually goes to “/usr/local/etc/afp.conf”

    • Hi, babo. Thank you for your comments.
      The afp.conf is placed at /etc. The original debian package uses it.
      You can get information by “afpd -V” command where the afp.conf is.

      • babo より:

        Thanks for the reply.

        What got me thinking was this…

        When you manually compile and deploy netatalk 3.x.x the config ends up in /usr/local/etc/, which seems to be accepted as the standard location.

        So I wanted to try and get the packages to do the same thing, so that they follow this convention, but am unsure how to instruct the /debian/rules to do this…

        Its probably not an issue and just one of those silly things that get you thinking :)

        • Hi, babo.
          This package uses “–enable-fhs” at configure. The option means “use Filesystem Hierarchy Standard (FHS) compatibility”. I think if you delete this option, afp.conf will be stored at /usr/local/etc. However, other file location will be changed. Please take carefully.

          • babo より:

            Thanks for the reply :)

            This is how my packages are deploying:

            afpd -V
            afpd 3.1.2 – 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
            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: No
            LDAP support: No
            D-Bus support: No
            Spotlight support: No
            DTrace probes: No

            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: /usr/lib/netatalk//
            Server messages path: /var/netatalk/msg/

            …I’m going to go back and enable ACL support.

            These are the these rules I used:

            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

            Overall then it sounds like it is acceptable to let afp.conf land in /etc with other misc config files. It just seems to conflict with the netatalk documentation, which is why I started thinking about it.

            BTW, I also had to change the following otherwise there are run level warnings when installing the package (and take the ‘.’ out of the template from 2.2.5):

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

            Having fun playing with this.

            • Hi, babo.
              Would you try this article?

              Installing Debianized Netatalk 3.1.3 on Ubuntu 14.04 : プラスα空間
              http://oichinote.com/plus/2014/07/installing-debianized-netatalk-3-1-3-on-ubuntu-14-04.html

              The afp.conf is placed at /etc, but ACL will work.

              $ 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/

  • babo より:

    …also thankyou a million for posting the details to get me started making my own 3.1.2 package for debian :)

  • babo より:

    I found trouble when trying to build 3.1.3 with debian style… :(

    The exact same procedure works fine for 3.1.2. Need to fig out the problem now.

    I hope the original maintainer pushes to include 3.1.3 in Jessie.

コメントを残す