This is an old revision of the document!
Packaging the Sahana RPM
Automated Method
This works on Debian:
cvs -z3 -d:pserver:anonymous@sahana.cvs.sourceforge.net:/cvsroot/sahana co -P sahana-ext sahana-ext/release/redhat/redhat.sh
Manual Method
1. Create the following folder structure.
/tmp | +-- /sahana-rpm | | | +-- /usr | | | | | +-- /share | | | +-- /var | | | +-- /www | | | +-- /html | +-- sahana.spec
2. Open the sahana.spec file with your favourite text editor and enter the following
%define name sahana %define version 0.6.2.2 %define release RC2 Summary: Sahana is a Free & Open Source Disaster Management system. Name: %{name} Version: %{version} Release: %{release} Vendor: Lanka Software Foundation URL: http://www.opensource.lk License: LGPL Group: Software/Disaster Management Prefix: %{_prefix} BuildRoot: /tmp/sahana-rpm requires: httpd >= 2.0, mysql-server >= 5.0, mysql >= 5.0, php-mysql >= 5.0, php >= 5.0, php-gd >= 5.0, php5-common >= 5.0 %description Sahana is a Free & Open Source software for management of disasters. %prep %build %install %files /usr/share/sahana /var/www/html/sahana %clean %post if [ -x /usr/bin/firefox ]; then echo "Opening firefox...." url="http://localhost/sahana" firefox -remote openurl\($url,new-tab\) || firefox $url & 2>&1 1>/dev/null fi
3. Execute the following commands
cd /tmp/sahana-rpm mkdir BUILD RPMS SRPMS SOURCES SPECS
4. Download the sahana source tar ball and extract it to /tmp/sahana-rpm/usr/share/sahana \ The folder /tmp/sahana-rpm/usr/share/sahana should contain all the sahana folders. eg: 3rd, lib, conf, www, mod, etc….
5. Execute the following command
cd /tmp/sahana-rpm/usr/share/sahana/ chmod a+w conf www/tmp cd /tmp/sahana-rpm/var/www/html ln -s ../../../usr/share/sahana/www sahana
6. Create a file named '.rpmmacros' in your home directory with the following contents.
%packager Your name <Your email address> %vendor Sahana %_topdir /tmp/sahana-rpm
7. Execute the following command to create the rpm.
cd /tmp rpmbuild -bb sahana.spec
8. The rpm file will be created under /tmp/sahana-rpm/RPMS/<arch>/