1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-23 09:10:43 +00:00

- Update to 0.2.4

- convert to USE_RC_SUBR
- make sure thread libs are detected/used correctly on all OSVERSIONs
- change default database directory to /var/db/mt-daapd.
- change default mp3 dir to ${PREFIX}/share/mt-daap
- tell users whatvariables to they can set to customize their installation
- move pkg-deinstall, pkg-install and files/mt-daapd.conf in FILESDIR to be
able to respect user choices.
- portlint

PR:		ports/95190 reworked extensively by me
Submitted by:	Alexander Botero-Lowry <alex@foxybanana.com> (now maintianer)
This commit is contained in:
Ion-Mihai Tetcu 2006-06-25 13:17:25 +00:00
parent 39d8313eef
commit b817e22842
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=166288
7 changed files with 62 additions and 59 deletions

View File

@ -9,7 +9,7 @@ PORTNAME= mt-daapd
PORTVERSION= 0.2.4
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= mt-daapd
MASTER_SITE_SUBDIR= ${PORTNAME}
MAINTAINER= alex@foxybanana.com
COMMENT= Multithread daapd yet another Server for Apple iTunes
@ -18,23 +18,31 @@ BUILD_DEPENDS= ${LOCALBASE}/lib/libgdbm.a:${PORTSDIR}/databases/gdbm
LIB_DEPENDS= id3tag.0:${PORTSDIR}/audio/libid3tag
GNU_CONFIGURE= yes
CONFIGURE_ENV= AUTOCONF=autoconf259 AUTOHEADER=autoheader259 CC="${CC} -pthread"
CONFIGURE_ARGS= --with-id3tag=${PREFIX}
CONFIGURE_ENV= CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" \
CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib" \
LIBS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS= --with-id3tag=${PREFIX} --with-gdbm-includes=${LOCALBASE}/include
USE_AUTOTOOLS= autoheader:259 autoconf:259:env
DAAPD_USER?= daapd
DAAPD_GROUP?= daapd
DAAPD_DBDIR?= /var/db/${PORTNAME}
USE_RC_SUBR= mt-daapd.sh
PKGINSTALL= ${WRKDIR}/pkg-install
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
PLIST_SUB+= DAAPD_DBDIR=${DAAPD_DBDIR}
SUB_LIST+= USER=${DAAPD_USER} GROUP=${DAAPD_GROUP} DAAPD_DBDIR=${DAAPD_DBDIR}
SUB_FILES+= pkg-install pkg-deinstall mt-daapd.conf
pre-everything::
@${ECHO_CMD} "Define vars bellow if you need:"
@${ECHO_CMD} "DAAPD_USER=${DAAPD_USER} (default: daapd)"
@${ECHO_CMD} "DAAPD_GROUP=${DAAPD_GROUP} (default: daapd)"
@${ECHO_CMD} "DAAPD_DBDIR=${DAAPD_DBDIR} (default: /var/db/${PORTNAME})"
FILES_SUB= USER=${DAAPD_USER} GROUP=${DAAPD_GROUP} \
PREFIX=${PREFIX} LOGDIR=${LOGDIR} DOCSDIR=${DOCSDIR} \
LOCALBASE=${LOCALBASE}
pre-install:
@${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${PKGDIR}/pkg-install > ${PKGINSTALL}
@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
@ -42,23 +50,18 @@ post-install:
@${MKDIR} ${DOCSDIR}
.for i in README AUTHORS COPYING CREDITS \
ChangeLog INSTALL NEWS TODO
${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
.endif
${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/mt-daapd.sh > ${WRKDIR}/mt-daapd.sh
${INSTALL_SCRIPT} ${WRKDIR}/mt-daapd.sh ${PREFIX}/etc/rc.d/mt-daapd.sh
${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/mt-daapd.conf > ${WRKDIR}/mt-daapd.conf
${INSTALL_DATA} ${WRKDIR}/mt-daapd.conf ${PREFIX}/etc/mt-daapd.conf.sample
@${MKDIR} ${PREFIX}/var/mt-daapd/db
@${MKDIR} ${PREFIX}/share/mt-daapd/mp3
${CHMOD} 0755 ${PREFIX}/var/mt-daapd/db
${CHMOD} 0755 ${PREFIX}/share/mt-daapd/mp3
${CHOWN} ${DAAPD_USER}:${DAAPD_GROUP} ${PREFIX}/var/mt-daapd/db
${CHOWN} ${DAAPD_USER}:${DAAPD_GROUP} ${PREFIX}/share/mt-daapd/mp3
${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL}
${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@[ -f ${PREFIX}/etc/mt-daapd.conf ] || \
${INSTALL_DATA} ${WRKDIR}/mt-daapd.conf \
${PREFIX}/etc/mt-daapd.conf
@${INSTALL_DATA} ${WRKDIR}/mt-daapd.conf ${PREFIX}/etc/mt-daapd.conf.sample
@${MKDIR} ${DAAPD_DBDIR}
@${MKDIR} ${DATADIR}
@${CHMOD} 0755 ${DAAPD_DBDIR}
@${CHMOD} 0755 ${DATADIR}
@${CHOWN} ${DAAPD_USER}:${DAAPD_GROUP} ${DAAPD_DBDIR}
@${CHOWN} ${DAAPD_USER}:${DAAPD_GROUP} ${DATADIR}
.include <bsd.port.mk>

View File

@ -34,7 +34,7 @@ admin_pw mt-daapd
# This is where mt-daapd stores its database of song information.
#
db_dir %%PREFIX%%/var/mt-daapd/db
db_dir %%DAAPD_DBDIR%%
#
# mp3_dir (required)
@ -42,7 +42,7 @@ db_dir %%PREFIX%%/var/mt-daapd/db
# Location of the mp3 files to share
#
mp3_dir %%PREFIX%%/share/mt-daapd/mp3
mp3_dir %%DATADIR%%
#
# servername (required)

View File

@ -1,24 +0,0 @@
#!/bin/sh
# $FreeBSD$
MT_DAAPD=/usr/local/sbin/mt-daapd
MT_DAAPD_CONF=/usr/local/etc/mt-daapd.conf
case "$1" in
start)
if [ -r "${MT_DAAPD_CONF}" ]; then
${MT_DAAPD} -c ${MT_DAAPD_CONF}
echo -n ' mt-daapd'
fi
;;
stop)
killall -TERM mt-daapd
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
exit 64
;;
esac

View File

@ -0,0 +1,21 @@
#!/bin/sh
#
# $FreeBSD$
# formerly $ FreeBSD: ports/audio/mt-daapd/files/mt-daapd.sh,v 1.1 2004/07/19 09:18:51 edwin Exp $
# PROVIDE: mt-daapd
# REQUIRE: LOGIN
. %%RC_SUBR%%
name="mtdaapd"
rcvar="mt_daapd_enable"
command="%%PREFIX%%/sbin/mt-daapd"
command_args="-c %%PREFIX%%/etc/mt-daapd.conf"
pidfile="/var/run/mt-daapd.pid"
required_dirs="%%DAAPD_DBDIR%%"
required_files="%%PREFIX%%/etc/mt-daapd.conf.sample"
load_rc_config "$name"
run_rc_command "$1"

View File

@ -1,6 +1,7 @@
#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/audio/mt-daapd/Attic/pkg-deinstall,v 1.1 2004-08-05 23:00:09 edwin Exp $
# $FreeBSD$
# formerly $ FreeBSD: ports/audio/mt-daapd/pkg-deinstall,v 1.1 2004/08/05 23:00:09 edwin Exp $
#
PATH=/bin:/usr/bin:/usr/sbin

View File

@ -1,6 +1,7 @@
#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/audio/mt-daapd/Attic/pkg-install,v 1.1 2004-08-05 23:00:09 edwin Exp $
# $FreeBSD$
# formerly $ FreeBSD: ports/audio/mt-daapd/pkg-install,v 1.1 2004/08/05 23:00:09 edwin Exp $
#
PATH=/bin:/usr/bin:/usr/sbin

View File

@ -1,6 +1,6 @@
@comment $FreeBSD$
@unexec if cmp -s %D/etc/mt-daapd.conf.sample %D/etc/mt-daapd.conf; then rm -f %D/etc/mt-daapd.conf; fi
etc/mt-daapd.conf.sample
etc/rc.d/mt-daapd.sh
sbin/mt-daapd
%%DATADIR%%/admin-root/aspl-license.html
%%DATADIR%%/admin-root/aspl-license.txt
@ -19,11 +19,9 @@ sbin/mt-daapd
%%DATADIR%%/admin-root/required.gif
%%DATADIR%%/admin-root/status.html
%%DATADIR%%/admin-root/thanks.html
@dirrm var/mt-daapd/db
@dirrm var/mt-daapd
@dirrm %%DATADIR%%/mp3
@dirrmtry %%DATADIR%%/mp3
@dirrm %%DATADIR%%/admin-root
@dirrm %%DATADIR%%
@dirrmtry %%DATADIR%%
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
%%PORTDOCS%%%%DOCSDIR%%/COPYING
@ -33,3 +31,6 @@ sbin/mt-daapd
%%PORTDOCS%%%%DOCSDIR%%/NEWS
%%PORTDOCS%%%%DOCSDIR%%/TODO
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@cwd /
@dirrmtry %%DAAPD_DBDIR%%/db
@dirrmtry %%DAAPD_DBDIR%%