- 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)
This commit is contained in:
Frederic Culot 2011-04-07 17:29:56 +00:00
parent e3ab3e7b8d
commit 7c9c070efe
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=272346
4 changed files with 71 additions and 43 deletions

View File

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

View File

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

View File

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

View File

@ -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
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
case $2 in
SC_GROUP=%%GROUP%%
SC_USER=%%USER%%
SC_SHELL=/sbin/nologin
SC_HOME=/nonexistent
PW=`which pw`
PRE-INSTALL)
echo "---> Starting pre-install script:"
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 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 ! ${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