From nobody@FreeBSD.org  Wed Feb 10 16:23:00 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D9BD4106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 10 Feb 2010 16:23:00 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id C38C18FC1F
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 10 Feb 2010 16:23:00 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AGN0WF025771
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 10 Feb 2010 16:23:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o1AGN0p1025769;
	Wed, 10 Feb 2010 16:23:00 GMT
	(envelope-from nobody)
Message-Id: <201002101623.o1AGN0p1025769@www.freebsd.org>
Date: Wed, 10 Feb 2010 16:23:00 GMT
From: "Alexey V. Panfilov" <ports@subnets.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] net-mgmt/mrtg: use $USERS & $GROUPS to handle users instead of via pkg-install and fix translations
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         143728
>Category:       ports
>Synopsis:       [PATCH] net-mgmt/mrtg: use $USERS & $GROUPS to handle users instead of via pkg-install and fix translations
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pgollucci
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 10 16:30:01 UTC 2010
>Closed-Date:    Thu Feb 11 19:54:46 UTC 2010
>Last-Modified:  Thu Feb 11 19:54:46 UTC 2010
>Originator:     Alexey V. Panfilov
>Release:        7.3-PRERELEASE
>Organization:
n/a
>Environment:
FreeBSD work-book.lehis.ru 7.3-PRERELEASE FreeBSD 7.3-PRERELEASE #4: Tue Feb  9 11:34:27 MSK 2010     root@work-book.lehis.ru:/usr/obj/usr/src/sys/BOOK-STABLE  i386

>Description:
This is aggregated PR:
1. http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/143179 (please, close it - current PR includes it) - remove /var/run/mrtg via pkg-deinstall instead of via plist
pkg-install is already listed in SUB_FILES, no need to invoke sed manually

Received via e-mail:
2. Fix wrong choice strings for translation
3. Fix some words at russian translation

Added file(s):
- files/pkg-deinstall.in
- files/patch-aa
- files/patch-ab
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN --exclude=CVS Makefile Makefile
--- Makefile	2010-02-05 14:42:41.000000000 +0300
+++ Makefile	2010-02-10 18:00:43.000000000 +0300
@@ -7,7 +7,7 @@
 
 PORTNAME=	mrtg
 PORTVERSION=	2.16.2
-PORTREVISION=	4
+PORTREVISION=	5
 PORTEPOCH=	1
 CATEGORIES=	net-mgmt ipv6
 MASTER_SITES=	http://oss.oetiker.ch/mrtg/pub/ \
@@ -24,22 +24,21 @@
 CONFIGURE_ARGS=	--with-gd-lib=${LOCALBASE}/lib \
 		--with-gd-inc=${LOCALBASE}/include
 
+USERS=		mrtg
+GROUPS=		mrtg
+
 USE_PERL5=	YES
 MAKE_ENV+=	PERL=${PERL}
-MRTG_USER?=	mrtg
-MRTG_GROUP?=	mrtg
-MRTG_UID?=	279
-MRTG_GID?=	279
 MRTG_RUNDIR?=	/var/run/mrtg
 
 USE_RC_SUBR=	mrtg_daemon
-SUB_FILES=	pkg-install pkg-message
+SUB_FILES=	pkg-deinstall pkg-install pkg-message
 SUB_LIST=	PERL=${PERL} \
-		MRTG_USER=${MRTG_USER} \
-		MRTG_GROUP=${MRTG_GROUP} \
-		MRTG_UID=${MRTG_UID} \
-		MRTG_GID=${MRTG_GID} \
-		MRTG_RUNDIR=${MRTG_RUNDIR}
+		MRTG_RUNDIR=${MRTG_RUNDIR} \
+		USERS=${USERS} \
+		GROUPS=${GROUPS}
+PKGINSTALL=	${WRKDIR}/pkg-install
+PKGDEINSTALL=	${WRKDIR}/pkg-deinstall
 
 GNU_CONFIGURE=	YES
 CONFIGURE_ENV=	PERL=${PERL}
@@ -80,20 +79,12 @@
 post-patch:
 	@${RM} ${WRKSRC}/lib/mrtg2/BER.pm ${WRKSRC}/lib/mrtg2/SNMP_*.pm
 
-pre-configure:
-	@${SED} -e 's,%%MRTG_USER%%,${MRTG_USER},g;' \
-		-e 's,%%MRTG_GROUP%%,${MRTG_GROUP},g;' \
-		-e 's,%%MRTG_UID%%,${MRTG_UID},g;' \
-		-e 's,%%MRTG_GID%%,${MRTG_GID},g;' \
-		-e 's,%%MRTG_RUNDIR%%,${MRTG_RUNDIR},g;' \
-		< ${FILESDIR}/pkg-install.in > ${PKGINSTALL}
-	@${SETENV} @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} \
-		PRE-INSTALL
-
 do-install:
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
 	@${INSTALL_DATA} ${DOCS:S,^,${WRKSRC}/,} ${DOCSDIR}/
+.endif
+.if !defined(NOPORTEXAMPLES)
 	@${MKDIR} ${EXAMPLESDIR}/doc ${EXAMPLESDIR}/images
 	@${INSTALL_DATA} ${EXAMPLES:S,^,${WRKSRC}/doc/,} ${EXAMPLESDIR}/doc/
 	@${INSTALL_DATA} ${IMAGES:S,^,${WRKSRC}/images/,} ${EXAMPLESDIR}/images/
diff -ruN --exclude=CVS files/patch-aa files/patch-aa
--- files/patch-aa	1970-01-01 03:00:00.000000000 +0300
+++ files/patch-aa	2010-02-10 11:48:04.000000000 +0300
@@ -0,0 +1,11 @@
+--- bin/mrtg.orig	2010-01-15 17:02:33.000000000 +0300
++++ bin/mrtg	2010-01-15 16:38:33.000000000 +0300
+@@ -1608,7 +1608,7 @@
+         print HTML "
+ <!-- Begin $sample{$peri} -->
+ 		<div class=\"graph\">
+-			<h2>".&$LOC("$sample{$peri}")." ".&$LOC("Average)")."</h2>
++			<h2>".&$LOC("$sample{$peri}").&$LOC(" Average\)")."</h2>
+ 			<img src=\"$imagepath$router-$full{$peri}.${main::GRAPHFMT}\" title=\"$full{$peri}\" alt=\"$full{$peri}\" />
+ 			<table>
+ 				<tr>
diff -ruN --exclude=CVS files/patch-ab files/patch-ab
--- files/patch-ab	1970-01-01 03:00:00.000000000 +0300
+++ files/patch-ab	2010-02-10 11:48:04.000000000 +0300
@@ -0,0 +1,32 @@
+--- lib/mrtg2/locales_mrtg.pm.orig	2008-05-16 18:45:41.000000000 +0400
++++ lib/mrtg2/locales_mrtg.pm	2010-01-15 16:33:33.000000000 +0300
+@@ -4137,10 +4137,10 @@
+      'Max'                                    => '.',
+      'Current'                                => '',
+      'version'                                => '',
+-     '`Daily\' Graph \((.*) Minute'           => '  (  $1 ',
+-     '`Weekly\' Graph \(30 Minute'            => '  (  30 ' ,
+-     '`Monthly\' Graph \(2 Hour'              => '   (  2 ',
+-     '`Yearly\' Graph \(1 Day'                => '  (  1 ', 
++     '`Daily\' Graph \((.*) Minute'           => '  (  $1 ',
++     '`Weekly\' Graph \(30 Minute'            => '  (  30 ' ,
++     '`Monthly\' Graph \(2 Hour'              => '   (  2 ',
++     '`Yearly\' Graph \(1 Day'                => '  (  1 ', 
+      'Incoming Traffic in (\S+) per Second'   => '   $1  ',
+      'Outgoing Traffic in (\S+) per Second'   => '   $1  ',
+      'at which time (.*) had been up for(.*)' => '   $1   $2',
+@@ -4245,10 +4245,10 @@
+      'Max'                                    => '',
+      'Current'                                => '',
+      'version'                                => '',
+-     '`Daily\' Graph \((.*) Minute'           => '  (  $1 ',
+-     '`Weekly\' Graph \(30 Minute'            => '  (  30 ' ,
+-     '`Monthly\' Graph \(2 Hour'              => '   (  2 ',
+-     '`Yearly\' Graph \(1 Day'                => '  (  1 ', 
++     '`Daily\' Graph \((.*) Minute'           => '  (  $1 ',
++     '`Weekly\' Graph \(30 Minute'            => '  (  30 ' ,
++     '`Monthly\' Graph \(2 Hour'              => '   (  2 ',
++     '`Yearly\' Graph \(1 Day'                => '  (  1 ', 
+      'Incoming Traffic in (\S+) per Second'   => '   $1  ',
+      'Outgoing Traffic in (\S+) per Second'   => '   $1  ',
+      'at which time <strong>(\S+)</strong> had been up for <strong>(\S+)</strong>' => '    <strong>$1</strong>: <strong>$2</strong>.',
diff -ruN --exclude=CVS files/pkg-deinstall.in files/pkg-deinstall.in
--- files/pkg-deinstall.in	1970-01-01 03:00:00.000000000 +0300
+++ files/pkg-deinstall.in	2010-02-10 17:42:49.000000000 +0300
@@ -0,0 +1,2 @@
+#!/bin/sh
+rm -rf %%MRTG_RUNDIR%% 
diff -ruN --exclude=CVS files/pkg-install.in files/pkg-install.in
--- files/pkg-install.in	2008-05-24 06:31:24.000000000 +0400
+++ files/pkg-install.in	2010-02-10 17:42:49.000000000 +0300
@@ -8,27 +8,16 @@
 MKDIR="/bin/mkdir -p"
 NOLOGIN="/usr/sbin/nologin"
 
-MRTG_USER=%%MRTG_USER%%
-MRTG_GROUP=%%MRTG_GROUP%%
-MRTG_UID=%%MRTG_UID%%
-MRTG_GID=%%MRTG_GID%%
 MRTG_RUNDIR=%%MRTG_RUNDIR%%
 
 case "$2" in
-	
-PRE-INSTALL)
-  ${PW} groupshow -n ${MRTG_GROUP} >/dev/null 2>&1 \
-    || ${PW} groupadd -n ${MRTG_GROUP} -g ${MRTG_GID}
-  ${PW} usershow -n ${MRTG_USER} >/dev/null 2>&1 \
-    || ${PW} useradd ${MRTG_USER} -g ${MRTG_GROUP} -u ${MRTG_UID} -s ${NOLOGIN}
-  ;;
 
 POST-INSTALL)
 	if [ ! -d "$MRTG_RUNDIR" ]; then
 		${MKDIR} $MRTG_RUNDIR
 	fi
 
-	${CHOWN} -R ${MRTG_USER}:${MRTG_USER} ${MRTG_RUNDIR}
+	${CHOWN} -R %%USERS%%:%%GROUPS%% ${MRTG_RUNDIR}
 	${CHMOD} 0700 ${MRTG_RUNDIR}
 	;;
 esac
diff -ruN --exclude=CVS pkg-plist pkg-plist
--- pkg-plist	2010-01-10 18:09:14.000000000 +0300
+++ pkg-plist	2010-02-10 17:42:49.000000000 +0300
@@ -61,7 +61,6 @@
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/mrtg-r.png
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/mrtg-ti.gif
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/mrtg-ti.png
-@dirrmtry /var/run/mrtg
 @dirrmtry %%ETCDIR%%
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
 %%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%/images


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->pgollucci 
Responsible-Changed-By: pgollucci 
Responsible-Changed-When: Thu Feb 11 03:41:50 UTC 2010 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=143728 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/143728: commit references a PR
Date: Thu, 11 Feb 2010 19:42:41 +0000 (UTC)

 pgollucci    2010-02-11 19:42:33 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net-mgmt/mrtg        Makefile pkg-plist 
     net-mgmt/mrtg/files  pkg-install.in 
   Added files:
     net-mgmt/mrtg/files  patch-aa patch-ab pkg-deinstall.in 
   Log:
   1. remove /var/run/mrtg via pkg-deinstall instead of via plist
      pkg-install is already listed in SUB_FILES, no need to invoke sed manually
   2. Fix wrong choice strings for translation
   3. Fix some words at russian translation
   
   PR:             ports/143728, ports/143179
   Submitted by:   "Alexey V. Panfilov" <ports@subnets.ru> (maintainer)
   
   Revision  Changes    Path
   1.104     +12 -21    ports/net-mgmt/mrtg/Makefile
   1.4       +11 -0     ports/net-mgmt/mrtg/files/patch-aa (new)
   1.1       +32 -0     ports/net-mgmt/mrtg/files/patch-ab (new)
   1.1       +2 -0      ports/net-mgmt/mrtg/files/pkg-deinstall.in (new)
   1.2       +2 -13     ports/net-mgmt/mrtg/files/pkg-install.in
   1.27      +0 -1      ports/net-mgmt/mrtg/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: pgollucci 
State-Changed-When: Thu Feb 11 19:54:45 UTC 2010 
State-Changed-Why:  
Committed, Thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=143728 
>Unformatted:
