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