aboutsummaryrefslogtreecommitdiffstats
path: root/audio/mt-daapd
diff options
context:
space:
mode:
authorculot <culot@FreeBSD.org>2011-04-08 01:29:56 +0800
committerculot <culot@FreeBSD.org>2011-04-08 01:29:56 +0800
commit2fac5948d6161d76824952476b211f803f5fb46c (patch)
treef2c1ca51a2e2c99ff845ad43d2861310ec007901 /audio/mt-daapd
parentecbc7a5e417470ebc533770caf70df0c9d9ee8d7 (diff)
downloadfreebsd-ports-gnome-2fac5948d6161d76824952476b211f803f5fb46c.tar.gz
freebsd-ports-gnome-2fac5948d6161d76824952476b211f803f5fb46c.tar.zst
freebsd-ports-gnome-2fac5948d6161d76824952476b211f803f5fb46c.zip
- Install scripts improvements
- portlint(1) fixes - PATCH_SITES updated PR: ports/151299 Submitted by: Takefu <takefu AT airport.fm> Approved by: Mark Foster <mark AT foster.cc> (maintainer)
Diffstat (limited to 'audio/mt-daapd')
-rw-r--r--audio/mt-daapd/Makefile38
-rw-r--r--audio/mt-daapd/files/mt-daapd.in (renamed from audio/mt-daapd/files/mt-daapd.sh.in)5
-rw-r--r--audio/mt-daapd/files/pkg-deinstall.in1
-rw-r--r--audio/mt-daapd/files/pkg-install.in76
4 files changed, 74 insertions, 46 deletions
diff --git a/audio/mt-daapd/Makefile b/audio/mt-daapd/Makefile
index c21881dd587c..0a3375539d92 100644
--- a/audio/mt-daapd/Makefile
+++ b/audio/mt-daapd/Makefile
@@ -14,39 +14,43 @@ MASTER_SITES= SF
MAINTAINER= mark@foster.cc
COMMENT= Multithread daapd yet another Server for Apple iTunes
-#BUILD_DEPENDS= ${LOCALBASE}/lib/libgdbm.a:${PORTSDIR}/databases/gdbm
-LIB_DEPENDS= gdbm.3:${PORTSDIR}/databases/gdbm
-LIB_DEPENDS+= id3tag.0:${PORTSDIR}/audio/libid3tag
+LIB_DEPENDS= gdbm.3:${PORTSDIR}/databases/gdbm \
+ id3tag.0:${PORTSDIR}/audio/libid3tag
+
+CONFLICTS= firefly-[0-9]*
GNU_CONFIGURE= yes
-CONFIGURE_ENV= CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" \
+CONFIGURE_ENV= CFLAGS+="${PTHREAD_CFLAGS}" \
CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib" \
LIBS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"
-CONFIGURE_ARGS= --with-id3tag=${PREFIX} --with-gdbm-includes=${LOCALBASE}/include
-
-USE_AUTOTOOLS= autoheader autoconf:env
+CONFIGURE_ARGS= --with-id3tag=${PREFIX} \
+ --with-gdbm-includes=${LOCALBASE}/include
USE_ICONV= yes
-PATCH_SITES+= http://www.apionet.or.jp/~tomi/
-PATCH_SITES+= ${MASTER_SITE_LOCAL}
+PATCH_SITES+= http://shishimaru.the-ninja.jp/\
+ ${MASTER_SITE_LOCAL}
PATCHFILES+= mt-daapd-0.2.4.1-cp932.patch
PATCH_DIST_STRIP+= -p1
DAAPD_USER?= daapd
DAAPD_GROUP?= daapd
-DAAPD_DBDIR?= /var/db/${PORTNAME}
-USE_RC_SUBR= mt-daapd.sh
+DAAPD_DBDIR?= ${DAAPD_MASTERDIR}/var/db/${PORTNAME}
+USE_RC_SUBR= mt-daapd
PLIST_SUB+= DAAPD_DBDIR=${DAAPD_DBDIR}
-SUB_LIST+= USER=${DAAPD_USER} GROUP=${DAAPD_GROUP} DAAPD_DBDIR=${DAAPD_DBDIR}
+SUB_LIST+= USER=${DAAPD_USER} GROUP=${DAAPD_GROUP}\
+ DAAPD_DBDIR=${DAAPD_DBDIR}\
+ DAAPD_MASTERDIR=${DAAPD_MASTERDIR}
SUB_FILES+= pkg-install pkg-deinstall mt-daapd.conf
+.include <bsd.port.pre.mk>
+
pre-everything::
@${ECHO_CMD} "Define vars below 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})"
+ @${ECHO_CMD} "DAAPD_DBDIR=${DAAPD_DBDIR} (default: ${DAAPD_MASTERDIR}/var/db/${PORTNAME})"
pre-install:
@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
@@ -69,5 +73,11 @@ post-install:
@${CHMOD} 0755 ${DATADIR}
@${CHOWN} ${DAAPD_USER}:${DAAPD_GROUP} ${DAAPD_DBDIR}
@${CHOWN} ${DAAPD_USER}:${DAAPD_GROUP} ${DATADIR}
+ @${ECHO_MSG}
+ @${ECHO_MSG} "This port installs a sample configuration file in"
+ @${ECHO_MSG} "${LOCALBASE}/etc/mt-daapd.conf.sample"
+ @${ECHO_MSG} "You probably should move/copy this file to mt-daapd.conf"
+ @${ECHO_MSG} "and customize to fit your needs."
+ @${ECHO_MSG}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/audio/mt-daapd/files/mt-daapd.sh.in b/audio/mt-daapd/files/mt-daapd.in
index 89fc2b719262..1043824306ce 100644
--- a/audio/mt-daapd/files/mt-daapd.sh.in
+++ b/audio/mt-daapd/files/mt-daapd.in
@@ -1,7 +1,6 @@
#!/bin/sh
#
-# $FreeBSD$
-# formerly $ FreeBSD: ports/audio/mt-daapd/files/mt-daapd.sh,v 1.1 2004/07/19 09:18:51 edwin Exp $
+# $FreeBSD: /tmp/pcvs/ports/audio/mt-daapd/files/Attic/mt-daapd.in,v 1.1 2011-04-07 17:29:56 culot Exp $
# PROVIDE: mt-daapd
# REQUIRE: LOGIN
@@ -15,7 +14,7 @@ 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"
+required_files="%%PREFIX%%/etc/mt-daapd.conf"
load_rc_config "$name"
run_rc_command "$1"
diff --git a/audio/mt-daapd/files/pkg-deinstall.in b/audio/mt-daapd/files/pkg-deinstall.in
index 17288b28d750..a17adfdbe2c7 100644
--- a/audio/mt-daapd/files/pkg-deinstall.in
+++ b/audio/mt-daapd/files/pkg-deinstall.in
@@ -1,7 +1,6 @@
#!/bin/sh
#
# $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
diff --git a/audio/mt-daapd/files/pkg-install.in b/audio/mt-daapd/files/pkg-install.in
index 7118e241bd11..e778c51adf57 100644
--- a/audio/mt-daapd/files/pkg-install.in
+++ b/audio/mt-daapd/files/pkg-install.in
@@ -1,33 +1,53 @@
#!/bin/sh
#
# $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
-
-case $2 in
-
-PRE-INSTALL)
- echo "---> Starting pre-install script:"
-
- if pw showgroup "%%GROUP%%" 2>/dev/null; then
- echo "---> Using existing group \"%%GROUP%%\""
- else
- echo "---> Adding group \"%%GROUP%%\""
- pw addgroup %%GROUP%% -h - || exit 1
- fi
-
-
- # Create user if required
- if pw showuser "%%USER%%" 2>/dev/null; then
- echo "---> Using existing user \"%%USER%%\""
- else
- echo "---> Adding user \"%%USER%%\""
- pw adduser %%USER%% -g %%GROUP%% -h - \
- -d "/nonexistent" -s "/sbin/nologin" -c "daapd User" || exit 1
- fi
-
- ;;
-
-esac
+if [ "$2" != "PRE-INSTALL" ]; then
+ exit 0
+fi
+
+SC_GROUP=%%GROUP%%
+SC_USER=%%USER%%
+SC_SHELL=/sbin/nologin
+SC_HOME=/nonexistent
+PW=`which pw`
+
+if ! ${PW} show group ${SC_GROUP} -q >/dev/null; then
+ gid=3689
+ while ${PW} show group -g ${gid} -q >/dev/null; do
+ gid=`expr ${gid} + 1`
+ done
+ if ! ${PW} add group ${SC_GROUP} -g ${gid}; then
+ e=$?
+ echo "*** Failed to add group \`${SC_GROUP}'. Please add it manually."
+ exit ${e}
+ fi
+ echo "*** Added group \`${SC_GROUP}' (id ${gid})"
+else
+ gid=`${PW} show group ${SC_GROUP} 2>/dev/null | cut -d: -f3`
+fi
+
+if ! ${PW} show user ${SC_USER} -q >/dev/null; then
+ uid=3689
+ while ${PW} show user -u ${uid} -q >/dev/null; do
+ uid=`expr ${uid} + 1`
+ done
+ if ! ${PW} add user ${SC_USER} -u ${uid} -g ${gid} -d "${SC_HOME}" \
+ -c "daapd User" -s "${SC_SHELL}" -p "*" \
+ ; then
+ e=$?
+ echo "*** Failed to add user \`${SC_USER}'. Please add it manually."
+ exit ${e}
+ fi
+ echo "*** Added user \`${SC_USER}' (id ${uid})"
+else
+ if ! ${PW} mod user ${SC_USER} -g ${gid} -d "${SC_HOME}" \
+ -c "daapd User" -s "${SC_SHELL}" -p "*" \
+ ; then
+ e=$?
+ echo "*** Failed to update user \`${SC_USER}'."
+ exit ${e}
+ fi
+ echo "*** Updated user \`${SC_USER}'."
+fi