NetBSD Quickstart

From Old Wiki

This was originally contributed by Patrekur on the old wiki. It pertains to v0.2.4.

It should be applicable for nightlies too, but I cannot vouch for it!

Quickstart

This Quickstart guide was written while installing mt-daapd 0.2.4 on a dual processor Sun sparcstation 20 running NetBSD 3.0.

To get things working I had to use a couple of workarounds. If anybody has other solutions or way of doings things please let me know in the discussion page of this document.

Overview

The steps to install mt-daapd are as follows:

Downloading Dependencies

Note: I am assuming the needed packages are available for your machine architecture. If not you will have to build them yourself using pkg_src. See NetBSD documentation for this.

Get libid3tag:

sudo pkg_add libid3tag 

Get gdbm:

sudo pkg_add gdbm 

Build/install mt-daapd

First you have to patch the configure script because if you don't and you now try to build it stops with an error in main.c because the configure script incorrectly detects that setpgrp takes no arguments while it does!

I am not sure where the test goes wrong and how to correct the configure script. So to get it working I just modified the configure script by deleting line 5871:

#define SETPGRP_VOID 1 

Now run configure and tell it where to find dependencies:

./configure --with-gdbm-includes=/usr/pkg/include --with-gdbm-libs=/usr/pkg/lib

(On my system with this it picked up the correct locations for id3tag (same as the gdbm locations). If yours doesn't you may have to play with the --with-id3tag switch)

Now we can proceed and build mt-daapd:

make

Install:

sudo make install

Configure mt-daapd

If you try to run mt-daapd as is it will complain that it can not find libgdbm.so.3 and libid3tag.so.0

To get around this (yes I know this is a bit ugly and should not be necessary) make symlinks to them in /usr/lib:

cd /usr/lib
sudo ln -s /usr/pkg/lib/libgdbm.so.3 libgdbm.so.3
sudo ln -s /usr/pkg/lib/libid3tag.so.0 libid3tag.so.0

Copy contrib/mt-daapd.conf to /etc and edit so it points to the right directory for your music and change the webroot to:

web_root       /usr/local/share/mt-daapd/admin-root

Create the directory /var/cache/mt-daapd:

sudo mkdir /var/cache/mt-daapd

Start mt-daapd

After building and configuring you can manually start mt-daapd with:

 sudo mt-daapd

Set up startup scripts (optional)

It is probably easiest to automatically startup as a daemon. See here a startup script named mtdaapd you can put in /etc/rc.d:

#!/bin/sh
#
# PROVIDE: mtdaapd mt-daapd
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# mt-daapd daemon.
#

. /etc/rc.subr

name="mtdaapd"
realname="mt-daapd"
rcvar=$name
command="/path/to/${realname}"
pidfile="/var/run/${realname}.pid"
sig_stop="SIGINT"

load_rc_config $name
run_rc_command "$1"

Give it the right permissions:

sudo chmod 555 mtdaapd

And test it by trying:

sudo mtdaapd start

and

sudo mtdaapd stop

And configure the daemon to start during bootup by simply adding

mtdaapd=YES

to your /etc/rc.conf file and you are good to go!

NetBSD Install (last edited 2007-07-05 20:50:59 by cpc2-warw6-0-0-cust33)