diff options
author | sem <sem@FreeBSD.org> | 2005-06-21 13:26:54 +0000 |
---|---|---|
committer | sem <sem@FreeBSD.org> | 2005-06-21 13:26:54 +0000 |
commit | 0c53cf5064beb2f4885b7085e261c5f91e3b12d3 (patch) | |
tree | c9871afbcdc9e962ac18694b0a2e34027e977c2e /net | |
parent | 2905af34fbbe4d79dadd0a370a66543480869957 (diff) | |
download | FreeBSD-ports-0c53cf5064beb2f4885b7085e261c5f91e3b12d3.zip FreeBSD-ports-0c53cf5064beb2f4885b7085e261c5f91e3b12d3.tar.gz |
- Saving config.php was a bad idea. cacti's developers make cahnges in it.
I've moved DB settings from config.php to db-settings.php and save it
instead.
Read UPDATING.
Reported by: Zoltan Frombach <tssajo@hotmail.com>,
Andrej Zverev <az@inec.ru>
Diffstat (limited to 'net')
-rw-r--r-- | net/cacti/Makefile | 11 | ||||
-rw-r--r-- | net/cacti/files/patch-include-config.php | 26 | ||||
-rw-r--r-- | net/cacti/files/patch-include-db-settings.php | 11 | ||||
-rw-r--r-- | net/cacti/files/pkg-message.in | 16 | ||||
-rw-r--r-- | net/cacti/pkg-plist | 7 |
5 files changed, 55 insertions, 16 deletions
diff --git a/net/cacti/Makefile b/net/cacti/Makefile index d8d1d2f..bc85fdc 100644 --- a/net/cacti/Makefile +++ b/net/cacti/Makefile @@ -7,6 +7,7 @@ PORTNAME= cacti PORTVERSION= 0.8.6e +PORTREVISION= 1 CATEGORIES= net www MASTER_SITES= http://www.cacti.net/downloads/ @@ -39,7 +40,7 @@ SUB_LIST+= CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \ post-patch: @${FIND} ${WRKSRC} -name \*.orig -delete; \ - ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.orig + ${MV} ${WRKSRC}/include/db-settings.php ${WRKSRC}/include/db-settings.php.orig pre-install: @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL; \ @@ -47,10 +48,10 @@ pre-install: do-install: @${MKDIR} ${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; \ - fi; \ + if [ ! -f ${PREFIX}/${CACTIDIR}/include/db-settings.php ]; then \ + ${CP} ${PREFIX}/${CACTIDIR}/include/db-settings.php.orig \ + ${PREFIX}/${CACTIDIR}/include/db-settings.php; \ + fi # Fix permissions post-install: diff --git a/net/cacti/files/patch-include-config.php b/net/cacti/files/patch-include-config.php new file mode 100644 index 0000000..d79c0d4 --- /dev/null +++ b/net/cacti/files/patch-include-config.php @@ -0,0 +1,26 @@ +--- include/config.php.orig Tue Jun 21 04:46:46 2005 ++++ include/config.php Tue Jun 21 16:27:29 2005 +@@ -24,13 +24,6 @@ + +-------------------------------------------------------------------------+ + */ + +-/* make sure these values refect your actual database/host/user/password */ +-$database_type = "mysql"; +-$database_default = "cacti"; +-$database_hostname = "localhost"; +-$database_username = "cactiuser"; +-$database_password = "cactiuser"; +- + /* ----- you probably do not need to change anything below this line ----- */ + $config = array(); + +@@ -44,6 +37,9 @@ + $config["base_path"] = ereg_replace("(.*)[\/\\]include", "\\1", dirname(__FILE__)); + $config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__)); + $config["include_path"] = dirname(__FILE__); ++ ++/* load user defined DB settings */ ++include($config["include_path"] . "/db-settings.php"); + + /* colors */ + $colors["dark_outline"] = "454E53"; diff --git a/net/cacti/files/patch-include-db-settings.php b/net/cacti/files/patch-include-db-settings.php new file mode 100644 index 0000000..f2fd9fc --- /dev/null +++ b/net/cacti/files/patch-include-db-settings.php @@ -0,0 +1,11 @@ +--- include/db-settings.php.orig Tue Jun 21 16:31:36 2005 ++++ include/db-settings.php Tue Jun 21 16:29:15 2005 +@@ -0,0 +1,8 @@ ++<?php ++/* make sure these values refect your actual database/host/user/password */ ++$database_type = "mysql"; ++$database_default = "cacti"; ++$database_hostname = "localhost"; ++$database_username = "cactiuser"; ++$database_password = "cactiuser"; ++?> diff --git a/net/cacti/files/pkg-message.in b/net/cacti/files/pkg-message.in index f2df9ff..4192345 100644 --- a/net/cacti/files/pkg-message.in +++ b/net/cacti/files/pkg-message.in @@ -1,19 +1,19 @@ ================================================================== -Cacti is now installed. You may have to follow this steps -to make it work correctly. +Cacti is now installed. If you intall it for the first time, +you may have to follow this steps to make it work correctly. -1: Create the MySQL database +1: Create the MySQL database: # mysqladmin --user=root create cacti -2: Create a mysql user/password for 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 +# 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 include/config.php +4: Edit %%CACTIDIR%%/include/db-settings.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: Add alias in apache config for the cacti dir +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 diff --git a/net/cacti/pkg-plist b/net/cacti/pkg-plist index ee01bfc..ee88c5da 100644 --- a/net/cacti/pkg-plist +++ b/net/cacti/pkg-plist @@ -126,13 +126,14 @@ %%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 +%%CACTIDIR%%/include/config.php %%CACTIDIR%%/include/config_arrays.php %%CACTIDIR%%/include/config_constants.php %%CACTIDIR%%/include/config_form.php %%CACTIDIR%%/include/config_settings.php +@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 %%CACTIDIR%%/include/html/inc_data_source_filter_table.php %%CACTIDIR%%/include/html/inc_device_filter_table.php %%CACTIDIR%%/include/html/inc_graph_filter_table.php |