Gentoo Wiki


This article is still a Stub. You can help Gentoo-Wiki by expanding it.




The purpose of this topic is to collect the information needed to provide the best share service for Mac on a Gentoo box.




Apple's network service discovery method.

Service Announcer


You do not need the DBUS option if the avahi installation is only going to be a deamon. When no dbus is needed also add -dbus to the -qt3 and -qt4 below.

# echo "net-dns/avahi -qt3 -qt4" >> /etc/portage/package.use
# emerge --pretend avahi
#* You should only see a few packages.
#* The -qt3/4 is to avoid getting the whole X deal onto the server
#* Remove the '--pretend' when you are ready.

AFP Shares using Netatalk

HOWTO Share Directories via AFP

Advertise NFS Sharepoints with Avahi

Finder is able to autodetect NFS Shares in the Network by using ZeroConf. For that we will use an static Avahi Servicefile with the following Content.

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<name replace-wildcards="yes">Music</name> ## Name
       <txt-record>path=/media/music</txt-record> ## path to shared Folder

Save this Filem for example, as nfs_music.service under /etc/avahi/services. Now restart Avahi and see how those Shares get mounted with Finder.

This Function seems to be now broken in Mac OS X 10.5. A workaround is posted at

Advertise Samba Sharepoints with Avahi

Avahi can also be used for a faster discovery of Samba shares.

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
   <name replace-wildcards="yes">%h</name>

Broadcast Bookmarks over ZeroConf for Safari

It is possible to Broadcast Bookmarks of your Webinterfaces on your local Network with the help of Avahi. For that you need to create an static Avahi Servicefile with the following Content.

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
  <name>MythWeb</name> ## Name of the Bookmark
    <txt-record>path=/mythweb</txt-record> ## Path 

Now restart Avahi and check the Bookmark Menu under Safari. There you will see how automatically they will appear, when those Services are available.


There is a nice description here: Apple ITunes Server

Shared libraries (music, movies, podcasts, etc.) can be accessed from iTunes, Front Row, Apple TV, Rhythmbox, VLC, and more.

iTunes can have different shares for: music, podcast and sound books.


iPhoto uses dpap at port 8770. Once this is set up, one can browse shared photos via iPhoto or Front Row on a Mac, or from an Apple TV.

Please Note: Your photos must be named *.jpeg not *.jpg or this will show the share but with no photos in it.


You need to have avahi installed, see above for installation process.

You probably need to include the use flag 'jpeg' for imlib2 module.

# echo "~dev-perl/POE-0.38" >> /etc/portage/package.keywords
# emerge POE
# emerge imlib2
# emerge Image-Imlib2
# perl -MCPAN -e 'install Net::DPAP::Server'

Alternative to installing stuff through cpan add it to portage as ebuilds:

# emerge g-cpan
# echo 'perl-gcpan' >> /etc/portage/categories
# g-cpan -i Net::DPAP::Server
# emerge Net-DPAP-Server

dpap server script

File: /etc/dpap_srv
 use POE;
 use Net::DPAP::Server;

 my $server = Net::DPAP::Server->new(
     path => '/my/photo/album',
     port => 8770,
     name => "My holiday snaps",

avahi service file

File: /etc/avahi/services/dpap.service
 <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> 
  <name replace-wildcards="yes">%h</name>

# /etc/init.d/avahi-daemon start

You must also run:

# perl /etc/dpap_srv

Note: this does not daemonize

Alternatively, use the Avahi Net::Rendezvous::Publish backend:


It will announce itself to mDNSResponder. This can be checked by running on OSX:

  1. mDNS -B _dpap._tcp
Retrieved from ""

Last modified: Fri, 05 Sep 2008 21:57:00 +0000 Hits: 13,341