summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2005-04-21 07:02:05 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2005-04-21 07:02:05 +0000
commitbadc83477806938f63e5ca4148aa28390be55edf (patch)
tree5939b81c00b79b52f11286229f9b036793b20e79 /net
parentYet another SpamBouncer 2.0 Beta RC7 release. (diff)
- Fix removing logic for user config [1]
- Remove useless empty dirs - Fix package - Makefile refactoring - Utilize SUB_FILES magic - Update pkg-message Reported by: kris (via pointyhat) [1]
Notes
Notes: svn path=/head/; revision=133816
Diffstat (limited to 'net')
-rw-r--r--net/cacti/Makefile28
-rw-r--r--net/cacti/files/pkg-install.in (renamed from net/cacti/pkg-install)4
-rw-r--r--net/cacti/files/pkg-message.in (renamed from net/cacti/pkg-message)7
-rw-r--r--net/cacti/pkg-plist4
4 files changed, 21 insertions, 22 deletions
diff --git a/net/cacti/Makefile b/net/cacti/Makefile
index e8247a057587..e703f216f50f 100644
--- a/net/cacti/Makefile
+++ b/net/cacti/Makefile
@@ -7,7 +7,7 @@
PORTNAME= cacti
PORTVERSION= 0.8.6c
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net www
MASTER_SITES= http://www.cacti.net/downloads/
@@ -35,32 +35,27 @@ USE_PHP= mysql pcre session 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}
-
-post-extract:
- @${RM} -rf ${WRKSRC}/cactid/.deps
+SUB_LIST+= CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \
+ CACTIGROUP=${CACTIGROUP}
post-patch:
- @${CAT} pkg-message | ${SED} -e 's|%%PREFIX%%|${PREFIX}| ; \
- s|%%LOCALBASE%%|${LOCALBASE}| ; \
- s|%%CACTIDIR%%|${CACTIDIR}| ; \
- s|%%CACTIUSER%%|${CACTIUSER}|' > ${PKGMESSAGE}
+ @${FIND} ${WRKSRC} -name \*.orig -delete; \
+ ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.orig; \
+ ${RM} -d ${WRKSRC}/include/lang/en ${WRKSRC}/include/lang
-# Create cacti user/group and clean *.orig files
pre-install:
- @PREFIX=${PREFIX} CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \
- CACTIGROUP=${CACTIGROUP} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL; \
- cd ${WRKSRC}; \
- ${FIND} . -name \*.orig -delete
+ @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL; \
do-install:
@${MKDIR} ${PREFIX}/${CACTIDIR}; \
- ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.orig; \
- ${CP} -R ${WRKSRC}/* ${PREFIX}/${CACTIDIR}/
+ ${CP} -R ${WRKSRC}/* ${PREFIX}/${CACTIDIR}/; \
if [ ! -f ${PREFIX}/${CACTIDIR}/include/config.php ]; then \
${CP} ${PREFIX}/${CACTIDIR}/include/config.php.orig \
${PREFIX}/${CACTIDIR}/include/config.php; \
@@ -68,8 +63,7 @@ do-install:
# Fix permissions
post-install:
- @PREFIX=${PREFIX} CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \
- CACTIGROUP=${CACTIGROUP} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+ @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/net/cacti/pkg-install b/net/cacti/files/pkg-install.in
index 86d8f0d137ed..da76801ae6b9 100644
--- a/net/cacti/pkg-install
+++ b/net/cacti/files/pkg-install.in
@@ -3,6 +3,10 @@
PW=/usr/sbin/pw
UID=107
GID=${UID}
+CACTIUSER=%%CACTIUSER%%
+CACTIGROUP=%%CACTIGROUP%%
+CACTIDIR=%%CACTIDIR%%
+PREFIX=%%PREFIX%%
case $2 in
diff --git a/net/cacti/pkg-message b/net/cacti/files/pkg-message.in
index 9b37b13e9b41..f2df9ffd151e 100644
--- a/net/cacti/pkg-message
+++ b/net/cacti/files/pkg-message.in
@@ -5,14 +5,17 @@ to make it work correctly.
1: Create the MySQL database
# mysqladmin --user=root create cacti
2: Create a mysql user/password for cacti
+(change user and/or password if requered)
# echo "GRANT ALL ON cacti.* TO cactiuser at localhost IDENTIFIED BY 'cactiuser'; FLUSH PRIVILEGES;" | mysql &&
3: Import the default cacti database
# mysql cacti < %%PREFIX%%/%%CACTIDIR%%/cacti.sql
-4: Edit your config.php
+4: Edit include/config.php
Specify the MySQL user, password and database for your cacti configuration.
5: Add a line to your /etc/crontab file similar to:
*/5 * * * * %%CACTIUSER%% %%LOCALBASE%%/bin/php %%PREFIX%%/%%CACTIDIR%%/poller.php > /dev/null 2>&1
-6: Point your web browser to the cacti dir and login with admin/admin
+6: Add alias in apache config for the cacti dir
+Alias /cacti "%%PREFIX%%/%%CACTIDIR%%/"
+7: Open cacti login page in your web browser and login with admin/admin
Have fun!
==================================================================
diff --git a/net/cacti/pkg-plist b/net/cacti/pkg-plist
index 6f01b6feb0a8..530ea61c03fc 100644
--- a/net/cacti/pkg-plist
+++ b/net/cacti/pkg-plist
@@ -126,9 +126,9 @@
%%CACTIDIR%%/images/transparent_line.gif
%%CACTIDIR%%/include/auth.php
%%CACTIDIR%%/include/bottom_footer.php
+@unexec cmp -s %D/%%CACTIDIR%%/include/config.php.orig %D/%%CACTIDIR%%/include/config.php && rm -f %D/%%CACTIDIR%%/include/config.php
%%CACTIDIR%%/include/config.php.orig
@exec [ -f %D/%%CACTIDIR%%/include/config.php ] || cp %D/%%CACTIDIR%%/include/config.php.orig %D/%%CACTIDIR%%/include/config.php
-@unexec if cmp -s %D/%%CACTIDIR%%/include/config.php.orig %D/%%CACTIDIR%%/include/config.php; then rm -f %D/%%CACTIDIR%%/include/config.php; fi
%%CACTIDIR%%/include/config_arrays.php
%%CACTIDIR%%/include/config_constants.php
%%CACTIDIR%%/include/config_form.php
@@ -379,8 +379,6 @@
@dirrm %%CACTIDIR%%/lib
@dirrm %%CACTIDIR%%/install
@dirrm %%CACTIDIR%%/include/treeview
-@dirrm %%CACTIDIR%%/include/lang/en
-@dirrm %%CACTIDIR%%/include/lang
@dirrm %%CACTIDIR%%/include/jscalendar/lang
@dirrm %%CACTIDIR%%/include/jscalendar
@dirrm %%CACTIDIR%%/include/html