From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Sep 22 13:20:03 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org 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 4CE7116A420 for ; Thu, 22 Sep 2005 13:20:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA2C143D53 for ; Thu, 22 Sep 2005 13:20:01 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j8MDK1Hn001222 for ; Thu, 22 Sep 2005 13:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j8MDK1hM001221; Thu, 22 Sep 2005 13:20:01 GMT (envelope-from gnats) Resent-Date: Thu, 22 Sep 2005 13:20:01 GMT Resent-Message-Id: <200509221320.j8MDK1hM001221@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, Blaz Zupan Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 807E616A41F for ; Thu, 22 Sep 2005 13:12:28 +0000 (GMT) (envelope-from blaz@titanic.medinet.si) Received: from out-1.mail.amis.net (out-1.mail.amis.net [212.18.32.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BE6D43D7E for ; Thu, 22 Sep 2005 13:12:26 +0000 (GMT) (envelope-from blaz@titanic.medinet.si) Received: from localhost (in-2.mail.amis.net [212.18.32.19]) by out-1.mail.amis.net (Postfix) with ESMTP id 7E5F25B5DC6 for ; Thu, 22 Sep 2005 15:12:25 +0200 (CEST) Received: from in-2.mail.amis.net ([127.0.0.1]) by localhost (in-2.mail.amis.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 92213-05 for ; Thu, 22 Sep 2005 15:12:10 +0200 (CEST) Received: from smtp.amis.net (smtp.amis.net [IPv6:2001:15c0::41]) by in-2.mail.amis.net (Postfix) with ESMTP id BAFD2525FE0 for ; Thu, 22 Sep 2005 15:12:06 +0200 (CEST) Received: from titanic.medinet.si (titanic.medinet.si [IPv6:2001:15c0:ffff:4242::5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.amis.net (Postfix) with ESMTP id 6FA1D396810 for ; Thu, 22 Sep 2005 15:12:06 +0200 (CEST) Received: (from blaz@localhost) by titanic.medinet.si (8.13.3/8.13.3/Submit) id j8MDC5Kh051547; Thu, 22 Sep 2005 15:12:05 +0200 (CEST) (envelope-from blaz) Message-Id: <200509221312.j8MDC5Kh051547@titanic.medinet.si> Date: Thu, 22 Sep 2005 15:12:05 +0200 (CEST) From: Blaz Zupan To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/86459: Update net-mgmt/snmptt to 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Blaz Zupan List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2005 13:20:03 -0000 >Number: 86459 >Category: ports >Synopsis: Update net-mgmt/snmptt to 1.0 >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: Thu Sep 22 13:20:01 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Blaz Zupan >Release: FreeBSD 5.4-RELEASE i386 >Organization: >Environment: >Description: This patch has been sent directly to the maintainer on August 27th. A month has passed and I have received no reply, so I'm sending it in as a PR. The snmptt port is currently at version 0.9. Version 1.0 has been released more then a year ago and it fixes (among others) a nasty problem with logging to MySQL databases. I have created a patch that updates the port to 1.0. I have also taken the freedom to do some other fixes on the port. On deinstallation, the port unconditionally deleted the snmptt.ini file, which is bad for the user who has changed the configuration. Same goes for the snmptt.conf.generic file. Also, the sample snmptt.ini contains the wrong path to the snmptt.conf.generic file. I have also removed the installation of the rc script to /etc/rc.d on FreeBSD 5.x. It is completely unneccesary for this port, as it does not depend on any other service running. The startup script is now installed to /usr/local/etc/rc.d. Also, because the user might want to create many snmptt.conf.XXXX files, it is better to install the configuration files to /usr/local/etc/snmptt, so they don't clutter up the general /usr/local/etc directory. Below is the patch. Please review it and commit if you think it is ok. >How-To-Repeat: >Fix: diff -urN snmptt.orig/Makefile snmptt/Makefile --- snmptt.orig/Makefile Mon May 24 20:41:01 2004 +++ snmptt/Makefile Sat Aug 27 13:25:56 2005 @@ -6,7 +6,7 @@ # PORTNAME= snmptt -PORTVERSION= 0.9 +PORTVERSION= 1.0 CATEGORIES= net-mgmt MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} @@ -26,9 +26,8 @@ DOCS= faqs.html index.html layout1.css snmptt.html \ snmpttconvert.html snmpttconvertmib.html -RUN_DEPENDS+= \ - ${SITE_PERL}/${PERL_ARCH}/SNMP.pm:${PORTSDIR}/net-mgmt/net-snmp \ - ${SITE_PERL}/Config/IniFiles.pm:${PORTSDIR}/devel/p5-Config-IniFiles +RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/SNMP.pm:${PORTSDIR}/net-mgmt/net-snmp \ + ${SITE_PERL}/Config/IniFiles.pm:${PORTSDIR}/devel/p5-Config-IniFiles SED_SCRIPT= -e 's,%%PREFIX%%,${PREFIX},g' \ -e 's,%%RC_SUBR%%,${RC_SUBR},g' \ @@ -40,31 +39,33 @@ .include -.if ${OSVERSION} >= 500038 -RC_SUBR?= ${DESTDIR}/etc/rc.subr -RC_DIR= ${DESTDIR}/etc/rc.d -RC_SUFX= -.else USE_RC_SUBR= yes RC_DIR= ${PREFIX}/etc/rc.d RC_SUFX= .sh -.endif do-build: post-build: @${SED} ${SED_SCRIPT} ${FILESDIR}/snmptt.sh > ${WRKDIR}/snmptt.sh - @${ECHO_CMD} ${WRKSRC}/snmptt ${WRKSRC}/snmptthandler | ${XARGS} \ + @${ECHO_CMD} ${WRKSRC}/snmptt ${WRKSRC}/snmptthandler ${WRKSRC}/snmptt.ini | ${XARGS} \ ${REINPLACE_CMD} -e \ "s|/etc/snmptt.ini|${PREFIX}/etc/snmptt.ini|g ; \ - s|/etc/snmp/snmptt.ini|${PREFIX}/etc/snmp/snmptt.ini|g" + s|/etc/snmp/snmptt.ini|${PREFIX}/etc/snmp/snmptt.ini|g ; \ + s|/etc/snmp/snmptt.conf|${PREFIX}/etc/snmp/snmptt.conf.generic|g" do-install: .for _SCRIPT in ${SCRIPTS} ${INSTALL_SCRIPT} ${WRKSRC}/${_SCRIPT} ${PREFIX}/sbin .endfor - ${INSTALL_DATA} ${WRKSRC}/snmptt.ini ${PREFIX}/etc - ${INSTALL_DATA} ${WRKSRC}/examples/snmptt.conf.generic ${PREFIX}/etc + ${MKDIR} ${PREFIX}/etc/snmp + ${INSTALL_DATA} ${WRKSRC}/snmptt.ini ${PREFIX}/etc/snmp/snmptt.ini-dist +.if !exists(${PREFIX}/etc/snmp/snmptt.ini) + ${INSTALL_DATA} ${WRKSRC}/snmptt.ini ${PREFIX}/etc/snmp +.endif + ${INSTALL_DATA} ${WRKSRC}/examples/snmptt.conf.generic ${PREFIX}/etc/snmp/snmptt.conf.generic-dist +.if !exists(${PREFIX}/etc/snmp/snmptt.conf) + ${INSTALL_DATA} ${WRKSRC}/examples/snmptt.conf.generic ${PREFIX}/etc/snmp/snmptt.conf.generic +.endif .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} .for _DOC in ${DOCS} diff -urN snmptt.orig/distinfo snmptt/distinfo --- snmptt.orig/distinfo Mon May 24 20:41:01 2004 +++ snmptt/distinfo Sat Aug 27 13:25:56 2005 @@ -1,2 +1,2 @@ -MD5 (snmptt_0.9.tgz) = 85090dee54ed5772c4e6ec939d954271 -SIZE (snmptt_0.9.tgz) = 107679 +MD5 (snmptt_1.0.tgz) = ad93fc3d7b28eb59c153ce2761644838 +SIZE (snmptt_1.0.tgz) = 110663 diff -urN snmptt.orig/files/snmptt.sh snmptt/files/snmptt.sh --- snmptt.orig/files/snmptt.sh Mon May 24 20:41:01 2004 +++ snmptt/files/snmptt.sh Sat Aug 27 13:25:56 2005 @@ -21,13 +21,13 @@ rcvar=`set_rcvar` command=%%PREFIX%%/sbin/${name} -command_args="--daemon" +command_args=">/dev/null --daemon" pidfile=/var/run/${name}.pid # XXX: Makes assumptions about the interpreter path and version. However, # USE_PERL5 should guarantee that this path is valid. In any event, we # don't sed-ify the #! operators. procname=/usr/bin/perl -required_files=%%PREFIX%%/etc/${name}.ini +required_files=%%PREFIX%%/etc/snmp/${name}.ini # set defaults diff -urN snmptt.orig/pkg-plist snmptt/pkg-plist --- snmptt.orig/pkg-plist Mon May 24 20:41:01 2004 +++ snmptt/pkg-plist Sat Aug 27 13:25:56 2005 @@ -3,8 +3,13 @@ sbin/snmpttconvert sbin/snmpttconvertmib sbin/snmptthandler -etc/snmptt.ini -etc/snmptt.conf.generic +@unexec if cmp -s %D/etc/snmp/snmptt.ini %D/etc/snmp/snmptt.ini-dist; then rm -f %D/etc/snmp/snmptt.ini; fi +etc/snmp/snmptt.ini-dist +@exec [ ! -f %B/snmptt.ini ] && cp %B/%f %B/snmptt.ini +@unexec if cmp -s %D/etc/snmp/snmptt.conf.generic %D/etc/snmp/snmptt.conf.generic-dist; then rm -f %D/etc/snmp/snmptt.conf.generic; fi +etc/snmp/snmptt.conf.generic-dist +@exec [ ! -f %B/snmptt.conf.generic ] && cp %B/%f %B/snmptt.conf.generic +@unexec rmdir %D/etc/snmp 2>/dev/null || true %%PORTDOCS%%%%DOCSDIR%%/faqs.html %%PORTDOCS%%%%DOCSDIR%%/index.html %%PORTDOCS%%%%DOCSDIR%%/layout1.css >Release-Note: >Audit-Trail: >Unformatted: