Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 May 2012 07:39:13 GMT
From:      KIKUCHI Koichiro <koichiro@rworks.jp>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/167766: [MAINTAINER-UPDATE][PATCH] net-mgmt/pandorafms_*: Fix pkg-plist errors
Message-ID:  <201205100739.q4A7dDIS083155@red.freebsd.org>
Resent-Message-ID: <201205100740.q4A7e16P013476@freefall.freebsd.org>

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

>Number:         167766
>Category:       ports
>Synopsis:       [MAINTAINER-UPDATE][PATCH] net-mgmt/pandorafms_*: Fix pkg-plist errors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 10 07:40:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     KIKUCHI Koichiro
>Release:        9.0-RELEASE
>Organization:
Rworks, Inc.
>Environment:
FreeBSD XXX 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
All of Pandora FMS ports don't remove home directory of the pandora user (/usr/local/etc/pandora/home) when ports are uninstalled.
It's cause pkg-plist errors.
>How-To-Repeat:
install and uninstall one of Pandora FMS ports (net-mgmt/pandorafms_agent, net-mgmt/pandorafms_console or net-mgmt/pandorafms_server)
>Fix:
Please apply attache patch

Patch attached with submission follows:

Index: pandorafms_agent/Makefile
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/pandorafms_agent/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- pandorafms_agent/Makefile	21 Apr 2012 12:27:39 -0000	1.1
+++ pandorafms_agent/Makefile	10 May 2012 07:20:43 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	pandora_agent
 PORTVERSION=	${PANDORA_VERSION}
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 
 MAINTAINER=	koichiro@rworks.jp
Index: pandorafms_agent/pkg-plist
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/pandorafms_agent/pkg-plist,v
retrieving revision 1.1
diff -u -r1.1 pkg-plist
--- pandorafms_agent/pkg-plist	21 Apr 2012 12:27:39 -0000	1.1
+++ pandorafms_agent/pkg-plist	10 May 2012 07:20:43 -0000
@@ -25,4 +25,3 @@
 @dirrmtry %%DATADIR%%
 @dirrmtry %%ETCDIR%%/collections
 @dirrmtry %%ETCDIR%%/plugins
-@dirrmtry %%ETCDIR%%
Index: pandorafms_console/Makefile
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/pandorafms_console/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- pandorafms_console/Makefile	21 Apr 2012 12:27:40 -0000	1.1
+++ pandorafms_console/Makefile	10 May 2012 07:20:43 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	pandora_console
 PORTVERSION=	${PANDORA_VERSION}
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 
 MAINTAINER=	koichiro@rworks.jp
Index: pandorafms_server/Makefile
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/pandorafms_server/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- pandorafms_server/Makefile	21 Apr 2012 12:27:40 -0000	1.1
+++ pandorafms_server/Makefile	10 May 2012 07:20:43 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	pandora_server
 PORTVERSION=	${PANDORA_VERSION}
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 
 MAINTAINER=	koichiro@rworks.jp
Index: pandorafms_server/bsd.pandora.mk
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/pandorafms_server/bsd.pandora.mk,v
retrieving revision 1.1
diff -u -r1.1 bsd.pandora.mk
--- pandorafms_server/bsd.pandora.mk	21 Apr 2012 12:27:40 -0000	1.1
+++ pandorafms_server/bsd.pandora.mk	10 May 2012 07:20:43 -0000
@@ -25,6 +25,8 @@
 ETCDIR?=	${PANDORA_ETCDIR}
 SPOOLDIR?=	${PANDORA_SPOOLDIR}
 LOGDIR?=	${PANDORA_LOGDIR}
+HOMEDIR?=	${PANDORA_HOMEDIR}
+HOMEDIR_REL=	${HOMEDIR:S,^${PREFIX}/,,}
 
 PLIST_SUB+=	SPOOLDIR="${PANDORA_SPOOLDIR}" LOGDIR="${PANDORA_LOGDIR}" \
 		USE_SPOOL_IN=${USE_SPOOL_IN} USE_SPOOL_OUT=${USE_SPOOL_OUT} \
@@ -58,3 +60,7 @@
 pre-install:
 	@${CAT} ${PKGDIR}/../pandorafms_server/pkg-plist.spool > ${PLIST}
 	@${CAT} ${PKGDIR}/pkg-plist >> ${PLIST}
+	@${ECHO_MSG} '@exec [ -e "%D/${ETCDIR_REL}" ] || ${MKDIR} "%D/${ETCDIR_REL}"' >> ${PLIST}
+	@${ECHO_MSG} '@exec if [ -e "%D/${HOMEDIR_REL}" ];then ${TRUE}; else ${MKDIR} "%D/${HOMEDIR_REL}"; ${CHOWN} ${USER}:${GROUP} "%D/${HOMEDIR_REL}";fi' >> ${PLIST}
+	@${ECHO_MSG} '@unexec ${RMDIR} "%D/${HOMEDIR_REL}" 2>/dev/null || ${TRUE}' >> ${PLIST}
+	@${ECHO_MSG} '@unexec ${RMDIR} "%D/${ETCDIR_REL}" 2>/dev/null || ${TRUE}' >> ${PLIST}
Index: pandorafms_server/pkg-plist
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/pandorafms_server/pkg-plist,v
retrieving revision 1.1
diff -u -r1.1 pkg-plist
--- pandorafms_server/pkg-plist	21 Apr 2012 12:27:40 -0000	1.1
+++ pandorafms_server/pkg-plist	10 May 2012 07:20:43 -0000
@@ -84,8 +84,9 @@
 %%DATADIR%%/util/udp_client.pl
 %%DATADIR%%/util/windows.README
 etc/periodic/daily/199.clean-pandoradb
+@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/PandoraFMS
 @dirrm %%SITE_PERL%%/PandoraFMS/Traceroute
-@dirrm %%SITE_PERL%%/PandoraFMS
+@dirrmtry %%SITE_PERL%%/PandoraFMS
 @dirrm %%DATADIR%%/util/plugin/babel_plugin
 @dirrm %%DATADIR%%/util/plugin/integria_plugin
 @dirrm %%DATADIR%%/util/pandora2ast
@@ -95,4 +96,3 @@
 @dirrmtry %%DATADIR%%
 @dirrmtry %%PREFIX%%/etc/periodic/daily
 @dirrmtry %%PREFIX%%/etc/periodic
-@dirrmtry %%ETCDIR%%


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



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