joomla/joomla.spec

Tue, 28 Aug 2012 18:29:40 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:29:40 +0200
changeset 535
ccd669318bc2
child 536
94aa9476a1c1
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

michael@535 1 ##
michael@535 2 ## joomla.spec -- OpenPKG RPM Package Specification
michael@535 3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@535 4 ##
michael@535 5 ## Permission to use, copy, modify, and distribute this software for
michael@535 6 ## any purpose with or without fee is hereby granted, provided that
michael@535 7 ## the above copyright notice and this permission notice appear in all
michael@535 8 ## copies.
michael@535 9 ##
michael@535 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@535 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@535 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@535 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@535 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@535 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@535 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@535 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@535 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@535 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@535 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@535 21 ## SUCH DAMAGE.
michael@535 22 ##
michael@535 23
michael@535 24 # package version
michael@535 25 %define V_dist 1.7.3
michael@535 26 %define V_opkg 1.7.3
michael@535 27 %define V_subdir 6/9/6/69674
michael@535 28
michael@535 29 # package information
michael@535 30 Name: joomla
michael@535 31 Summary: Content Management System (CMS)
michael@535 32 URL: http://www.joomla.org/
michael@535 33 Vendor: Open Source Matters
michael@535 34 Packager: OpenPKG Foundation e.V.
michael@535 35 Distribution: OpenPKG Community
michael@535 36 Class: EVAL
michael@535 37 Group: CMS
michael@535 38 License: GPL/LGPL
michael@535 39 Version: %{V_opkg}
michael@535 40 Release: 20111211
michael@535 41
michael@535 42 # list of sources
michael@535 43 Source0: http://downloads.joomlacode.org/frsrelease/%{V_subdir}/Joomla_%{V_dist}-Stable-Full_Package.zip
michael@535 44 Source1: joomla-setup.sh
michael@535 45 Source2: joomla-apache.conf
michael@535 46 Source3: rc.joomla
michael@535 47
michael@535 48 # build information
michael@535 49 BuildPreReq: OpenPKG, openpkg >= 20100101, infozip
michael@535 50 PreReq: OpenPKG, openpkg >= 20100101
michael@535 51 PreReq: apache
michael@535 52 PreReq: apache-php
michael@535 53 PreReq: apache-php::with_mysql = yes
michael@535 54 PreReq: apache-php::with_zlib = yes
michael@535 55 PreReq: apache-php::with_xml = yes
michael@535 56 PreReq: apache-php::with_gd = yes
michael@535 57 PreReq: apache-php::with_session = yes
michael@535 58 PreReq: apache-php::with_mm = yes
michael@535 59 PreReq: apache-php::with_sendmail = yes
michael@535 60 PreReq: MTA
michael@535 61
michael@535 62 %description
michael@535 63 Joomla! is a popular Web-based Content Management System (CMS).
michael@535 64
michael@535 65 %track
michael@535 66 prog joomla = {
michael@535 67 version = %{V_dist}
michael@535 68 url = http://joomlacode.org/gf/project/joomla/frs/
michael@535 69 regex = frsrelease/\d+/\d+/Joomla-(__VER__)\.tar\.gz
michael@535 70 }
michael@535 71 prog joomla:subdir = {
michael@535 72 version = %{V_subdir}
michael@535 73 url = http://joomlacode.org/gf/project/joomla/frs/
michael@535 74 regex = frsrelease/(\d+/\d+)/Joomla-__VER__\.tar\.gz
michael@535 75 }
michael@535 76
michael@535 77 %prep
michael@535 78 %setup -q -T -c
michael@535 79 unzip -q -x %{SOURCE0}
michael@535 80
michael@535 81 %build
michael@535 82
michael@535 83 %install
michael@535 84 # create installation hierarchy
michael@535 85 %{l_shtool} mkdir -f -p -m 755 \
michael@535 86 $RPM_BUILD_ROOT%{l_prefix}/sbin \
michael@535 87 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@535 88 $RPM_BUILD_ROOT%{l_prefix}/etc/joomla \
michael@535 89 $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime \
michael@535 90 $RPM_BUILD_ROOT%{l_prefix}/var/joomla/db \
michael@535 91 $RPM_BUILD_ROOT%{l_prefix}/var/joomla/log \
michael@535 92 $RPM_BUILD_ROOT%{l_prefix}/var/joomla/run
michael@535 93
michael@535 94 # adjust default configuration
michael@535 95 %{l_shtool} subst \
michael@535 96 -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;' \
michael@535 97 installation/template/tmpl/configuration.html
michael@535 98
michael@535 99 # install main program files
michael@535 100 find . -name ".#*" -print | xargs rm -f
michael@535 101 find . -name "*.orig" -print | xargs rm -f
michael@535 102 cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/
michael@535 103 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/configuration.php-dist
michael@535 104 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/htaccess.txt
michael@535 105
michael@535 106 # post-adjustment: move risky installation area out of runtime area
michael@535 107 # (will be dynmically linked in again later)
michael@535 108 mv $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/installation \
michael@535 109 $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/installation
michael@535 110
michael@535 111 # install run-command script
michael@535 112 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@535 113 -e 's;@l_path@;%{l_build_path};' \
michael@535 114 %{SOURCE rc.joomla} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@535 115
michael@535 116 # install setup script
michael@535 117 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@535 118 %{SOURCE joomla-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/joomla-setup
michael@535 119
michael@535 120 # install Apache configuration
michael@535 121 l_hostname=`%{l_shtool} echo -e %h`
michael@535 122 l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
michael@535 123 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@535 124 -e "s;@l_hostname@;$l_hostname;g" \
michael@535 125 -e "s;@l_domainname@;$l_domainname;g" \
michael@535 126 %{SOURCE joomla-apache.conf} \
michael@535 127 $RPM_BUILD_ROOT%{l_prefix}/etc/joomla/
michael@535 128
michael@535 129 # determine installation files
michael@535 130 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@535 131 %{l_files_std} \
michael@535 132 '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/joomla/*' \
michael@535 133 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla' \
michael@535 134 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*' \
michael@535 135 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*' \
michael@535 136 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*' \
michael@535 137 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*/*' \
michael@535 138 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla' \
michael@535 139 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla/*'
michael@535 140
michael@535 141 %files -f files
michael@535 142
michael@535 143 %clean
michael@535 144
michael@535 145 %post
michael@535 146 if [ $1 -eq 1 ]; then
michael@535 147 # display final hints on initial installation
michael@535 148 ( echo "To complete the Joomla! installation:"
michael@535 149 echo "1. start the MySQL RDBMS:"
michael@535 150 echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start"
michael@535 151 echo "2. setup the Joomla! database in the MySQL RDBMS:"
michael@535 152 echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup install"
michael@535 153 echo "3. start the Joomla! Apache webserver:"
michael@535 154 echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc joomla start"
michael@535 155 echo "4. setup Joomla! through the Web installer..."
michael@535 156 echo " http://localhost:8080/joomla/"
michael@535 157 echo " ..and on page \"4: Database\" use:"
michael@535 158 echo " - Host Name: \"localhost\""
michael@535 159 echo " - User Name: \"joomla\""
michael@535 160 echo " - Password: \"joomla\""
michael@535 161 echo " - Database Name: \"joomla\""
michael@535 162 echo "5. fixup installation afterwards:"
michael@535 163 echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup cleanup"
michael@535 164 echo "6. access Joomla! via:"
michael@535 165 echo " http://localhost:8080/joomla/ (website view)"
michael@535 166 echo " http://localhost:8080/joomla/administrator (website admin)"
michael@535 167 ) | %{l_rpmtool} msg -b -t notice
michael@535 168 elif [ $1 -eq 2 ]; then
michael@535 169 # after upgrade, restart service
michael@535 170 rm -f $RPM_INSTALL_PREFIX/lib/joomla/runtime/installation
michael@535 171 [ $1 -eq 2 ] || exit 0
michael@535 172 eval `%{l_rc} joomla status 2>/dev/null`
michael@535 173 [ ".$joomla_active" = .yes ] && %{l_rc} joomla restart
michael@535 174 fi
michael@535 175 exit 0
michael@535 176
michael@535 177 %preun
michael@535 178 if [ $1 -eq 0 ]; then
michael@535 179 # before erase, stop service
michael@535 180 %{l_rc} joomla stop 2>/dev/null
michael@535 181
michael@535 182 # remove database
michael@535 183 $RPM_INSTALL_PREFIX/sbin/joomla-setup uninstall >/dev/null 2>&1 || true
michael@535 184
michael@535 185 # remove run-time files
michael@535 186 rm -f $RPM_INSTALL_PREFIX/var/joomla/db/* >/dev/null 2>&1 || true
michael@535 187 rm -f $RPM_INSTALL_PREFIX/var/joomla/db/*/* >/dev/null 2>&1 || true
michael@535 188 rm -f $RPM_INSTALL_PREFIX/var/joomla/run/* >/dev/null 2>&1 || true
michael@535 189 rm -f $RPM_INSTALL_PREFIX/var/joomla/log/* >/dev/null 2>&1 || true
michael@535 190 fi
michael@535 191 exit 0
michael@535 192

mercurial