| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- ##
- ## joomla.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package version
- %define V_dist 1.5.Beta2
- %define V_opkg 1.5b2
- # package information
- Name: joomla
- Summary: Content Management System (CMS)
- URL: http://www.joomla.org/
- Vendor: Open Source Matters
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: EVAL
- Group: Web
- License: GPL/LGPL
- Version: %{V_opkg}
- Release: 20070626
- # list of sources
- Source0: http://downloads.joomlacode.org/frsrelease/1/0/1/10113/Joomla-%{V_dist}.tar.gz
- Source1: joomla-setup.sh
- Source2: joomla-apache.conf
- Source3: rc.joomla
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20060823
- PreReq: OpenPKG, openpkg >= 20060823
- PreReq: apache
- PreReq: apache-php
- PreReq: apache-php::with_mysql = yes
- PreReq: apache-php::with_zlib = yes
- PreReq: apache-php::with_pcre = yes
- PreReq: apache-php::with_xml = yes
- PreReq: apache-php::with_gd = yes
- PreReq: apache-php::with_mm = yes
- PreReq: MTA
- AutoReq: no
- AutoReqProv: no
- %description
- Joomla! is a popular Web-based Content Management System (CMS).
- %track
- prog joomla = {
- version = %{V_dist}
- url = http://joomlacode.org/gf/project/joomla/frs/
- regex = joomla-(__VER__)\.tar\.gz
- }
- %prep
- %setup -q -c
- %build
- %install
- # create installation hierarchy
- rm -rf $RPM_BUILD_ROOT
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/sbin \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
- $RPM_BUILD_ROOT%{l_prefix}/etc/joomla \
- $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime \
- $RPM_BUILD_ROOT%{l_prefix}/var/joomla/db \
- $RPM_BUILD_ROOT%{l_prefix}/var/joomla/log \
- $RPM_BUILD_ROOT%{l_prefix}/var/joomla/run
- # avoid trouble
- mv "libraries/simplepie/compatibility_test/COMPATIBILITY README.txt" \
- "libraries/simplepie/compatibility_test/COMPATIBILITY-README.txt"
- # adjust default configuration
- %{l_shtool} subst \
- -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;' \
- installation/template/tmpl/configuration.html
- # install main program files
- find . -name ".#*" -print | xargs rm -f
- find . -name "*.orig" -print | xargs rm -f
- cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/configuration.php-dist
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/htaccess.txt
- # post-adjustment: move risky installation area out of runtime area
- # (will be dynmically linked in again later)
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/installation \
- $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/installation
- # install run-command script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- -e 's;@l_path@;%{l_build_path};' \
- %{SOURCE rc.joomla} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # install setup script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE joomla-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/joomla-setup
- # install Apache configuration
- l_hostname=`%{l_shtool} echo -e %h`
- l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- -e "s;@l_hostname@;$l_hostname;g" \
- -e "s;@l_domainname@;$l_domainname;g" \
- %{SOURCE joomla-apache.conf} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/joomla/
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/joomla/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla/*'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- if [ $1 -eq 1 ]; then
- # display final hints on initial installation
- ( echo "To complete the Joomla! installation:"
- echo "1. start the MySQL RDBMS:"
- echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start"
- echo "2. setup the Joomla! database in the MySQL RDBMS:"
- echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup install"
- echo "3. start the Joomla! Apache webserver:"
- echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc joomla start"
- echo "4. setup Joomla! through the Web installer..."
- echo " http://localhost:8080/joomla/"
- echo " ..and on page \"4: Database\" use:"
- echo " - Host Name: \"localhost\""
- echo " - User Name: \"joomla\""
- echo " - Password: \"joomla\""
- echo " - Database Name: \"joomla\""
- echo "5. fixup installation afterwards:"
- echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup cleanup"
- echo "6. access Joomla! via:"
- echo " http://localhost:8080/joomla/ (website view)"
- echo " http://localhost:8080/joomla/administrator (website admin)"
- ) | %{l_rpmtool} msg -b -t notice
- elif [ $1 -eq 2 ]; then
- # after upgrade, restart service
- rm -f $RPM_INSTALL_PREFIX/lib/joomla/runtime/installation
- [ $1 -eq 2 ] || exit 0
- eval `%{l_rc} joomla status 2>/dev/null`
- [ ".$joomla_active" = .yes ] && %{l_rc} joomla restart
- fi
- exit 0
- %preun
- if [ $1 -eq 0 ]; then
- # before erase, stop service
- %{l_rc} joomla stop 2>/dev/null
- # remove database
- $RPM_INSTALL_PREFIX/sbin/joomla-setup uninstall >/dev/null 2>&1 || true
- # remove run-time files
- rm -f $RPM_INSTALL_PREFIX/var/joomla/db/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/joomla/db/*/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/joomla/run/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/joomla/log/* >/dev/null 2>&1 || true
- fi
- exit 0
|