Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Feb 2005 22:08:59 +0100 (CET)
From:      Victor Balada Diaz <victor@alf.dyndns.ws>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/78213: [MAINTAINER] Update port: mail/milter-bogom to version 1.6
Message-ID:  <200502282108.j1SL8xFH017210@pato.euesrg02.net>
Resent-Message-ID: <200502282110.j1SLASdI094375@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         78213
>Category:       ports
>Synopsis:       [MAINTAINER] Update port: mail/milter-bogom to version 1.6
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 28 21:10:26 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Victor Balada Diaz
>Release:        FreeBSD 5.4-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD pato.euesrg02.net 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #1: Sat Feb 26 19:40:40 CET 2005 victor@pato.euesrg02.net:/usr/obj/usr/src/sys/DPATOKERNEL i386


	
>Description:
	Update the port to version 1.6, also the new version use rc.subr and
	creates a new user to run with less privileges.

	Should i send an other pr for the porters handbook to document this new
	user? (bogomilter with uid 174, the first free). 
>How-To-Repeat:
	
>Fix:

	

--- patch.diff begins here ---
Index: distinfo
===================================================================
--- distinfo	(revision 2)
+++ distinfo	(working copy)
@@ -1,2 +1,2 @@
-MD5 (bogom-1.5.1.tar.gz) = 9dc9fc890819e22df3408b8a39837606
-SIZE (bogom-1.5.1.tar.gz) = 16868
+MD5 (bogom-1.6.tar.gz) = 72783e09f4e62ace3846fe2d125bab6a
+SIZE (bogom-1.6.tar.gz) = 17448
Index: files/milter-bogom.sh
===================================================================
--- files/milter-bogom.sh	(revision 2)
+++ files/milter-bogom.sh	(working copy)
@@ -1,22 +1,42 @@
 #!/bin/sh
 
-case "$1" in
-	start)
-		if [ -f LOCALBASE/sbin/bogom ]
-		then
-			LOCALBASE/sbin/bogom -u root & > /dev/null	
-			echo -n ' milter-bogom' 
-		fi
-		;;
-	stop)
-		killall bogom
-		sleep 3 # wait for bogom to exit
-		;;
+# PROVIDE: milterbogom
+# REQUIRE: LOGIN
+# BEFORE: sendmail
+# KEYWORD: milterbogom
 
-	*)
-		echo ""
-		echo "Usage: `basename $0` { start | stop }"
-		echo ""
-		;;
-esac
-exit 0;
+milterbogom_enable=${milterbogom_enable-"NO"}
+milterbogom_socket=${milterbogom_socket-"unix:/var/run/bogom/milter.sock"}
+milterbogom_user=${milterbogom_user-"bogomilter"}
+milterbogom_pid=${milterbogom_pid-"/var/run/bogom/bogom.pid"}
+milterbogom_flags=${milterbogom_flags-"-u ${milterbogom_user} \
+-s ${milterbogom_socket} -p ${milterbogom_pid}"}
+
+
+. %%RC_SUBR%%
+
+name=milterbogom
+pidfile=${milterbogom_pid}
+rcvar=`set_rcvar`
+command=%%PREFIX%%/sbin/bogom
+start_precmd="bogom_precmd"
+stop_postcmd="bogom_postcmd"
+
+load_rc_config $name
+
+bogom_precmd()
+{
+    if [ -d `dirname ${milterbogom_pid}` ]
+    then
+	return;
+    fi
+    mkdir -p `dirname ${milterbogom_pid}`
+    chown ${milterbogom_user} `dirname ${milterbogom_pid}`
+}
+
+bogom_postcmd()
+{
+    # just if the directory is empty
+    rmdir `dirname ${milterbogom_pid}` > /dev/null 2>&1
+}
+run_rc_command "$1"
Index: pkg-install
===================================================================
--- pkg-install	(revision 0)
+++ pkg-install	(revision 3)
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ "$2" != "POST-INSTALL" ]
+then
+	exit 0;
+fi
+
+# check if bogomilter user exists
+pw user show bogomilter > /dev/null 2>&1
+
+if [ $? != 0 ]
+then
+	echo "===>  Adding user bogomilter"
+	pw useradd bogomilter -u 174 -c "milter-bogom"
+else
+	echo "===>  Using existing user bogomilter" 
+fi
Index: Makefile
===================================================================
--- Makefile	(revision 2)
+++ Makefile	(working copy)
@@ -6,9 +6,10 @@
 #
 
 PORTNAME=	milter-bogom
-PORTVERSION=	1.5.1
+PORTVERSION=	1.6
 CATEGORIES=	mail
-MASTER_SITES=	http://www.usebox.net/jjm/bogom/
+MASTER_SITES=	http://www.usebox.net/jjm/bogom/ \
+		http://blackshell.usebox.net/bogom/
 DISTNAME=	bogom-${PORTVERSION}
 
 MAINTAINER=	victor@alf.dyndns.ws
@@ -18,17 +19,17 @@
 
 MAN8=		bogom.8
 
+CFLAGS+=	-DDEF_CONF=\\\"${PREFIX}/etc/bogom.conf\\\" ${PTHREAD_CFLAGS}
+LIBS+=		-lmilter ${PTHREAD_LIBS}
+MAKE_ARGS=	LIBS="${LIBS}"
+
+USE_RC_SUBR=	yes
+
 PLIST_FILES=	sbin/bogom \
 		etc/bogom.conf-example \
 		etc/rc.d/milter-bogom.sh
-PORTDOCS=	README CHANGELOG
+PORTDOCS=	README CHANGELOG COPYING
 
-post-extract:
-	@${SED} -e 's/LIBS+=-lmilter -lpthread/LIBS+=-lmilter ${PTHREAD_LIBS}/'\
-	-i .bak ${WRKSRC}/Makefile
-	@${SED} -e 's|/etc/bogom.conf|${PREFIX}/etc/bogom.conf|' -i .bak \
-	${WRKSRC}/milter.c
-
 do-install:
 	@${INSTALL_PROGRAM} ${WRKSRC}/bogom ${PREFIX}/sbin
 	@${INSTALL_MAN} ${WRKSRC}/bogom.8 ${PREFIX}/man/man8
@@ -38,10 +39,14 @@
 	@${MKDIR} ${DOCSDIR}
 	@${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
 	@${INSTALL_DATA} ${WRKSRC}/CHANGELOG ${DOCSDIR}
+	@${INSTALL_DATA} ${WRKSRC}/COPYING ${DOCSDIR}
 .endif
 
 post-install:
-	@${SED} -e 's|LOCALBASE|${PREFIX}|g' -i "" \
+	@${SED} -e 's|%%PREFIX%%|${PREFIX}|g' -i "" \
 	${PREFIX}/etc/rc.d/milter-bogom.sh
+	@${SED} -e 's|%%RC_SUBR%%|${RC_SUBR}|g' -i "" \
+	${PREFIX}/etc/rc.d/milter-bogom.sh
+	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 
 .include <bsd.port.mk>
Index: pkg-deinstall
===================================================================
--- pkg-deinstall	(revision 0)
+++ pkg-deinstall	(revision 3)
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$2" = "POST-DEINSTALL" ] 
+then
+	echo "***************************************************************"
+	echo "* The bogomilter user will not be removed by this port        *"
+	echo "* if you are not upgrading and will not use this port anymore *"
+	echo "* delete the bogomilter user using:                           *"
+	echo "* pw userdel bogomilter                                       *"
+	echo "***************************************************************"
+fi
--- patch.diff ends here ---


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502282108.j1SL8xFH017210>