[RackTables/f15/master] Update to 0.19.4

Colin Coe coec at fedoraproject.org
Sun May 8 13:00:03 UTC 2011


commit 40de0edf4522f66933384325439caf38ae48415c
Author: Colin Coe <colin.coe at gmail.com>
Date:   Sun May 8 20:59:47 2011 +0800

    Update to 0.19.4

 .gitignore                           |    1 +
 README.Fedora                        |   62 ++++++++++++++++++++++++++++++++++
 RackTables-0.19.4-Fedora-paths.patch |   26 ++++++++++++++
 RackTables.conf                      |    1 -
 RackTables.spec                      |   50 ++++++++++++---------------
 sources                              |    2 +-
 6 files changed, 113 insertions(+), 29 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index dba609d..e21981f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 RackTables-0.18.3.tar.gz
 /RackTables-0.18.4.tar.gz
+/RackTables-0.19.4.tar.gz
diff --git a/README.Fedora b/README.Fedora
new file mode 100644
index 0000000..9f8fac3
--- /dev/null
+++ b/README.Fedora
@@ -0,0 +1,62 @@
+RUNNING RACKTABLES ON A FEDORA SYSTEM
+=====================================
+
+Most files in Fedora package of RackTables application reside in the
+/usr/share/RackTables directory regardless of package version. It is
+assumed, that this directory is never directly used in httpd's "document
+root" setting. Instead a symlink or a PHP "require" construct should be
+used for the index.php (and ONLY index.php) file based on some other
+directory, which is actually used as wwwroot. This greatly improves
+security and allows for the two use cases described below.
+
+1. Single RackTables instance per server. By default the application
+expects its configuration files (mandatory secret.php and optional
+local.php) in /etc/RackTables directory, which is a part of the RPM. In
+a fresh installation both files are missing, no MySQL database is setup
+and there is no symlink.
+
+Setting up the symlink is simple: one needs to decide on the URL of the
+RackTables system and map it to filesystem path. For example, the commands
+below are likely to enable access through "http://localhost/racktables/":
+
+# mkdir /var/www/html/racktables
+# ln -s /usr/share/RackTables/wwwroot/index.php /var/www/html/racktables
+
+After that opening the URL in a browser will bring up RackTables installer,
+which will fill in /etc/RackTables/secret.php file and the contents of the
+MySQL database. After that the setup is complete.
+
+
+2. Multiple RackTables instances per server. The application is designed
+to be able to serve many independent MySQL databases with the same
+codebase, but different configuration files. This requires a separate
+config directory per each instance. Each of the directories will feature
+an own secret.php file configured for its own MySQL database.
+
+For example, 3 virtual hosts should provide an independent RackTables
+application each. It is assumed, that httpd is already configured for the
+virtual hosts using respective directories:
+
+/var/www/vhosts/racktables.example1.com
+/var/www/vhosts/racktables.example2.com
+/var/www/vhosts/racktables.example3.com
+
+The configuration directories could be:
+
+# mkdir /etc/RackTables/example[123]
+
+The "wwwroot" directories will require a short PHP wrapper file each. The
+wrappers will differ only in the value of $racktables_confdir setting:
+
+# cat > /var/www/vhosts/racktables.example1.com/index.php <<<EOF
+<?php
+
+$racktables_confdir = '/etc/RackTables/example1';
+require '/usr/share/RackTables/wwwroot/index.php';
+
+?>
+EOF
+
+Once the wrapper files are installed, setup of each instance must be
+completed independently through the HTTP installer. Once this is done,
+every instance can be independently maintained, backed up and even deleted.
diff --git a/RackTables-0.19.4-Fedora-paths.patch b/RackTables-0.19.4-Fedora-paths.patch
new file mode 100644
index 0000000..b75325e
--- /dev/null
+++ b/RackTables-0.19.4-Fedora-paths.patch
@@ -0,0 +1,26 @@
+diff -Nur RackTables-0.19.4.orig/scripts/syncdomain.php RackTables-0.19.4/scripts/syncdomain.php
+--- RackTables-0.19.4.orig/scripts/syncdomain.php	2011-04-09 18:53:54.000000000 +0400
++++ RackTables-0.19.4/scripts/syncdomain.php	2011-04-09 18:59:36.252324439 +0400
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/php
++#!/usr/bin/php
+ <?php
+ 
+ $script_mode = TRUE;
+diff -Nur RackTables-0.19.4.orig/wwwroot/inc/pre-init.php RackTables-0.19.4/wwwroot/inc/pre-init.php
+--- RackTables-0.19.4.orig/wwwroot/inc/pre-init.php	2011-04-09 18:53:56.000000000 +0400
++++ RackTables-0.19.4/wwwroot/inc/pre-init.php	2011-04-09 19:16:30.633626396 +0400
+@@ -19,11 +19,11 @@
+ # code, multiple instances" deploy, in which case the paths could be changed
+ # in the custom entry point wrapper (like own index.php)
+ if (! isset ($racktables_staticdir)) // the directory containing 'pix', 'js', 'css' dirs
+-	$racktables_staticdir = $racktables_rootdir;
++	$racktables_staticdir = '/usr/share/RackTables/static';
+ if (! isset ($racktables_gwdir)) // the directory containing 'deviceconfig', 'sendfile' dirs, etc
+ 	$racktables_gwdir = realpath ($racktables_rootdir . '/../gateways');
+ if (! isset ($racktables_confdir)) // the directory containing local.php and secret.php (default is wwwroot/inc)
+-	$racktables_confdir = dirname (__FILE__);
++	$racktables_confdir = '/etc/RackTables';
+ if (! isset ($path_to_secret_php))
+ 	$path_to_secret_php = $racktables_confdir . '/secret.php';
+ if (! isset ($path_to_local_php))
diff --git a/RackTables.spec b/RackTables.spec
index 3fde41d..4bffdbe 100644
--- a/RackTables.spec
+++ b/RackTables.spec
@@ -1,27 +1,29 @@
 Name:           RackTables
-Version:        0.18.4
+Version:        0.19.4
 Release:        2%{?dist}
-Summary:        A datacenter asset management system
+Summary:        A data-center asset management system
 
 Group:          Applications/Internet
 # Valid license according to http://fedoraproject.org/wiki/Licensing
-License:        GPLv2 and CC-BY-SA and MIT and BSD
+License:        GPLv2 and CC-BY-SA
 URL:            http://racktables.org/
-Source0:        http://downloads.sourceforge.net/racktables/%{name}-%{version}.tar.gz
-Source1:        RackTables.conf
+Source0:        http://sourceforge.net/projects/racktables/files/%{name}-%{version}.tar.gz
+Source1:        README.Fedora
 Source2:        quickinstall.sh
+Patch1:         %{name}-%{version}-Fedora-paths.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires:       httpd php php-mysql php-pdo php-gd php-snmp php-mbstring mysql-server php-ldap /bin/sh
+Requires:       httpd php php-mysql php-pdo php-gd php-snmp php-mbstring mysql-server /bin/sh
 BuildArch:      noarch
 
 %description
-A datacenter asset management system.
+A data-center asset management system.
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %prep
 %setup -q
+%patch -P 1 -p1
 
 %build
 # Nothing to build
@@ -29,45 +31,39 @@ rm -rf $RPM_BUILD_ROOT
 %install
 rm -rf $RPM_BUILD_ROOT
 # Remove zero-length files
-rm -f js/codepress/engines/older.js js/codepress/engines/khtml.js
+rm -f wwwroot/js/codepress/engines/older.js wwwroot/js/codepress/engines/khtml.js
 
-sed -i'' -e 's|^#!/usr/local/bin/php|#!/usr/bin/php|' syncdomain.php
-
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/contrib
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
 
-cp -a * $RPM_BUILD_ROOT%{_datadir}/%{name}
-
-install %{S:1} -p -m 0644 $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
-install %{S:2} -p -m 0755 $RPM_BUILD_ROOT%{_datadir}/%{name}/contrib/quickinstall.sh
-echo "// Empty on install" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/secret.php
+make DESTDIR=$RPM_BUILD_ROOT prefix=/usr staticdir=%{_datadir}/%{name}/static install
 
-cd $RPM_BUILD_ROOT%{_datadir}/%{name}/inc
-ln -s  ../../../..%{_sysconfdir}/%{name}/secret.php
-cd -
+install %{S:1} -p -m 0644 .
+install %{S:2} -p -m 0755 $RPM_BUILD_ROOT%{_datadir}/%{name}/scripts/quickinstall.sh
 
 %files
 %defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
-%config(noreplace) %attr(0664,apache,apache) %{_sysconfdir}/%{name}/secret.php
-%doc COPYING LICENSE ChangeLog README
+%doc COPYING LICENSE ChangeLog README README.Fedora
 %{_datadir}/%{name}/
 %dir %{_sysconfdir}/%{name}
 
 %changelog
-* Mon Feb 07 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.18.4-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+* Sun May 8 2011 Colin Coe <colin.coe at gmail.com> - 0.19.4-2
+- s/datacenter/data-center/g to silence rpmlint spelling check errors
+
+* Sat May 7 2011 <infrastation at yandex.ru> - 0.19.4-1
+- Rebase to v0.19.4
+- Deprecate /etc/httpd/conf.d/RackTables.conf
+- Include /usr/share/doc/RackTables-0.19.4/README.Fedora
+- Stop using makeinstall macro
 
 * Wed Aug 25 2010 <colin.coe at gmail.com> - 0.18.4-1
 - Make syncdomain use /usr/bin/php
-- Correct Source0
 - Rebase to v0.18.4
 
 * Mon Jul 5 2010 <colin.coe at gmail.com> - 0.18.3-1
 - Rebase to v0.18.3
 
-* Mon Apr 12 2010 <colin.coe at gmail.com> - 0.17.10-1
+* Mon Feb 22 2010 <colin.coe at gmail.com> - 0.17.10-1
 - Rebase to v0.17.10
 
 * Mon Feb 22 2010 <colin.coe at gmail.com> - 0.17.9-1
diff --git a/sources b/sources
index a63945c..3870037 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c0662b1d4497de43145615875d3ce54b  RackTables-0.18.4.tar.gz
+1811fa2d17ac394b8c0f00dd71c83d91  RackTables-0.19.4.tar.gz


More information about the scm-commits mailing list