summaryrefslogtreecommitdiff
path: root/audio/daapd
diff options
context:
space:
mode:
authorLars Thegler <lth@FreeBSD.org>2004-06-29 20:47:31 +0000
committerLars Thegler <lth@FreeBSD.org>2004-06-29 20:47:31 +0000
commitc5999f82dd65b05dd39691894d24b87f0555dc1c (patch)
tree6fd86d1305631d80d421ad65ac568951fc9af882 /audio/daapd
parentUpdate to version 0.2.4 (diff)
- Update to 0.2.2c
- Use rc.subr, cache file and OPTIONS Approved by: erwin (implicit)
Notes
Notes: svn path=/head/; revision=112567
Diffstat (limited to 'audio/daapd')
-rw-r--r--audio/daapd/Makefile31
-rw-r--r--audio/daapd/distinfo4
-rw-r--r--audio/daapd/files/daapd.sh62
-rw-r--r--audio/daapd/files/patch-README11
-rw-r--r--audio/daapd/files/patch-daapd-example.conf15
-rw-r--r--audio/daapd/files/patch-daapd.811
-rw-r--r--audio/daapd/files/patch-daapd.cc22
-rw-r--r--audio/daapd/files/patch-makefile75
-rw-r--r--audio/daapd/pkg-message12
-rw-r--r--audio/daapd/pkg-plist2
10 files changed, 204 insertions, 41 deletions
diff --git a/audio/daapd/Makefile b/audio/daapd/Makefile
index 8cddbb1225e7..f7450a257653 100644
--- a/audio/daapd/Makefile
+++ b/audio/daapd/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= daapd
-PORTVERSION= 0.2.1d
-PORTREVISION= 1
+PORTVERSION= 0.2.2c
CATEGORIES= audio
MASTER_SITES= http://www.deleet.de/projekte/daap/daapd/
EXTRACT_SUFX= .tgz
@@ -23,6 +22,9 @@ USE_GMAKE= yes
USE_REINPLACE= yes
MAKEFILE= makefile
ALL_TARGET= daapd
+USE_RC_SUBR= yes
+
+MAN8= daapd.8
PKGMESSAGE= ${WRKDIR}/pkg-message
PKGINSTALL= ${WRKDIR}/pkg-install
@@ -32,13 +34,32 @@ DAAPD_USER= daapd
DAAPD_GROUP= daapd
LOGDIR= /var/log
+CACHE= /var/db/daapd.cache
FILES_SUB= USER=${DAAPD_USER} GROUP=${DAAPD_GROUP} \
PREFIX=${PREFIX} LOGDIR=${LOGDIR} DOCSDIR=${DOCSDIR} \
- LOCALBASE=${LOCALBASE}
+ LOCALBASE=${LOCALBASE} CACHE=${CACHE} RC_SUBR=${RC_SUBR}
+
+OPTIONS+= HOWL "Use howl for Zeroconf/Rendezvous" on
+OPTIONS+= MPEG4IP "Use mpeg4ip for AAC metadata" on
+
+.include <bsd.port.pre.mk>
+
+.ifdef(WITH_HOWL)
+LIB_DEPENDS+= howl:${PORTSDIR}/net/howl
+MAKE_ENV+= HOWL_ENABLE=1 PTHREAD_CFLAGS=${PTHREAD_CFLAGS} PTHREAD_LIBS=${PTHREAD_LIBS}
+.endif
+
+.ifdef(WITH_MPEG4IP)
+LIB_DEPENDS+= mp4v2:${PORTSDIR}/multimedia/mpeg4ip
+MAKE_ENV+= MPEG4_ENABLE=1
+.endif
post-patch:
@${REINPLACE_CMD} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
- ${WRKSRC}/${MAKEFILE}
+ ${WRKSRC}/${MAKEFILE} \
+ ${WRKSRC}/README \
+ ${WRKSRC}/daapd.cc \
+ ${WRKSRC}/daapd.8
pre-install:
@${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
@@ -63,4 +84,4 @@ post-install:
@${CAT} ${PKGMESSAGE}
.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/audio/daapd/distinfo b/audio/daapd/distinfo
index c1ecbd00d645..c7c6a7b64df3 100644
--- a/audio/daapd/distinfo
+++ b/audio/daapd/distinfo
@@ -1,2 +1,2 @@
-MD5 (daapd-0.2.1d.tgz) = 2f69299a099920694d7ddf78a1dcea49
-SIZE (daapd-0.2.1d.tgz) = 30023
+MD5 (daapd-0.2.2c.tgz) = 63ff586d479f3b7ea477789f3ca3dd42
+SIZE (daapd-0.2.2c.tgz) = 199236
diff --git a/audio/daapd/files/daapd.sh b/audio/daapd/files/daapd.sh
index 7266b44c0047..92cc22b6883e 100644
--- a/audio/daapd/files/daapd.sh
+++ b/audio/daapd/files/daapd.sh
@@ -1,27 +1,41 @@
#!/bin/sh
# $FreeBSD$
-DAAPD_USER=%%USER%%
-DAAPD=%%PREFIX%%/sbin/daapd
-DAAPD_LOG=%%LOGDIR%%/daapd.log
-DAAPD_PID=/var/run/daapd.pid
-DAAPD_CONF=%%PREFIX%%/etc/daapd.conf
-
-case "$1" in
- start)
- if [ -r "${DAAPD_CONF}" ]; then
- su -m ${DAAPD_USER} -c "${DAAPD} -c ${DAAPD_CONF}" >> ${DAAPD_LOG} 2>&1 &
- echo $(($!+1)) > "${DAAPD_PID}"
- echo -n ' daapd'
- fi
- ;;
- stop)
- kill -TERM `cat "${DAAPD_PID}"` && rm -f "${DAAPD_PID}"
- ;;
- *)
- echo ""
- echo "Usage: `basename $0` { start | stop }"
- echo ""
- exit 64
- ;;
-esac
+# PROVIDE: daapd
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD shutdown
+
+# Define these daapd_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/daapd
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+daapd_enable="NO"
+daapd_flags=""
+
+. %%RC_SUBR%%
+
+name="daapd"
+rcvar=`set_rcvar`
+
+daapd_user="%%USER%%"
+daapd_group="%%USER%%"
+prefix="%%PREFIX%%"
+logdir="%%LOGDIR%%"
+cache="%%CACHE%%"
+
+daapdBin="${prefix}/sbin/daapd"
+daapdCfg="${prefix}/etc/daapd.conf"
+daapdLog="${logdir}/daapd.log"
+
+required_files="${daapdCfg}"
+
+start_precmd="touch ${daapdLog}; chown ${daapd_user} ${daapdLog}; touch ${cache}; chown ${daapd_user} ${cache};"
+
+command="${daapdBin}"
+command_args="${daapd_flags} >>${daapdLog} 2>&1 &"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/audio/daapd/files/patch-README b/audio/daapd/files/patch-README
new file mode 100644
index 000000000000..61f7919ac433
--- /dev/null
+++ b/audio/daapd/files/patch-README
@@ -0,0 +1,11 @@
+--- README.orig Sat Jun 26 22:25:40 2004
++++ README Sat Jun 26 22:26:03 2004
+@@ -65,7 +65,7 @@
+
+ daapd [-dhqrv] [-c config-file] [-C cache-file] [-n name] [-p port] [-t vbr-limit] [file/directory]...
+
+-When called without command line arguments, daapd looks for a configuration file called /etc/daapd.conf. Failing that, it runs with the following default options:
++When called without command line arguments, daapd looks for a configuration file called %%PREFIX%%/etc/daapd.conf. Failing that, it runs with the following default options:
+
+ - current directory is scanned for music files
+ - port is 3689 (port registered for DAAP with IANA)
diff --git a/audio/daapd/files/patch-daapd-example.conf b/audio/daapd/files/patch-daapd-example.conf
new file mode 100644
index 000000000000..902353774936
--- /dev/null
+++ b/audio/daapd/files/patch-daapd-example.conf
@@ -0,0 +1,15 @@
+--- daapd-example.conf.orig Sun Jun 13 22:57:18 2004
++++ daapd-example.conf Sun Jun 13 22:58:55 2004
+@@ -1,8 +1,8 @@
+ Port 3689
+ ServerName daapd server
+-DBName daapd music
+-Password
+-Root .
+-Cache
++DBName daapd server
++Password s0mep4ssw0rd
++Root /path/to/my/music
++Cache /var/db/daapd.cache
+ Timescan 2
+ Rescan 0
diff --git a/audio/daapd/files/patch-daapd.8 b/audio/daapd/files/patch-daapd.8
new file mode 100644
index 000000000000..d90acb5dcf08
--- /dev/null
+++ b/audio/daapd/files/patch-daapd.8
@@ -0,0 +1,11 @@
+--- daapd.8.orig Sat Jun 26 22:30:28 2004
++++ daapd.8 Sat Jun 26 22:30:41 2004
+@@ -48,7 +48,7 @@
+ .It Fl c Ar config-file
+ Read configuration options from
+ .Ar config-file .
+-If this option is not given, the default location of the configuration file is /etc/daapd.conf.
++If this option is not given, the default location of the configuration file is %%PREFIX%%/etc/daapd.conf.
+ .It Fl C Ar cache-file
+ Save and recover database of audio files to/from
+ .Ar cache-file .
diff --git a/audio/daapd/files/patch-daapd.cc b/audio/daapd/files/patch-daapd.cc
new file mode 100644
index 000000000000..9fd6bda4ef04
--- /dev/null
+++ b/audio/daapd/files/patch-daapd.cc
@@ -0,0 +1,22 @@
+--- daapd.cc.orig Tue Jun 15 22:54:30 2004
++++ daapd.cc Tue Jun 29 20:37:49 2004
+@@ -787,7 +787,7 @@
+ }
+ }
+
+- conf = fopen( "/etc/daapd.conf", "r" );
++ conf = fopen( "/usr/local/etc/daapd.conf", "r" );
+ if( conf != NULL ) {
+ return( parseConfig( conf, initParams ) );
+ }
+@@ -1041,6 +1041,10 @@
+ perror ( "Couldn't create HTTP server" );
+ exit(1);
+ }
++
++ // unbuffer stdout if redirected
++ if (!isatty(fileno(stdout)))
++ setvbuf(stdout, NULL, _IONBF, 0);
+
+ httpdSetAccessLog( server, stdout );
+ httpdSetErrorLog( server, stderr );
diff --git a/audio/daapd/files/patch-makefile b/audio/daapd/files/patch-makefile
index ee7622a37b55..39d05cdd4c4d 100644
--- a/audio/daapd/files/patch-makefile
+++ b/audio/daapd/files/patch-makefile
@@ -1,15 +1,74 @@
---- makefile.orig Sat Dec 13 23:25:47 2003
-+++ makefile Sat Dec 13 23:26:24 2003
-@@ -2,9 +2,9 @@
+--- makefile.orig Mon Jun 21 16:07:51 2004
++++ makefile Mon Jun 21 16:14:40 2004
+@@ -1,7 +1,5 @@
+ # configure daapd here
+
+-HOWL_ENABLE = 1
+-MPEG4_ENABLE = 0
+
+
+ # no need to touch anything below this line
+@@ -10,24 +8,23 @@
+ CC = g++
+ MAKE = $(MAKE_COMMAND)
TARGET = daapd
+-DEPS = daaplib_ libhttpd_
OBJS = daapd.o db.o dboutput.o songcache.o parsemp3.o
- LIBS = -ldaaplib -lhttpd-persistent -lid3tag -lz
--LIBPATH = -L. -L/usr/local/lib
--INCPATH = -I. -I/usr/local/include
--DEPLOY = /usr/local/bin
+ LIBS = -ldaaplib -lhttpd-persistent -lid3tag -lz
+-LIBPATH = -L. -L./daaplib/src -L./libhttpd/src -L/usr/local/lib
+-INCPATH = -I. -I./daaplib/include -I./libhttpd/src -I/usr/local/include
+-DEPLOY = /usr/local
+LIBPATH = -L. -L%%LOCALBASE%%/lib
+INCPATH = -I. -I%%LOCALBASE%%/include
-+DEPLOY = %%PREFIX%%/bin
++DEPLOY = %%PREFIX%%
CFLAGS = -Wall -Wno-multichar
+ # HOWL
+ ifeq ($(HOWL_ENABLE),1)
+- HOWLDIRS := $(sort $(wildcard /usr/local/include/howl*) )
++ HOWLDIRS := $(sort $(wildcard %%LOCALBASE%%/include/howl*) )
+ ifeq ($(words $(HOWLDIRS) ), 0)
+ $(error howl not found in /usr/local/include. Install howl or disable it in the makefile)
+ endif
+ HOWLRECENT := $(word $(words $(HOWLDIRS)),$(HOWLDIRS) )
+ INCPATH := $(INCPATH) -I$(HOWLRECENT)
+- LIBS := $(LIBS) -lpthread -lhowl
+- CFLAGS := $(CFLAGS) -DHOWL_ENABLE
++ LIBS := $(LIBS) $(PTHREAD_LIBS) -lhowl
++ CFLAGS := $(CFLAGS) $(PTHREAD_CFLAGS) -DHOWL_ENABLE
+ ifneq ($(shell $(CC) -E -dM - < /dev/null | grep __APPLE__),)
+ LIBS := $(LIBS) -framework CoreFoundation
+ endif
+@@ -53,28 +50,17 @@
.cc.o:
+ $(CC) $(CFLAGS) $(INCPATH) -c $<
+
+-all: $(DEPS) $(TARGET)
++all: $(TARGET)
+
+ $(TARGET): $(OBJS)
+ $(CC) $(CFLAGS) $(LIBPATH) -o $(TARGET) $(OBJS) $(LIBS)
+
+ $(OBJS): types.h dboutput.h songcache.h parsemp3.h
+
+-daaplib_:
+- cd daaplib/src && $(MAKE)
+-
+-libhttpd_:
+- if test ! -e libhttpd/Site.mm; then cd libhttpd && ./configure; fi
+- cd libhttpd && $(MAKE)
+-
+ clean:
+- if test -e libhttpd/Site.mm; then cd libhttpd && $(MAKE) very-clean; fi
+- cd daaplib/src && $(MAKE) clean
+ rm $(OBJS) $(TARGET)
+
+-install: $(DEPS) $(TARGET)
+- cd libhttpd && $(MAKE) install
+- cd daaplib/src && $(MAKE) install
+- cp $(TARGET) $(DEPLOY)/bin
+- chmod a+rx $(DEPLOY)/bin/$(TARGET)
++install: $(TARGET)
++ cp $(TARGET) $(DEPLOY)/sbin
++ chmod a+rx $(DEPLOY)/sbin/$(TARGET)
+ cp $(TARGET).8 $(DEPLOY)/man/man8
diff --git a/audio/daapd/pkg-message b/audio/daapd/pkg-message
index 6a1922c4c684..df8b7b10420d 100644
--- a/audio/daapd/pkg-message
+++ b/audio/daapd/pkg-message
@@ -10,7 +10,12 @@ You need to copy this to
%%PREFIX%%/etc/daapd.conf
-and edit it to suit your requirements.
+and edit it to suit your requirements. You must also add:
+
+ daapd_enable="YES"
+
+to /etc/rc.conf.
+
Documentation is installed at:
%%DOCSDIR%%/README
@@ -23,6 +28,11 @@ daapd keeps its logfile in
%%LOGDIR%%/daapd.log
+To advertise the server, you can either use howl, or run net/mDNSResponder
+with a command line like:
+
+ mDNSResponderPosix -p 3689 -t _daap._tcp. -n `hostname`
+
Enjoy!
=================================================================
diff --git a/audio/daapd/pkg-plist b/audio/daapd/pkg-plist
index cd8bc5b98016..d3d045d65f2f 100644
--- a/audio/daapd/pkg-plist
+++ b/audio/daapd/pkg-plist
@@ -1,6 +1,6 @@
@comment $FreeBSD$
etc/daapd.conf.sample
etc/rc.d/daapd.sh
-bin/daapd
+sbin/daapd
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%@dirrm %%DOCSDIR%%