ports/151299: audio/mt-daapd: portlint(1) fixes and more

Takefu takefu at airport.fm
Fri Oct 8 10:40:02 UTC 2010


>Number:         151299
>Category:       ports
>Synopsis:       audio/mt-daapd: portlint(1) fixes and more
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 08 10:40:02 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Takefu
>Release:        
>Organization:
FOX Amateur Radio Club
>Environment:
>Description:
  portlint(1) fixes.
  Makefile unwanted spaces and changes to the tab and remove unwanted comments.
  UID / GID immobilized.
  Changes in Japanese patch download location.

>How-To-Repeat:
>Fix:
--- mt-daapd.diff begins here ---
diff -ruN /usr/ports/audio/mt-daapd/Makefile audio/mt-daapd/Makefile
--- /usr/ports/audio/mt-daapd/Makefile	2010-09-17 10:33:03.000000000 +0900
+++ audio/mt-daapd/Makefile	2010-10-06 16:38:32.000000000 +0900
@@ -14,39 +14,43 @@
 MAINTAINER=	mark at 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:267 autoconf:267: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} "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})"
+	@${ECHO_CMD} "DAAPD_DBDIR=${DAAPD_DBDIR} (default: ${DAAPD_MASTERDIR}/var/db/${PORTNAME})"

 pre-install:
 	@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
@@ -69,5 +73,11 @@
 	@${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 -ruN /usr/ports/audio/mt-daapd/files/mt-daapd.in audio/mt-daapd/files/mt-daapd.in
--- /usr/ports/audio/mt-daapd/files/mt-daapd.in	1970-01-01 09:00:00.000000000 +0900
+++ audio/mt-daapd/files/mt-daapd.in	2010-10-05 14:35:32.000000000 +0900
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/audio/mt-daapd/files/mt-daapd.sh.in,v 1.2 2010/03/27 00:12:42 dougb Exp $
+
+# PROVIDE: mt-daapd
+# REQUIRE: LOGIN
+
+. /etc/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"
+
+load_rc_config "$name"
+run_rc_command "$1"
diff -ruN /usr/ports/audio/mt-daapd/files/mt-daapd.sh.in audio/mt-daapd/files/mt-daapd.sh.in
--- /usr/ports/audio/mt-daapd/files/mt-daapd.sh.in	2010-03-30 13:27:06.000000000 +0900
+++ audio/mt-daapd/files/mt-daapd.sh.in	1970-01-01 09:00:00.000000000 +0900
@@ -1,21 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/audio/mt-daapd/files/mt-daapd.sh.in,v 1.2 2010/03/27 00:12:42 dougb Exp $
-# 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
-
-. /etc/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"
diff -ruN /usr/ports/audio/mt-daapd/files/pkg-deinstall.in audio/mt-daapd/files/pkg-deinstall.in
--- /usr/ports/audio/mt-daapd/files/pkg-deinstall.in	2006-06-25 22:17:25.000000000 +0900
+++ audio/mt-daapd/files/pkg-deinstall.in	2010-10-06 13:54:02.000000000 +0900
@@ -1,7 +1,6 @@
 #!/bin/sh
 #
-# $FreeBSD: ports/audio/mt-daapd/files/pkg-deinstall.in,v 1.1 2006/06/25 13:17:25 itetcu Exp $
-# formerly $ FreeBSD: ports/audio/mt-daapd/pkg-deinstall,v 1.1 2004/08/05 23:00:09 edwin Exp $
+# $FreeBSD$
 #

 PATH=/bin:/usr/bin:/usr/sbin
diff -ruN /usr/ports/audio/mt-daapd/files/pkg-install.in audio/mt-daapd/files/pkg-install.in
--- /usr/ports/audio/mt-daapd/files/pkg-install.in	2006-06-25 22:17:25.000000000 +0900
+++ audio/mt-daapd/files/pkg-install.in	2010-10-05 14:35:32.000000000 +0900
@@ -1,33 +1,53 @@
 #!/bin/sh
 #
 # $FreeBSD: ports/audio/mt-daapd/files/pkg-install.in,v 1.1 2006/06/25 13:17:25 itetcu Exp $
-# 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
--- mt-daapd.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list