プラスα空間

ブログ in お市 のーと

How to install netatalk 2.2beta4 to Ubuntu 10.04 by dpkg

netatalk 2.2beta4 has released, and a deb package for Ubuntu has released also.

But the package requires Ubuntu 11.10 Oneiric Ocelot. I have not install it. I’m using 10.04 Lucid Lynx on PowerMac/MDD.

I tried to install the package to 10.04, then found out it!

  1. Install packages to build from source files
  2. Download source deb package
  3. Extract source deb package
  4. Install dependent packages
  5. Edit source deb package
  6. Build source deb package
  7. Install binary deb package
  8. Confirm netatalk action
  9. Change configuration
  10. Restart netatalk and confirm again

If you have installed older version netatalk, don’t forget to backup configuration.

1. Install packages to build from source files

If you want to build a source deb package, it requires packages below:

Install them by below command.

$ sudo apt-get install dpkg-dev fakeroot

I guess "build-essential" is required also. If you meet an error, please install it.

$ sudo apt-get install build-essential

2. Download source deb package

Download the source deb package from the next site.

The package consists of below three files.

3. Extract source deb package

Make a directory to build it. You can change the directory name you like.

$ cd
$ mkdir work
$ cd work
$ mkdir netatalk
$ cd netatalk
$ mkdir deb
$ cd deb

Bring package to here.

$ cd ~/work/netatak/deb/
$ mv ~/Downloads/netatalk_2.2~beta4* .

Extract it.

$ cd ~/work/netatak/deb/
$ dpkg-source -x netatalk_2.2~beta4-1.dsc
gpgv: Signature made Mon Jun  6 04:16:23 2011 JST using RSA key ID C1A00121
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./netatalk_2.2~beta4-1.dsc
dpkg-source: info: extracting netatalk in netatalk-2.2~beta4
dpkg-source: info: unpacking netatalk_2.2~beta4.orig.tar.gz
dpkg-source: info: unpacking netatalk_2.2~beta4-1.debian.tar.gz
dpkg-source: info: applying 114_fix_macusers_ps_parsing.patch
dpkg-source: info: applying 115_default-dir.patch
dpkg-source: info: applying 201_etc2ps_paths.diff
dpkg-source: info: applying 202_psf_8_paths.diff
dpkg-source: info: applying 205_applevolumes_default_homedir.diff
dpkg-source: info: applying 213_CVE-2008-5718.patch
dpkg-source: info: applying 214_default-dir_autotools.patch

After that, you get extracted package.

./netatalk-2.2~beta4 -+- original netatalk source (extracted netatalk_2.2~beta4.orig.tar.gz)
                      +- debian (extracted netatalk_2.2~beta4-1.debian.tar.gz)

It should be patched.

I saw errors, but I decide to ignore them.

4. Install dependent packages

The dependent packages are written in "debian/conrol". They are below:

Build-Depends: cdbs (>= 0.4.70~),
autotools-dev,
devscripts (>= 2.10.7~),
debhelper (>= 6),
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

You can install them below command.

$ 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

Of course you can use Synaptic package manager.

The "debian/control" says "cdbs" version must be higher than 0.4.70, but the "cdbs" version of Ubuntu 10.04 Lucid Lynx is 0.4.62.

I found a cheating, so I keep it as is.

netatalk 2.2beta4 has capability for ACL access. If you want to enable it, you have to install below packages.

$ sudo apt-get install libldap2-dev (for LDAP)
$ sudo apt-get install libacl1-dev (for ACL)

The detail was written in this article.

5. Edit source deb package

I cheated when "4. Install dependent packages", so I have to resolve the dependency.

$ cd ~/work/netatak/deb/
$ cd netatalk-2.2~beta4
$ vi debian/rules

The "debian/rules" includes how to build binary package from source package. I changed it.

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

I add a "#" to "upstream-tarball.mk" line.

I don’t know why it needs "upstream-tarball.mk", but it seems to work well.

If you didn’t edit it, you will meet next error when "dpkg-buildpackage" (it will be described in the next section).

debian/rules:20: /usr/share/cdbs/1/rules/upstream-tarball.mk: No such file or directory
make: *** No rule to make target `/usr/share/cdbs/1/rules/upstream-tarball.mk'.  Stop.
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2

6. Build source deb package

Great! You can go to build step.

$ cd ~/work/netatak/deb/
$ cd netatalk-2.2~beta4
$ dpkg-buildpackage -us -uc -rfakeroot -d

Then building will start. It takes a while.

The "-us -uc" options is without signing, so the binary package is not allow to upload as Ubuntu package.

If you want to make a binary package with signing, use "-S" instead of "-us -uc".

The "-d" option ignores dependencies. In this article it is not satisfying requirements, so you will meet next error without "-d" option.

dpkg-checkbuilddeps: Unmet build dependencies: cdbs (>= 0.4.70~)
dpkg-buildpackage: warning: Build dependencies/conflicts unsatisfied; aborting.
dpkg-buildpackage: warning: (Use -d flag to override.)

If you want to use OpenSSL, use below before build.

$ export DEB_BUILD_OPTIONS="openssl"

7. Install binary deb package

Finally, you get a .deb file (the binary package) in the parent directory. You can install netatalk with it.

$ cd ~/work/netatak/deb/
$ ls
netatalk-2.2~beta4                  netatalk_2.2~beta4-1_powerpc.changes
netatalk_2.2~beta4-1.debian.tar.gz  netatalk_2.2~beta4-1_powerpc.deb
netatalk_2.2~beta4-1.dsc            netatalk_2.2~beta4.orig.tar.gz
$ dpkg -i netatalk_2.2~beta4-1_powerpc.deb

8. Confirm netatalk action

Check the installed netatalk version.

$ /usr/sbin/afpd -V
afpd 2.2-beta4 - 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:
        AFP3.x support:    Yes
        TCP/IP Support:    Yes
DDP(AppleTalk) Support:    Yes
         CNID backends:    dbd last tdb
           SLP support:    No
      Zeroconf support:    Yes
  TCP wrappers support:    Yes
         Quota support:    Yes
   Admin group support:    Yes
    Valid shell checks:    Yes
      cracklib support:    Yes
        Dropbox kludge:    No
  Force volume uid/gid:    No
           ACL support:    Yes
            EA support:    ad | sys
          LDAP support:    Yes
             afpd.conf:    /etc/netatalk/afpd.conf
   AppleVolumes.system:    /etc/netatalk/AppleVolumes.system
  AppleVolumes.default:    /etc/netatalk/AppleVolumes.default
    afp_signature.conf:    /etc/netatalk/afp_signature.conf
      afp_voluuid.conf:    /etc/netatalk/afp_voluuid.conf
         afp_ldap.conf:    /etc/netatalk/afp_ldap.conf
       UAM search path:    /usr/lib/netatalk/
  Server messages path:    /etc/netatalk/msg/
              lockfile:    /var/run/afpd.pid

In my environment it is available ACL/LDAP, so netatalk configure scripts turned on them.

I think it is better to turn on SLP for Mac OS X 10.0.* user, if the package supports DDP (AppleTalk).

I checked the configurations.

/etc/netatalk/AppleVolumes.default

# The line below sets some DEFAULT, starting with Netatalk 2.1.
:DEFAULT: options:upriv,usedots
# By default all users have access to their home directories.
~/                      "Home Directory"

The volume name is added. Other parts are as default.

"/etc/netatalk/afpd.conf", "/etc/netatalk/AppleVolumes.system" are not changed from original files.

"/etc/default/netatalk" is described below.

#AFPD_UAMLIST="-U uams_dhx2.so,uams_clrtxt.so"

It is commented out, so it take no affection. It seems to want to enable "uamclrtxt.so".

But I found "uams_clrtxt.so" in "/etc/init.d/netatalk".

AFPD_UAMLIST="-U uams_dhx2.so,uams_clrtxt.so"

It means clear text password. It will affect to security.

And there are no setting for Japanese.

I can connect to Ubuntu from Mac OS X 10.6.8 Snow Leopard.

9. Change configuration

I feel the standard configuration is not reasonable, so I change the configuration.

At first stop the netatalk service.

$ sudo service netatalk stop
Stopping Netatalk Daemons: afpd cnid_metad papd timelord atalkd.

Next change the configuration.

The target of this configuration is for later Mac OS X 10.4 Tiger.

Only required portions are described in below:

/etc/netatalk/AppleVolumes.default

# The line below sets some DEFAULT, starting with Netatalk 2.1.
:DEFAULT: options:upriv,usedots cnidscheme:dbd dperm:0700 fperm:0600 ea:sys
# By default all users have access to their home directories.
~/                      "Home Directory"
/home/u_capsule "Ubuntu Capsule" options:tm volsizelimit:5000

It is only to confirm "TimeCapsule" action. If you want to use it, please change "volsizelimit".

/etc/init.d/netatalk

AFPD_UAMLIST="-U uams_dhx2.so"

/etc/default/netatalk

#### server (unix) and legacy client (<= Mac OS 9) charsets
ATALK_UNIX_CHARSET='UTF8'
ATALK_MAC_CHARSET='MAC_JAPANESE'
#### Set which legacy daemons to run.
#### If you need AppleTalk, run atalkd.
#### papd, timelord and a2boot are dependent upon atalkd.
ATALKD_RUN=no
PAPD_RUN=no
TIMELORD_RUN=no
A2BOOT_RUN=no

10. Restart netatalk and confirm again

Start netatalk service.

$ sudo service netatalk start
Starting Netatalk services (this will take a while):  cnid_metad afpd.

Then confirm netatalk actions. It is checked from Mac OS X 10.6.8 Snow Leopard.

All items are OK.

In addition, it is necessary to enable extended file attribute in the Ubuntu side. Please see the next article.

ACL is ON, but I don’t check it this time.

Conclusion

By the way, I confirmed uninstall with "dpkg -r" and "dpkg –purge".

Special Thanks

I want to thank HAT-san.

Referenced pages

Related articles

コメントを残す