- Update to 0.2.2c

- Use rc.subr, cache file and OPTIONS

Approved by:	erwin (implicit)
This commit is contained in:
Lars Thegler 2004-06-29 20:47:31 +00:00
parent ed250c0696
commit c5999f82dd
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=112567
10 changed files with 203 additions and 40 deletions

View File

@ -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>

View File

@ -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

View File

@ -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
# PROVIDE: daapd
# REQUIRE: DAEMON
# KEYWORD: FreeBSD shutdown
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
# 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"

View File

@ -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)

View File

@ -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

View File

@ -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 .

View File

@ -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 );

View File

@ -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

View File

@ -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!
=================================================================

View File

@ -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%%