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.
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@723 | 25 | %define V_dist 2.5.7 |
michael@723 | 26 | %define V_opkg 2.5.7 |
michael@723 | 27 | %define V_subdir 17410/76012 |
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@536 | 40 | Release: 20120800 |
michael@535 | 41 | |
michael@535 | 42 | # list of sources |
michael@536 | 43 | Source0: http://joomlacode.org/gf/download/frsrelease/%{V_subdir}/Joomla_%{V_dist}-Stable-Full_Package.tar.bz2 |
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@536 | 49 | BuildPreReq: OpenPKG, openpkg >= 20100101 |
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@730 | 60 | PreReq: apache-php::with_simplexml = yes |
michael@535 | 61 | PreReq: MTA |
michael@535 | 62 | |
michael@535 | 63 | %description |
michael@536 | 64 | Joomla is a web based content management system (CMS) for publishing |
michael@536 | 65 | content on the internet and intranets. It features a model view |
michael@536 | 66 | controller (MVC) Web application framework and is useful for easily |
michael@536 | 67 | creating and building a websites and web enabled applications. |
michael@536 | 68 | |
michael@536 | 69 | Joomla is written using object oriented programming techniques |
michael@536 | 70 | and software design patterns, stores data in a MySQL database, |
michael@536 | 71 | and includes features such as page caching, RSS feeds, printable |
michael@536 | 72 | versions of pages, news flashes, blogs, polls, search, and support |
michael@536 | 73 | for language internationalization. |
michael@535 | 74 | |
michael@535 | 75 | %track |
michael@535 | 76 | prog joomla = { |
michael@535 | 77 | version = %{V_dist} |
michael@535 | 78 | url = http://joomlacode.org/gf/project/joomla/frs/ |
michael@535 | 79 | regex = frsrelease/\d+/\d+/Joomla-(__VER__)\.tar\.gz |
michael@535 | 80 | } |
michael@535 | 81 | prog joomla:subdir = { |
michael@535 | 82 | version = %{V_subdir} |
michael@535 | 83 | url = http://joomlacode.org/gf/project/joomla/frs/ |
michael@535 | 84 | regex = frsrelease/(\d+/\d+)/Joomla-__VER__\.tar\.gz |
michael@535 | 85 | } |
michael@535 | 86 | |
michael@535 | 87 | %prep |
michael@536 | 88 | %setup -q -T -c -a 0 |
michael@535 | 89 | |
michael@535 | 90 | %build |
michael@535 | 91 | |
michael@535 | 92 | %install |
michael@535 | 93 | # create installation hierarchy |
michael@535 | 94 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@535 | 95 | $RPM_BUILD_ROOT%{l_prefix}/sbin \ |
michael@535 | 96 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
michael@535 | 97 | $RPM_BUILD_ROOT%{l_prefix}/etc/joomla \ |
michael@535 | 98 | $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime \ |
michael@535 | 99 | $RPM_BUILD_ROOT%{l_prefix}/var/joomla/db \ |
michael@535 | 100 | $RPM_BUILD_ROOT%{l_prefix}/var/joomla/log \ |
michael@535 | 101 | $RPM_BUILD_ROOT%{l_prefix}/var/joomla/run |
michael@535 | 102 | |
michael@535 | 103 | # adjust default configuration |
michael@535 | 104 | %{l_shtool} subst \ |
michael@536 | 105 | -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;g' \ |
michael@536 | 106 | libraries/phpmailer/phpmailer.php \ |
michael@536 | 107 | installation/models/configuration.php \ |
michael@536 | 108 | installation/configuration.php-dist \ |
michael@536 | 109 | administrator/components/com_config/models/forms/application.xml |
michael@535 | 110 | |
michael@535 | 111 | # install main program files |
michael@535 | 112 | find . -name ".#*" -print | xargs rm -f |
michael@535 | 113 | find . -name "*.orig" -print | xargs rm -f |
michael@535 | 114 | cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/ |
michael@535 | 115 | rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/configuration.php-dist |
michael@535 | 116 | rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/htaccess.txt |
michael@535 | 117 | |
michael@536 | 118 | # postadjustment: move risky installation area out of runtime area |
michael@536 | 119 | # which will be dynmically linked in again later |
michael@535 | 120 | mv $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/installation \ |
michael@535 | 121 | $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/installation |
michael@535 | 122 | |
michael@536 | 123 | # install runcommand script |
michael@535 | 124 | %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
michael@535 | 125 | -e 's;@l_path@;%{l_build_path};' \ |
michael@535 | 126 | %{SOURCE rc.joomla} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
michael@535 | 127 | |
michael@535 | 128 | # install setup script |
michael@535 | 129 | %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
michael@535 | 130 | %{SOURCE joomla-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/joomla-setup |
michael@535 | 131 | |
michael@535 | 132 | # install Apache configuration |
michael@535 | 133 | l_hostname=`%{l_shtool} echo -e %h` |
michael@535 | 134 | l_domainname=`%{l_shtool} echo -e %d | cut -c2-` |
michael@535 | 135 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@535 | 136 | -e "s;@l_hostname@;$l_hostname;g" \ |
michael@535 | 137 | -e "s;@l_domainname@;$l_domainname;g" \ |
michael@535 | 138 | %{SOURCE joomla-apache.conf} \ |
michael@535 | 139 | $RPM_BUILD_ROOT%{l_prefix}/etc/joomla/ |
michael@535 | 140 | |
michael@535 | 141 | # determine installation files |
michael@535 | 142 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@535 | 143 | %{l_files_std} \ |
michael@535 | 144 | '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/joomla/*' \ |
michael@535 | 145 | '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla' \ |
michael@535 | 146 | '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*' \ |
michael@535 | 147 | '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*' \ |
michael@535 | 148 | '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*' \ |
michael@535 | 149 | '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*/*' \ |
michael@535 | 150 | '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla' \ |
michael@535 | 151 | '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla/*' |
michael@535 | 152 | |
michael@535 | 153 | %files -f files |
michael@535 | 154 | |
michael@535 | 155 | %clean |
michael@535 | 156 | |
michael@535 | 157 | %post |
michael@535 | 158 | if [ $1 -eq 1 ]; then |
michael@535 | 159 | # display final hints on initial installation |
michael@535 | 160 | ( echo "To complete the Joomla! installation:" |
michael@535 | 161 | echo "1. start the MySQL RDBMS:" |
michael@535 | 162 | echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start" |
michael@535 | 163 | echo "2. setup the Joomla! database in the MySQL RDBMS:" |
michael@535 | 164 | echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup install" |
michael@535 | 165 | echo "3. start the Joomla! Apache webserver:" |
michael@535 | 166 | echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc joomla start" |
michael@535 | 167 | echo "4. setup Joomla! through the Web installer..." |
michael@535 | 168 | echo " http://localhost:8080/joomla/" |
michael@535 | 169 | echo " ..and on page \"4: Database\" use:" |
michael@535 | 170 | echo " - Host Name: \"localhost\"" |
michael@535 | 171 | echo " - User Name: \"joomla\"" |
michael@535 | 172 | echo " - Password: \"joomla\"" |
michael@535 | 173 | echo " - Database Name: \"joomla\"" |
michael@535 | 174 | echo "5. fixup installation afterwards:" |
michael@535 | 175 | echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup cleanup" |
michael@535 | 176 | echo "6. access Joomla! via:" |
michael@535 | 177 | echo " http://localhost:8080/joomla/ (website view)" |
michael@535 | 178 | echo " http://localhost:8080/joomla/administrator (website admin)" |
michael@535 | 179 | ) | %{l_rpmtool} msg -b -t notice |
michael@535 | 180 | elif [ $1 -eq 2 ]; then |
michael@535 | 181 | # after upgrade, restart service |
michael@535 | 182 | rm -f $RPM_INSTALL_PREFIX/lib/joomla/runtime/installation |
michael@535 | 183 | [ $1 -eq 2 ] || exit 0 |
michael@535 | 184 | eval `%{l_rc} joomla status 2>/dev/null` |
michael@535 | 185 | [ ".$joomla_active" = .yes ] && %{l_rc} joomla restart |
michael@535 | 186 | fi |
michael@535 | 187 | exit 0 |
michael@535 | 188 | |
michael@535 | 189 | %preun |
michael@535 | 190 | if [ $1 -eq 0 ]; then |
michael@535 | 191 | # before erase, stop service |
michael@535 | 192 | %{l_rc} joomla stop 2>/dev/null |
michael@535 | 193 | |
michael@535 | 194 | # remove database |
michael@535 | 195 | $RPM_INSTALL_PREFIX/sbin/joomla-setup uninstall >/dev/null 2>&1 || true |
michael@535 | 196 | |
michael@536 | 197 | # remove runtime files |
michael@535 | 198 | rm -f $RPM_INSTALL_PREFIX/var/joomla/db/* >/dev/null 2>&1 || true |
michael@535 | 199 | rm -f $RPM_INSTALL_PREFIX/var/joomla/db/*/* >/dev/null 2>&1 || true |
michael@535 | 200 | rm -f $RPM_INSTALL_PREFIX/var/joomla/run/* >/dev/null 2>&1 || true |
michael@535 | 201 | rm -f $RPM_INSTALL_PREFIX/var/joomla/log/* >/dev/null 2>&1 || true |
michael@535 | 202 | fi |
michael@535 | 203 | exit 0 |
michael@535 | 204 |