aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2005-06-21 13:26:54 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2005-06-21 13:26:54 +0000
commit8e7fa9577c04481762aca502418c8a1ccb9dba72 (patch)
tree5a82a600d02801951c032462b505da365f33212c /net-mgmt
parent0e8964abd39e7edf6a6fb165e0832c5599bbed4a (diff)
downloadports-8e7fa9577c04481762aca502418c8a1ccb9dba72.tar.gz
ports-8e7fa9577c04481762aca502418c8a1ccb9dba72.zip
- 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>
Notes
Notes: svn path=/head/; revision=137812
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/cacti/Makefile11
-rw-r--r--net-mgmt/cacti/files/patch-include-config.php26
-rw-r--r--net-mgmt/cacti/files/patch-include-db-settings.php11
-rw-r--r--net-mgmt/cacti/files/pkg-message.in16
-rw-r--r--net-mgmt/cacti/pkg-plist7
5 files changed, 55 insertions, 16 deletions
diff --git a/net-mgmt/cacti/Makefile b/net-mgmt/cacti/Makefile
index d8d1d2f06dc9..bc85fdc545bc 100644
--- a/net-mgmt/cacti/Makefile
+++ b/net-mgmt/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-mgmt/cacti/files/patch-include-config.php b/net-mgmt/cacti/files/patch-include-config.php
new file mode 100644
index 000000000000..d79c0d4e20c8
--- /dev/null
+++ b/net-mgmt/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-mgmt/cacti/files/patch-include-db-settings.php b/net-mgmt/cacti/files/patch-include-db-settings.php
new file mode 100644
index 000000000000..f2fd9fc01d42
--- /dev/null
+++ b/net-mgmt/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-mgmt/cacti/files/pkg-message.in b/net-mgmt/cacti/files/pkg-message.in
index f2df9ffd151e..419234575460 100644
--- a/net-mgmt/cacti/files/pkg-message.in
+++ b/net-mgmt/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-mgmt/cacti/pkg-plist b/net-mgmt/cacti/pkg-plist
index ee01bfcecbad..ee88c5da4def 100644
--- a/net-mgmt/cacti/pkg-plist
+++ b/net-mgmt/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