-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use rc.subr, cache file and OPTIONS Approved by: erwin (implicit)
- Loading branch information
Showing
10 changed files
with
204 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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%% |