Compiling audio/mt-daapd under NetBSD with Zeroconf support

NetBSD ports collection includes audio/mt-daapd, a nice and straightforward implementation of Apple’s DAAP protocol for streaming music to iTunes. The only problem is that audio/mt-daapd is not compiled with Zeroconf support by default. In NetBSD, net/howl provides an implementation of Apple’s Zeroconf (also known as Rendevous or Bonjour).

In order to compile audio/mt-daapd under NetBSD with Zeroconf support, I first had to compile and install net/howl:

# cd /usr/pkgsrc/net/howl
# make install

Once net/howl is installed, I had to modify the Makefile file for audio/mt-daapd such as that howl support is enabled. This involves passing --enable-howl to the configure script and pointing it to the non-standard directory where the howl include files are — /usr/pkg/include/howl.

So, I edited /usr/pkgsrc/audio/mt-daapd/Makefile and after the line that reads:

GNU_CONFIGURE=  yes

I inserted:

CONFIGURE_ARGS+= --enable-howl
CONFIGURE_ARGS+= --with-howl-includes=${LOCALBASE}/include/howl

Before the line that reads:

.include "../../mk/pthread.buildlink3.mk"

I added:

.include "../../net/howl/buildlink3.mk"

Then,

# cd /usr/pkgsrc/audio/mt-daapd
# make install

I had to make some changes in order to get howl and mt-daapd start automatically during boot.

I added the following lines to /etc/rc.conf:

howl=YES
daapd=YES
daapd_flags="-c /etc/mt-daapd.conf"

Next, I copied /usr/pkg/share/examples/mt-daapd/mt-daapd.conf to /etc/mt-daapd.conf and customized it — for example, to change the server name, specified by the servername directive.

I also had to create the /etc/rc.d/mt-daapd rc script to get mt-daapd started automatically during boot. It looks like this:

#!/bin/sh
#
# $NetBSD: howl.sh,v 1.2 2006/01/01 18:27:53 tron Exp $
#

# PROVIDE: daapd
# REQUIRE: howl
# REQUIRE: NETWORKING

. /etc/rc.subr

name="daapd"
rcvar=$name
command="/usr/pkg/sbin/mt-daapd"
sig_stop=KILL

load_rc_config $name
run_rc_command "$1"

A sample configuration file that I’m using for mt-daapd/etc/mdaapd.conf — looks like this:

web_root         /usr/pkg/share/mt-daapd/admin-root
port             3689
admin_pw         mt-daapd
db_dir           /var/cache/mt-daapd
mp3_dir          /mnt/mp3
servername       NetBSD
runas            mtdaapd
playlist         /usr/pkg/etc/mt-daapd.playlist
#password        mp3
extensions       .mp3,.m4a,.m4p
#logfile         /var/log/mt-daapd.log
#rescan_interval 300
# always_scan    0
# process_m3u    0
# scan_type      0
# compress       0

Finally, either start both howl and mt-daapd, or reboot:

# /etc/rc.d/howl start
# /etc/rc.d/mt-daapd start

To test whether mt-daapd is working you can run the following command as root under Mac OS X:

# mDNS -B _daap._tcp

or the following command on Linux:

# mDNSBrowse _daap._tcp

2 thoughts on “Compiling audio/mt-daapd under NetBSD with Zeroconf support

  1. Thanks for this info. I’ve modified my own copy of mt-daapd to see if these changes will cause mt-daapd to be detected across multiple interfaces. I currently have 4 VLANs that the soon-to-be daap server has access to, and it seems the default mDNS announcements mt-daapd sends out from its’ internal responder only uses one. And it uses the least fortunate one.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s