From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Feb 28 21:10:29 2005 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0468516A4CE for ; Mon, 28 Feb 2005 21:10:29 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADFF643D2D for ; Mon, 28 Feb 2005 21:10:28 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j1SLAStv094376 for ; Mon, 28 Feb 2005 21:10:28 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j1SLASdI094375; Mon, 28 Feb 2005 21:10:28 GMT (envelope-from gnats) Resent-Date: Mon, 28 Feb 2005 21:10:28 GMT Resent-Message-Id: <200502282110.j1SLASdI094375@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Victor Balada Diaz Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 31C0616A4CF for ; Mon, 28 Feb 2005 21:09:03 +0000 (GMT) Received: from alf.dyndns.ws (244.Red-217-126-240.pooles.rima-tde.net [217.126.240.244]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADE4443D5D for ; Mon, 28 Feb 2005 21:09:01 +0000 (GMT) (envelope-from victor@alf.dyndns.ws) Received: from pato.euesrg02.net (pato.euesrg02.net [192.168.0.3]) by alf.dyndns.ws (8.13.1/8.13.1) with ESMTP id j1SL8xKH022088 for ; Mon, 28 Feb 2005 22:08:59 +0100 (CET) (envelope-from victor@smtp.euesrg02.net) Received: from pato.euesrg02.net (localhost [127.0.0.1]) by pato.euesrg02.net (8.13.1/8.13.1) with ESMTP id j1SL8x46017211 for ; Mon, 28 Feb 2005 22:08:59 +0100 (CET) (envelope-from victor@pato.euesrg02.net) Received: (from victor@localhost) by pato.euesrg02.net (8.13.1/8.13.1/Submit) id j1SL8xFH017210; Mon, 28 Feb 2005 22:08:59 +0100 (CET) (envelope-from victor) Message-Id: <200502282108.j1SL8xFH017210@pato.euesrg02.net> Date: Mon, 28 Feb 2005 22:08:59 +0100 (CET) From: Victor Balada Diaz To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/78213: [MAINTAINER] Update port: mail/milter-bogom to version 1.6 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Victor Balada Diaz List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2005 21:10:29 -0000 >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 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: