Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
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 # still need to package
49 # templates:
50 # chicken
51 # favourite
52 # gantry
53 # joomspirit_18
54 # joomspirit_35
55 # joomspirit_76
56 # js_wright
57 # pure_white
58 # jp_bloq
59 # jp_dailypraise
60 # jp_demi
61 # jp_genesis
62 # jp_medium
63 # rt_missioncontrol
64 # rt_afterburner
65 # rt_grunge
66 # rt_quasar
67 # branding in features/copyright.php
68 # extensions:
69 # hikashop
70 # virtuemart
71 # page qr code
72 # nbill lite
73 # smartcard
74 # acymailing
75 # phocamenu lite
76 # roksprocket
77 # rokbooster
78 # rokquickcart
79 # rokpad
80 # embedchessboard
81 # mod_chesspuzzle
82 # mobile joomla
83 # kunena
85 # build information
86 BuildPreReq: OpenPKG, openpkg >= 20100101
87 PreReq: OpenPKG, openpkg >= 20100101
88 PreReq: apache
89 PreReq: apache-php
90 PreReq: apache-php::with_mysql = yes
91 PreReq: apache-php::with_zlib = yes
92 PreReq: apache-php::with_xml = yes
93 PreReq: apache-php::with_gd = yes
94 PreReq: apache-php::with_session = yes
95 PreReq: apache-php::with_mm = yes
96 PreReq: apache-php::with_sendmail = yes
97 PreReq: apache-php::with_simplexml = yes
98 PreReq: MTA
100 %description
101 Joomla is a web based content management system (CMS) for publishing
102 content on the internet and intranets. It features a model view
103 controller (MVC) Web application framework and is useful for easily
104 creating and building a websites and web enabled applications.
106 Joomla is written using object oriented programming techniques
107 and software design patterns, stores data in a MySQL database,
108 and includes features such as page caching, RSS feeds, printable
109 versions of pages, news flashes, blogs, polls, search, and support
110 for language internationalization.
112 %track
113 prog joomla = {
114 version = %{V_dist}
115 url = http://joomlacode.org/gf/project/joomla/frs/
116 regex = frsrelease/\d+/\d+/Joomla-(__VER__)\.tar\.gz
117 }
118 prog joomla:subdir = {
119 version = %{V_subdir}
120 url = http://joomlacode.org/gf/project/joomla/frs/
121 regex = frsrelease/(\d+/\d+)/Joomla-__VER__\.tar\.gz
122 }
124 %prep
125 %setup -q -T -c -a 0
127 %build
129 %install
130 # create installation hierarchy
131 %{l_shtool} mkdir -f -p -m 755 \
132 $RPM_BUILD_ROOT%{l_prefix}/sbin \
133 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
134 $RPM_BUILD_ROOT%{l_prefix}/etc/joomla \
135 $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime \
136 $RPM_BUILD_ROOT%{l_prefix}/var/joomla/db \
137 $RPM_BUILD_ROOT%{l_prefix}/var/joomla/log \
138 $RPM_BUILD_ROOT%{l_prefix}/var/joomla/run
140 # adjust default configuration
141 %{l_shtool} subst \
142 -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;g' \
143 libraries/phpmailer/phpmailer.php \
144 installation/models/configuration.php \
145 installation/configuration.php-dist \
146 administrator/components/com_config/models/forms/application.xml
148 # install main program files
149 find . -name ".#*" -print | xargs rm -f
150 find . -name "*.orig" -print | xargs rm -f
151 cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/
152 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/configuration.php-dist
153 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/htaccess.txt
155 # postadjustment: move risky installation area out of runtime area
156 # which will be dynmically linked in again later
157 mv $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/installation \
158 $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/installation
160 # install runcommand script
161 %{l_shtool} install -c -m 755 %{l_value -s -a} \
162 -e 's;@l_path@;%{l_build_path};' \
163 %{SOURCE rc.joomla} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
165 # install setup script
166 %{l_shtool} install -c -m 755 %{l_value -s -a} \
167 %{SOURCE joomla-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/joomla-setup
169 # install Apache configuration
170 l_hostname=`%{l_shtool} echo -e %h`
171 l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
172 %{l_shtool} install -c -m 644 %{l_value -s -a} \
173 -e "s;@l_hostname@;$l_hostname;g" \
174 -e "s;@l_domainname@;$l_domainname;g" \
175 %{SOURCE joomla-apache.conf} \
176 $RPM_BUILD_ROOT%{l_prefix}/etc/joomla/
178 # determine installation files
179 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
180 %{l_files_std} \
181 '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/joomla/*' \
182 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla' \
183 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*' \
184 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*' \
185 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*' \
186 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*/*' \
187 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla' \
188 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla/*'
190 %files -f files
192 %clean
194 %post
195 if [ $1 -eq 1 ]; then
196 # display final hints on initial installation
197 ( echo "To complete the Joomla! installation:"
198 echo "1. start the MySQL RDBMS:"
199 echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start"
200 echo "2. setup the Joomla! database in the MySQL RDBMS:"
201 echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup install"
202 echo "3. start the Joomla! Apache webserver:"
203 echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc joomla start"
204 echo "4. setup Joomla! through the Web installer..."
205 echo " http://localhost:8080/joomla/"
206 echo " ..and on page \"4: Database\" use:"
207 echo " - Host Name: \"localhost\""
208 echo " - User Name: \"joomla\""
209 echo " - Password: \"joomla\""
210 echo " - Database Name: \"joomla\""
211 echo "5. fixup installation afterwards:"
212 echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup cleanup"
213 echo "6. access Joomla! via:"
214 echo " http://localhost:8080/joomla/ (website view)"
215 echo " http://localhost:8080/joomla/administrator (website admin)"
216 ) | %{l_rpmtool} msg -b -t notice
217 elif [ $1 -eq 2 ]; then
218 # after upgrade, restart service
219 rm -f $RPM_INSTALL_PREFIX/lib/joomla/runtime/installation
220 [ $1 -eq 2 ] || exit 0
221 eval `%{l_rc} joomla status 2>/dev/null`
222 [ ".$joomla_active" = .yes ] && %{l_rc} joomla restart
223 fi
224 exit 0
226 %preun
227 if [ $1 -eq 0 ]; then
228 # before erase, stop service
229 %{l_rc} joomla stop 2>/dev/null
231 # remove database
232 $RPM_INSTALL_PREFIX/sbin/joomla-setup uninstall >/dev/null 2>&1 || true
234 # remove runtime files
235 rm -f $RPM_INSTALL_PREFIX/var/joomla/db/* >/dev/null 2>&1 || true
236 rm -f $RPM_INSTALL_PREFIX/var/joomla/db/*/* >/dev/null 2>&1 || true
237 rm -f $RPM_INSTALL_PREFIX/var/joomla/run/* >/dev/null 2>&1 || true
238 rm -f $RPM_INSTALL_PREFIX/var/joomla/log/* >/dev/null 2>&1 || true
239 fi
240 exit 0