ports/110649: Bring back plugins support to cacti

Timur I. Bakeyev timur at gnu.org
Thu Mar 22 00:50:04 UTC 2007


>Number:         110649
>Category:       ports
>Synopsis:       Bring back plugins support to cacti
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 22 00:50:03 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Timur I. Bakeyev
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
>Environment:


System: FreeBSD 6.2-PRERELEASE #1: Fri Oct 27 01:16:38 CEST 2006
    root at timur.home.bat.ru:/usr/src/sys/i386/compile/COMMON



>Description:


This patch brings back support for plugins in cacti. This time it takes patch from the original site. I don't see nice way to make it a separate port due the way how cacti is modified in it. The only alternative could be separate cacti+pligins port, but that's for the maintainer to decide to.

There is (slight) reformating of the port also, partilly for aesthetic reasons, partialy to make portlint happier.

Due to the way, how EXTRA_PATCHES handled(it shares same set of options with package patches) a modification into the source paths in files/patch-* was introduced. Hopefully it's not a problem.

There are few other small changes to make installation into different CACTIDIR work properly - I really think that www/cacti is prefferable for consistancy reasons.


>How-To-Repeat:





>Fix:


--- cacti.diff begins here ---
diff -ruN cacti/Makefile cacti.new/Makefile
--- cacti/Makefile	Sun Feb 25 17:50:19 2007
+++ cacti.new/Makefile	Wed Mar 21 19:12:27 2007
@@ -5,67 +5,87 @@
 # $FreeBSD: ports/net/cacti/Makefile,v 1.33 2007/02/25 16:50:19 sem Exp $
 #
 
-PORTNAME=	cacti
-PORTVERSION=	0.8.6j${PATCHLEVEL}
-PORTREVISION=	1
-CATEGORIES=	net www
-MASTER_SITES=	http://www.cacti.net/downloads/
-DISTNAME=	${PORTNAME}-${SITEDISTVERSION}
-
-MAINTAINER=	sem at FreeBSD.org
-COMMENT=	Web-driven graphing interface for RRDTool
+PORTNAME=		cacti
+PORTVERSION=		0.8.6j${PATCHLEVEL}
+PORTREVISION=		1
+CATEGORIES=		net www
+MASTER_SITES=		http://www.cacti.net/downloads/
+DISTFILES=		${PORTNAME}-${SITEDISTVERSION}.tar.gz
 
 # Vendor's patches
-PATCH_SITES=	http://www.cacti.net/downloads/patches/${SITEDISTVERSION}/
-PATCHFILES=	ping_php_version4_snmpgetnext.patch \
-		tree_console_missing_hosts.patch \
-		thumbnail_graphs_not_working.patch
-PATCHLEVEL=	.3
-SITEDISTVERSION=	${PORTVERSION:S/${PATCHLEVEL}$//}
-
-PATCH_DIST_STRIP=-p1
+PATCH_SITES=		http://www.cacti.net/downloads/patches/${SITEDISTVERSION}/
+PATCHFILES=		ping_php_version4_snmpgetnext.patch \
+			tree_console_missing_hosts.patch \
+			thumbnail_graphs_not_working.patch
+PATCH_DIST_STRIP=	-p1
+
+MAINTAINER=		sem at FreeBSD.org
+COMMENT=		Web-driven graphing interface for RRDTool
+
+RUN_DEPENDS=		rrdtool:${PORTSDIR}/net/rrdtool
+
+PATCH_STRIP=		-p1
+PATCHLEVEL=		.3
+USE_MYSQL=		yes
+USE_PHP=		mysql pcre session snmp xml
+WANT_PHP_WEB=		yes
+NO_BUILD=		yes
+PKGMESSAGE=		${WRKDIR}/pkg-message
+PKGINSTALL=		${WRKDIR}/pkg-install
+SUB_FILES=		pkg-message pkg-install
+
+CACTIDIR?=		share/cacti
+CACTIUSER?=		cacti
+CACTIGROUP?=		${CACTIUSER}
+WRKSRC=			${WRKDIR}/${PORTNAME}-${SITEDISTVERSION}
 
-RUN_DEPENDS=	rrdtool:${PORTSDIR}/net/rrdtool
-
-USE_MYSQL=	yes
-USE_PHP=	mysql pcre session snmp xml
-WANT_PHP_WEB=	yes
-NO_BUILD=	yes
-PKGMESSAGE=	${WRKDIR}/pkg-message
-PKGINSTALL=	${WRKDIR}/pkg-install
-SUB_FILES=	pkg-message pkg-install
-
-CACTIDIR?=	share/cacti
-CACTIUSER?=	cacti
-CACTIGROUP?=	${CACTIUSER}
-PLIST_SUB+=	CACTIDIR=${CACTIDIR}
-SUB_LIST+=	CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \
-		CACTIGROUP=${CACTIGROUP}
+OPTIONS=		PLUGIN_ARCH "With plugin architecture" On
 
 .include <bsd.port.pre.mk>
 
+SITEDISTVERSION=	${PORTVERSION:S/${PATCHLEVEL}$//}
+# Extra patches
+.if !defined(WITHOUT_PLUGIN_ARCH)
+MASTER_SITES+=		http://cactiusers.org/downloads/:plugin
+DISTFILES+=		cacti-plugin-arch.tar.gz:plugin
+EXTRA_PATCHES+=		${WRKDIR}/${PORTNAME}-plugin-${SITEDISTVERSION}.diff
+PLIST_SUB+=		PLUGIN=""
+.else
+PLIST_SUB+=		PLUGIN="@comment "
+.endif
+
+PLIST_SUB+=		CACTIDIR=${CACTIDIR}
+SUB_LIST+=		CACTIDIR=${CACTIDIR} \
+			CACTIUSER=${CACTIUSER} \
+			CACTIGROUP=${CACTIGROUP}
+
+.if !defined(WITHOUT_PLUGIN_ARCH)
+post-extract:
+			@${CP} ${WRKDIR}/cacti-plugin-arch/${PORTNAME}-plugin-${SITEDISTVERSION}.diff ${WRKDIR}
+.endif
+
 post-patch:
-	@${FIND} ${WRKSRC} -name \*.orig -delete; \
-	${MV} ${WRKSRC}/include/db-settings.php ${WRKSRC}/include/db-settings.php.orig
-	${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.orig
+			@${FIND} ${WRKSRC} -name \*.orig -delete; \
+			${MV} ${WRKSRC}/include/db-settings.php ${WRKSRC}/include/db-settings.php.orig
+			${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.orig
 
 pre-install:
-	@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL; \
+			@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
 
 do-install:
-	@${MKDIR} ${PREFIX}/${CACTIDIR}; \
-	${CP} -R ${WRKSRC}/* ${PREFIX}/${CACTIDIR}/; \
-	if [ ! -f ${PREFIX}/${CACTIDIR}/include/db-settings.php ]; then \
-		${CP} ${PREFIX}/${CACTIDIR}/include/db-settings.php.orig \
-			${PREFIX}/${CACTIDIR}/include/db-settings.php; \
-	fi
-	@if [ ! -f ${PREFIX}/${CACTIDIR}/include/config.php ]; then \
-		${CP} ${PREFIX}/${CACTIDIR}/include/config.php.orig \
-			${PREFIX}/${CACTIDIR}/include/config.php; \
-	fi
+			@${MKDIR} ${PREFIX}/${CACTIDIR}; \
+			${CP} -R ${WRKSRC}/* ${PREFIX}/${CACTIDIR}/; \
+		    	if [ ! -f ${PREFIX}/${CACTIDIR}/include/db-settings.php ]; then \
+			    ${CP} ${PREFIX}/${CACTIDIR}/include/db-settings.php.orig \
+				${PREFIX}/${CACTIDIR}/include/db-settings.php; \
+			fi
+			@if [ ! -f ${PREFIX}/${CACTIDIR}/include/config.php ]; then \
+			    ${CP} ${PREFIX}/${CACTIDIR}/include/config.php.orig \
+			    	${PREFIX}/${CACTIDIR}/include/config.php; \
+			fi
 
 post-install:
-	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-	@${CAT} ${PKGMESSAGE}
+		    	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+		    	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>
diff -ruN cacti/distinfo cacti.new/distinfo
--- cacti/distinfo	Mon Feb 26 03:11:42 2007
+++ cacti.new/distinfo	Wed Mar 21 16:21:24 2007
@@ -1,6 +1,9 @@
 MD5 (cacti-0.8.6j.tar.gz) = 29436be46b289d13dfce48e7618129e2
 SHA256 (cacti-0.8.6j.tar.gz) = 0ddf8a740a5725de67eeea71c38433447ff75388e6e399ce92ccadc36d25bd46
 SIZE (cacti-0.8.6j.tar.gz) = 1126337
+MD5 (cacti-plugin-arch.tar.gz) = baaf01f3a863148d6a76510ffc53986d
+SHA256 (cacti-plugin-arch.tar.gz) = 9d9600912f5bb347cd82a51f966438469676e01748b4b598fd193a1599feed4c
+SIZE (cacti-plugin-arch.tar.gz) = 263447
 MD5 (ping_php_version4_snmpgetnext.patch) = bedf583646e59dd628d4aced7e83fdf3
 SHA256 (ping_php_version4_snmpgetnext.patch) = 1e19110c696eb56c6de68247c926c5ec7a2e7554df222f39a663556241644170
 SIZE (ping_php_version4_snmpgetnext.patch) = 1262
diff -ruN cacti/files/patch-include-config.php cacti.new/files/patch-include-config.php
--- cacti/files/patch-include-config.php	Thu Jan  5 23:10:06 2006
+++ cacti.new/files/patch-include-config.php	Tue Mar 20 19:54:30 2007
@@ -1,5 +1,5 @@
---- include/config.php.orig	Fri Jan  6 00:27:51 2006
-+++ include/config.php	Fri Jan  6 00:28:39 2006
+--- cacti-0.8.6j/include/config.php.orig	Fri Jan  6 00:27:51 2006
++++ cacti-0.8.6j/include/config.php	Fri Jan  6 00:28:39 2006
 @@ -24,7 +24,11 @@
   +-------------------------------------------------------------------------+
  */
diff -ruN cacti/files/patch-include-db-settings.php cacti.new/files/patch-include-db-settings.php
--- cacti/files/patch-include-db-settings.php	Thu Jan  5 23:10:06 2006
+++ cacti.new/files/patch-include-db-settings.php	Tue Mar 20 19:54:36 2007
@@ -1,5 +1,5 @@
 --- /dev/null	Tue Jun 21 16:31:36 2005
-+++ include/db-settings.php	Tue Jun 21 16:29:15 2005
++++ cacti-0.8.6j/include/db-settings.php	Tue Jun 21 16:29:15 2005
 @@ -0,0 +1,9 @@
 +<?php
 +/* make sure these values refect your actual database/host/user/password */
diff -ruN cacti/files/patch-scripts-diskfree.pl cacti.new/files/patch-scripts-diskfree.pl
--- cacti/files/patch-scripts-diskfree.pl	Sat Apr 15 20:41:33 2006
+++ cacti.new/files/patch-scripts-diskfree.pl	Tue Mar 20 19:54:44 2007
@@ -1,5 +1,5 @@
---- scripts/diskfree.pl.orig	Wed Jan  4 06:08:30 2006
-+++ scripts/diskfree.pl	Fri Jan  6 00:16:58 2006
+--- cacti-0.8.6j/scripts/diskfree.pl.orig	Wed Jan  4 06:08:30 2006
++++ cacti-0.8.6j/scripts/diskfree.pl	Fri Jan  6 00:16:58 2006
 @@ -1,5 +1,5 @@
  #!/usr/bin/perl
 -open(PROCESS,"df --block-size=1024 -P $ARGV[0] | grep -v Filesystem |");
diff -ruN cacti/files/patch-scripts-ping.pl cacti.new/files/patch-scripts-ping.pl
--- cacti/files/patch-scripts-ping.pl	Sat Apr 15 20:41:33 2006
+++ cacti.new/files/patch-scripts-ping.pl	Tue Mar 20 19:54:52 2007
@@ -1,5 +1,5 @@
---- scripts/ping.pl.orig	Sat Apr 15 22:26:44 2006
-+++ scripts/ping.pl	Sat Apr 15 22:27:16 2006
+--- cacti-0.8.6j/scripts/ping.pl.orig	Sat Apr 15 22:26:44 2006
++++ cacti-0.8.6j/scripts/ping.pl	Sat Apr 15 22:27:16 2006
 @@ -1,6 +1,6 @@
  #!/usr/bin/perl 
  
diff -ruN cacti/files/pkg-install.in cacti.new/files/pkg-install.in
--- cacti/files/pkg-install.in	Fri Nov  4 08:13:36 2005
+++ cacti.new/files/pkg-install.in	Wed Mar 21 18:56:00 2007
@@ -3,10 +3,10 @@
 PW=/usr/sbin/pw
 UID=107
 GID=${UID}
-CACTIUSER=%%CACTIUSER%%
-CACTIGROUP=%%CACTIGROUP%%
-CACTIDIR=%%CACTIDIR%%
-PREFIX=%%PREFIX%%
+CACTIUSER="%%CACTIUSER%%"
+CACTIGROUP="%%CACTIGROUP%%"
+CACTIDIR="%%CACTIDIR%%"
+PREFIX="%%PREFIX%%"
 
 case $2 in
 
@@ -39,9 +39,10 @@
 
 POST-INSTALL)
 
-	chown ${CACTIUSER}:${CACTIGROUP} ${PREFIX}/${CACTIDIR}/rra/
-	chown -R ${CACTIUSER}:${CACTIGROUP} ${PREFIX}/${CACTIDIR}/log/
-	chmod -R a+r ${PREFIX}/${CACTIDIR}/scripts/
+	chown ${CACTIUSER}:${CACTIGROUP} "${PREFIX}/${CACTIDIR}/rra/"
+	[ -d "${PREFIX}/${CACTIDIR}/log/" ] || mkdir -p "${PREFIX}/${CACTIDIR}/log/"
+	chown -R ${CACTIUSER}:${CACTIGROUP} "${PREFIX}/${CACTIDIR}/log/"
+	chmod -R a+r "${PREFIX}/${CACTIDIR}/scripts/"
 	;;
 *)
 	exit 1
diff -ruN cacti/pkg-plist cacti.new/pkg-plist
--- cacti/pkg-plist	Fri Nov  3 14:33:42 2006
+++ cacti.new/pkg-plist	Wed Mar 21 16:48:03 2007
@@ -144,6 +144,8 @@
 @unexec cmp -s %D/%%CACTIDIR%%/include/db-settings.php.orig %D/%%CACTIDIR%%/include/db-settings.php && rm -f %D/%%CACTIDIR%%/include/db-settings.php || true
 %%CACTIDIR%%/include/db-settings.php.orig
 @exec [ -f %D/%%CACTIDIR%%/include/db-settings.php ] || cp %D/%%CACTIDIR%%/include/db-settings.php.orig %D/%%CACTIDIR%%/include/db-settings.php
+%%PLUGIN%%%%CACTIDIR%%/include/plugins.php
+%%PLUGIN%%%%CACTIDIR%%/plugins/index.php
 %%CACTIDIR%%/include/html/inc_data_source_filter_table.php
 %%CACTIDIR%%/include/html/inc_data_template_filter_table.php
 %%CACTIDIR%%/include/html/inc_device_filter_table.php
@@ -418,6 +420,7 @@
 @dirrm %%CACTIDIR%%/include/jscalendar
 @dirrm %%CACTIDIR%%/include/html
 @dirrmtry %%CACTIDIR%%/include
+%%PLUGIN%%@dirrmtry %%CACTIDIR%%/plugins
 @dirrm %%CACTIDIR%%/images
 @dirrm %%CACTIDIR%%/docs/text
 @dirrm %%CACTIDIR%%/docs/pdf
--- cacti.diff ends here ---



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



More information about the freebsd-ports-bugs mailing list