diff --git a/.cvsignore b/.cvsignore index e69de29..73a7698 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +RackTables-0.17.4.tar.gz diff --git a/RackTables.conf b/RackTables.conf new file mode 100644 index 0000000..85d7cbd --- /dev/null +++ b/RackTables.conf @@ -0,0 +1 @@ +alias /racktables /usr/share/RackTables diff --git a/RackTables.spec b/RackTables.spec new file mode 100644 index 0000000..f811795 --- /dev/null +++ b/RackTables.spec @@ -0,0 +1,88 @@ +Name: RackTables +Version: 0.17.4 +Release: 7%{?dist} +Summary: A datacenter asset management system + +Group: Applications/Internet +# Valid license according to http://fedoraproject.org/wiki/Licensing +License: GPLv2 and CC-BY-SA +URL: http://racktables.org/ +Source0: http://racktables.org/files/%{name}-%{version}.tar.gz +Source1: RackTables.conf +Source2: quickinstall.sh +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 +BuildArch: noarch + +%description +A datacenter asset management system. + +%clean +rm -rf $RPM_BUILD_ROOT + +%prep +%setup -q + +%build +# Nothing to build + +%install +rm -rf $RPM_BUILD_ROOT +# Remove zero-length files +rm -f js/codepress/engines/older.js js/codepress/engines/khtml.js + +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 + +cd $RPM_BUILD_ROOT%{_datadir}/%{name}/inc +ln -s ../../../..%{_sysconfdir}/%{name}/secret.php +cd - + +%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 +%{_datadir}/%{name}/ +%dir %{_sysconfdir}/%{name} + +%changelog +* Sun Sep 13 2009 - 0.17.4-7 +- Simplify setup +- Step making docdir/name +- Simplify copy +- Make contrib/quickinstall.sh quit unless it's run by root + +* Fri Sep 11 2009 - 0.17.4-6 +- Own /etc/RackTables/ +- Fix duplicate files +- Set ownership/mode of /etc/RackTables/secret.php correctly +- Fix contrib/quickinstall.sh to write a valid /etc/RackTables/secret.php + +* Thu Sep 10 2009 - 0.17.4-5 +- Fix danling symlink + +* Thu Sep 10 2009 - 0.17.4-4 +- Removed redundant 'RackTables' from the summary and description +- Changed license as suggested +- Put secret.php into /etc/RackTables and created symlink back to {_datadir}/{name}/inc +- Removed 'mkdir -p $RPM_BUILD_ROOT{_docdir}' +- Stopped listing inc/secret.php twice + +* Mon Sep 7 2009 - 0.17.4-3 +- Add 'contrib/quickinstall.sh' to add people installing RackTables +- Add php-ldap as a dependency + +* Tue Sep 1 2009 - 0.17.4-2 +- Split out Apache config file +- Added mysql-server as a dependency + +* Mon Aug 17 2009 Colin Coe - 0.17.4-1 +- Initial packaging diff --git a/import.log b/import.log new file mode 100644 index 0000000..4511624 --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +RackTables-0_17_4-7_fc11:EL-5:RackTables-0.17.4-7.fc11.src.rpm:1253187169 diff --git a/quickinstall.sh b/quickinstall.sh new file mode 100644 index 0000000..728910d --- /dev/null +++ b/quickinstall.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# Author: colin.coe@gmail.com +# Date: Sep 7, 2009 +# Updated: Sep 10, 2009 +# Purpose: Simple quickstart script +# License: Create Commons Attribution-Share Alike 3.0 Unported + +if [ `id -u` -ne 0 ]; then + echo This script must be run as root, exiting... + exit 1 +fi + +service mysqld status > /dev/null 2>&1 +if [ $? -ne 0 ]; then + /sbin/service mysqld start + /sbin/chkconfig mysqld on +fi + +service httpd status > /dev/null 2>&1 +if [ $? -ne 0 ]; then + /sbin/service httpd start + /sbin/chkconfig httpd on +else + /sbin/service httpd reload +fi + +RT_DB_USER=rackuser +RT_DB_PASS=rackpw + +echo +echo "The default DB username for RackTables is '${RT_DB_USER}'" +echo "If you want to change the username, enter a new username or just press enter" +read USER +echo "The default DB password for RackTables is '${RT_DB_PASS}'" +echo "If you want to change the username, enter a new username or just press enter" +read PASS + +[ -n "${USER}" ] && RT_DB_USER="${USER}" +[ -n "${PASS}" ] && RT_DB_PASS="${PASS}" + +sed -e "s/'username'/'${RT_DB_USER}'/" -e "s/'password'/'${RT_DB_PASS}'/" /usr/share/RackTables/inc/secret-sample.php > /usr/share/RackTables/inc/secret.php + +echo -e "You need the MySQL root password to continue. If you don't know it, ^C here and\ncome back when you have the password." +echo +echo Enter MySQL root password +mysql -uroot -p -e " +create database racktables; +grant all on racktables.* to root; +grant all on racktables.* to root@localhost; +grant all on racktables.* to ${RT_DB_USER}; +grant all on racktables.* to ${RT_DB_USER}@localhost; +set password for ${RT_DB_USER}@localhost=password('${RT_DB_PASS}'); +exit" +echo +echo +echo You should be able to browse to http://`hostname`/racktables/install.php +echo to complete the installation. + +exit 0 diff --git a/sources b/sources index e69de29..037bd49 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +c15155c67749b15f1690131c35266ca7 RackTables-0.17.4.tar.gz