ports/142811: [PATCH] mail/dcc-dccd: Use SUB_FILES to update pkg-install & deinstall

Sevan Janiyan venture37 at geeklan.co.uk
Thu Jan 14 04:00:11 UTC 2010


>Number:         142811
>Category:       ports
>Synopsis:       [PATCH] mail/dcc-dccd: Use SUB_FILES to update pkg-install & deinstall
>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:   Thu Jan 14 04:00:10 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Sevan Janiyan
>Release:        FreeBSD 8.0-RELEASE-p2 amd64
>Organization:
>Environment:
System: FreeBSD newbie.thingamajig-systems.co.uk 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan  5 21:11:58 UTC
>Description:
Instead of invoking sed manually

Added file(s):
- files/pkg-deinstall.in
- files/pkg-install.in

Removed file(s):
- pkg-deinstall
- pkg-install

Port maintainer (cgreen at sentex.net) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- dcc-dccd-1.3.116.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/dcc-dccd/Makefile,v
retrieving revision 1.45
diff -u -r1.45 Makefile
--- Makefile	13 Nov 2009 00:13:07 -0000	1.45
+++ Makefile	14 Jan 2010 03:46:18 -0000
@@ -23,9 +23,6 @@
 MAN8=		cdcc.8 dbclean.8 dblist.8 dcc.8 dccd.8 dccifd.8 dccm.8 \
 		dccproc.8 dccsight.8
 
-PKGINSTALL=	${WRKDIR}/pkg-install
-PKGDEINSTALL=	${WRKDIR}/pkg-deinstall
-
 USE_RC_SUBR=
 
 #
@@ -70,10 +67,11 @@
 #
 CONFIGURE_ARGS=	--with-uid=${DCCUSER} --bindir=${PREFIX}/bin --mandir=${MANPREFIX}/man --with-configsuffix=.sample
 
-.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
 
-SUB_FILES=		pkg-message
-SUB_LIST+=		WRKSRC=${WRKSRC}
+SUB_FILES=		pkg-install pkg-deinstall pkg-message
+SUB_LIST+=		WRKSRC=${WRKSRC} DCCUSER=${DCCUSER} DCCUID=${DCCUID} \
+			DCCGROUP=${DCCGROUP} DCCGID=${DCCGID} DCCHOME=${DCCHOME}
 
 ## /var/dcc home support
 #
@@ -86,7 +84,6 @@
 PLIST_SUB+=		WITH_ALT_HOME="@comment "
 .endif
 
-SUB_LIST+=		DCCHOME=${DCCHOME}
 CONFIGURE_ARGS+=	--homedir=${DCCHOME}
 
 ## dccm milter support
@@ -172,22 +169,13 @@
 PLIST_SUB+=	WITH_DCCGREY="@comment "
 .endif
 
-## Substitutions in pkg-install and pkg-deinstall
-#
-SED_SCRIPT=	-e 's|%%PREFIX%%|${PREFIX}|g' \
-		-e 's|%%DCCUSER%%|${DCCUSER}|g' -e 's|%%DCCUID%%|${DCCUID}|g' \
-		-e 's|%%DCCGROUP%%|${DCCGROUP}|g' -e 's|%%DCCGID%%|${DCCGID}|g' \
-		-e 's|%%DCCHOME%%|${DCCHOME}|g'
+.include <bsd.port.pre.mk>
 
 pre-everything::
 	@${ECHO_MSG} ' '
 	@${ECHO_MSG} 'A description of ALT_HOME may be found in the port's Makefile.'
 	@${ECHO_MSG} ' '
 
-post-build:
-	@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-install >${PKGINSTALL}
-	@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-deinstall >${PKGDEINSTALL}
-
 pre-install:
 	@${SETENV} PKG_PREFIX=${PREFIX} \
 	${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL
Index: pkg-deinstall
===================================================================
RCS file: pkg-deinstall
diff -N pkg-deinstall
--- pkg-deinstall	21 Nov 2004 02:35:45 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-# $FreeBSD: ports/mail/dcc-dccd/pkg-deinstall,v 1.1 2004/11/21 02:35:45 pav Exp $
-
-if [ "$2" != "POST-DEINSTALL" ]; then
-	exit 0
-fi
-
-DCCUSER=%%DCCUSER%%
-
-if pw usershow "${DCCUSER}" 2>/dev/null 1>&2; then
-	echo "To delete ${DCCUSER} user permanently, use 'pw userdel \"${DCCUSER}\"'"
-fi
-exit 0
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install	15 Jun 2009 19:10:40 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,52 +0,0 @@
-#!/bin/sh
-# $FreeBSD: ports/mail/dcc-dccd/pkg-install,v 1.2 2009/06/15 19:10:40 dhn Exp $
-
-PREFIX=${PKG_PREFIX:-%%PREFIX%%}
-
-DCCUSER=%%DCCUSER%%
-DCCUID=%%DCCUID%%
-DCCGROUP=%%DCCGROUP%%
-DCCGID=%%DCCGID%%
-DCCHOME=%%DCCHOME%%
-
-if [ "$2" = "PRE-INSTALL" ]; then
-
-	if ! pw groupshow "$DCCGROUP" 2>/dev/null 1>&2; then
-		if pw groupadd $DCCGROUP -g $DCCGID; then
-			echo "=> Added group \"$DCCGROUP\"."
-		else
-			echo "=> Adding group \"$DCCGROUP\" failed..."
-			exit 1
-		fi
-	fi
-
-	if ! pw usershow "$DCCUSER" 2>/dev/null 1>&2; then
-		if pw useradd $DCCUSER -u $DCCUID -g $DCCGROUP -h - \
-			-s "/sbin/nologin" -d "$DCCHOME" \
-			-c "Distributed Checksum Clearinghouse"; \
-		then
-			echo "=> Added user \"$DCCUSER\"."
-		else
-			echo "=> Adding user \"$DCCUSER\" failed..."
-			exit 1
-		fi
-	fi
-elif [ "$2" = "POST-INSTALL" ]; then
-
-	echo "=> Generating unique passwords for your DCC install..."
-	echo "=>"
-	echo "=> Note this will make map.sample, map.txt.sample and"
-	echo "=> ids.sample fail their MD5 checks on package removal."
-
-	/bin/sh $PREFIX/dcc/libexec/fix-map \
-	-n .sample \
-	-I $DCCHOME/ids.sample -i $DCCHOME/ids \
-	-T $DCCHOME/map.txt.sample -t $DCCHOME/map.txt \
-	-m $DCCHOME/map
-
-        for file in ids map map.txt ; do
-                /bin/cp -p $DCCHOME/$file $DCCHOME/${file}.sample
-        done
-fi
-
-exit 0
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/mail/dcc-dccd/pkg-plist,v
retrieving revision 1.17
diff -u -r1.17 pkg-plist
--- pkg-plist	4 Aug 2009 00:00:27 -0000	1.17
+++ pkg-plist	14 Jan 2010 03:46:18 -0000
@@ -54,10 +54,10 @@
 %%WITH_ALT_HOME%%@cwd /var
 @comment -------------------------
 @comment The next group of three-line sets install/remove the config files
- at comment 
+ at comment
 @comment **** on uninstall, delete the config file if it matches the sample file
 @unexec if cmp -s %D/dcc/dcc_conf %D/dcc/dcc_conf.sample; then rm -f %D/dcc/dcc_conf; fi
- at comment 
+ at comment
 @comment **** the sample file is unilaterally installed/removed
 dcc/dcc_conf.sample
 @comment
Index: files/pkg-deinstall.in
===================================================================
RCS file: files/pkg-deinstall.in
diff -N files/pkg-deinstall.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pkg-deinstall.in	14 Jan 2010 03:46:18 -0000
@@ -0,0 +1,13 @@
+#!/bin/sh
+# $FreeBSD: ports/mail/dcc-dccd/pkg-deinstall,v 1.1 2004/11/21 02:35:45 pav Exp $
+
+if [ "$2" != "POST-DEINSTALL" ]; then
+	exit 0
+fi
+
+DCCUSER=%%DCCUSER%%
+
+if pw usershow "${DCCUSER}" 2>/dev/null 1>&2; then
+	echo "To delete ${DCCUSER} user permanently, use 'pw userdel \"${DCCUSER}\"'"
+fi
+exit 0
Index: files/pkg-install.in
===================================================================
RCS file: files/pkg-install.in
diff -N files/pkg-install.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pkg-install.in	14 Jan 2010 03:46:18 -0000
@@ -0,0 +1,52 @@
+#!/bin/sh
+# $FreeBSD: ports/mail/dcc-dccd/pkg-install,v 1.2 2009/06/15 19:10:40 dhn Exp $
+
+PREFIX=${PKG_PREFIX:-%%PREFIX%%}
+
+DCCUSER=%%DCCUSER%%
+DCCUID=%%DCCUID%%
+DCCGROUP=%%DCCGROUP%%
+DCCGID=%%DCCGID%%
+DCCHOME=%%DCCHOME%%
+
+if [ "$2" = "PRE-INSTALL" ]; then
+
+	if ! pw groupshow "$DCCGROUP" 2>/dev/null 1>&2; then
+		if pw groupadd $DCCGROUP -g $DCCGID; then
+			echo "=> Added group \"$DCCGROUP\"."
+		else
+			echo "=> Adding group \"$DCCGROUP\" failed..."
+			exit 1
+		fi
+	fi
+
+	if ! pw usershow "$DCCUSER" 2>/dev/null 1>&2; then
+		if pw useradd $DCCUSER -u $DCCUID -g $DCCGROUP -h - \
+			-s "/sbin/nologin" -d "$DCCHOME" \
+			-c "Distributed Checksum Clearinghouse"; \
+		then
+			echo "=> Added user \"$DCCUSER\"."
+		else
+			echo "=> Adding user \"$DCCUSER\" failed..."
+			exit 1
+		fi
+	fi
+elif [ "$2" = "POST-INSTALL" ]; then
+
+	echo "=> Generating unique passwords for your DCC install..."
+	echo "=>"
+	echo "=> Note this will make map.sample, map.txt.sample and"
+	echo "=> ids.sample fail their MD5 checks on package removal."
+
+	/bin/sh $PREFIX/dcc/libexec/fix-map \
+	-n .sample \
+	-I $DCCHOME/ids.sample -i $DCCHOME/ids \
+	-T $DCCHOME/map.txt.sample -t $DCCHOME/map.txt \
+	-m $DCCHOME/map
+
+        for file in ids map map.txt ; do
+                /bin/cp -p $DCCHOME/$file $DCCHOME/${file}.sample
+        done
+fi
+
+exit 0
--- dcc-dccd-1.3.116.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list