# HG changeset patch # User Michael Schloh von Bennewitz # Date 1346171380 -7200 # Node ID ccd669318bc2387786571ce8258c58102dd9bd64 # Parent d2d0020cfafa001ea3d19dd39a4143528ea15d83 Import package vendor original specs for necessary manipulations. diff -r d2d0020cfafa -r ccd669318bc2 joomla/joomla-apache.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/joomla/joomla-apache.conf Tue Aug 28 18:29:40 2012 +0200 @@ -0,0 +1,113 @@ +## +## joomla-apache.conf -- Joomla Apache Custom Configuration +## + +ServerRoot @l_prefix@ +ServerAdmin root@@l_hostname@.@l_domainname@ +ServerName @l_hostname@.@l_domainname@ +ServerTokens Prod +User @l_rusr@ +Group @l_rgrp@ +Listen 127.0.0.1:8080 + +# runtime files +PidFile @l_prefix@/var/joomla/run/apache.pid +ScoreBoardFile @l_prefix@/var/joomla/run/apache.sb +LockFile @l_prefix@/var/joomla/run/apache.lck + +# include apache-php +Include @l_prefix@/etc/apache/apache.d/apache-php.conf + +# server behaviour +Timeout 300 +KeepAlive on +MaxKeepAliveRequests 100 +KeepAliveTimeout 15 +MinSpareServers 5 +MaxSpareServers 10 +StartServers 5 +MaxClients 15 +MaxRequestsPerChild 500 +HostnameLookups off +UseCanonicalName on + +# access logging +LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined +LogFormat "%h %l %u %t \"%r\" %>s %b" common +LogFormat "%{Referer}i -> %U" referer +LogFormat "%{User-agent}i" agent +CustomLog @l_prefix@/var/joomla/log/apache.access.log common + +# error logging +LogLevel warn +ErrorLog @l_prefix@/var/joomla/log/apache.error.log +ServerSignature on + +# secure root directory + + Options FollowSymLinks + AllowOverride None + + +# browser specifics +BrowserMatch "Mozilla/2" nokeepalive +BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 +BrowserMatch "RealPlayer 4\.0" force-response-1.0 +BrowserMatch "Java/1\.0" force-response-1.0 +BrowserMatch "JDK/1\.0" force-response-1.0 + +# SSL/TLS support + + SSLRandomSeed startup builtin + SSLRandomSeed connect builtin + SSLMutex sem + SSLSessionCache shmcb:@l_prefix@/var/joomla/run/apache.scache(512000) + SSLSessionCacheTimeout 300 + SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL + SetEnvIf User-Agent ".*MSIE.*" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + + +# configure PHP for Joomla! +AddType application/x-httpd-php .php +php_admin_flag register_globals off +php_admin_flag safe_mode off +php_admin_flag safe_mode_gid off +php_admin_flag allow_url_fopen off +php_admin_flag display_errors on +php_admin_value log_errors on +php_admin_value max_execution_time 60 +php_admin_value max_input_time 60 +php_admin_value memory_limit 8M +php_admin_value post_max_size 8M +php_admin_value include_path .:@l_prefix@/lib/joomla/runtime + +# configure Joomla! +RewriteEngine on +RewriteRule ^/$ /joomla/ [R,L] +Alias /joomla @l_prefix@/lib/joomla/runtime +DocumentRoot @l_prefix@/lib/joomla/runtime +DirectoryIndex index.php +ErrorDocument 404 /index.php +ExpiresByType text/html A1 + + Options Indexes ExecCGI FollowSymLinks + AllowOverride None + Order allow,deny + Allow from all + RewriteEngine On + RewriteBase /joomla + RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] + RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC] + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule (.*) index.php + + diff -r d2d0020cfafa -r ccd669318bc2 joomla/joomla-setup.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/joomla/joomla-setup.sh Tue Aug 28 18:29:40 2012 +0200 @@ -0,0 +1,45 @@ +#!/bin/sh +## +## joomla-setup.sh -- Joomla! RDBMS Setup Utility +## + +# database configuration +db_name="joomla" +db_user="joomla" +db_pass="joomla" + +# determine RDBMS-specific details +db_suser=`grep "^user" @l_prefix@/etc/mysql/my.pwd |\ + sed -e 's;^user[^=]*= *;;' -e 's; *$;;'` +db_spass=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\ + sed -e 's;^password[^=]*= *;;' -e 's; *$;;'` + +# dispatch operation +cmd="${1:-"install"}" +case "$cmd" in + install ) + # create the database + @l_prefix@/bin/mysqladmin --user="$db_suser" --password="$db_spass" create "$db_name" + ( echo "GRANT ALL PRIVILEGES ON $db_name.* TO $db_user@localhost IDENTIFIED BY '$db_pass';" + echo "FLUSH PRIVILEGES;" + ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql + + # activate installer + rm -f @l_prefix@/lib/joomla/runtime/configuration.php + rm -rf @l_prefix@/lib/joomla/runtime/installation >/dev/null 2>&1 || true + cp -rp @l_prefix@/lib/joomla/installation @l_prefix@/lib/joomla/runtime/ + ;; + cleanup ) + # deactivate installer + rm -rf @l_prefix@/lib/joomla/runtime/installation >/dev/null 2>&1 || true + ;; + uninstall ) + # remove the database + ( echo "DROP DATABASE $db_name;" + ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql + + # remove the generated configuration + rm -f @l_prefix@/lib/joomla/runtime/configuration.php + ;; +esac + diff -r d2d0020cfafa -r ccd669318bc2 joomla/joomla.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/joomla/joomla.spec Tue Aug 28 18:29:40 2012 +0200 @@ -0,0 +1,192 @@ +## +## joomla.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2011 OpenPKG Foundation e.V. +## +## 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.7.3 +%define V_opkg 1.7.3 +%define V_subdir 6/9/6/69674 + +# 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: CMS +License: GPL/LGPL +Version: %{V_opkg} +Release: 20111211 + +# list of sources +Source0: http://downloads.joomlacode.org/frsrelease/%{V_subdir}/Joomla_%{V_dist}-Stable-Full_Package.zip +Source1: joomla-setup.sh +Source2: joomla-apache.conf +Source3: rc.joomla + +# build information +BuildPreReq: OpenPKG, openpkg >= 20100101, infozip +PreReq: OpenPKG, openpkg >= 20100101 +PreReq: apache +PreReq: apache-php +PreReq: apache-php::with_mysql = yes +PreReq: apache-php::with_zlib = yes +PreReq: apache-php::with_xml = yes +PreReq: apache-php::with_gd = yes +PreReq: apache-php::with_session = yes +PreReq: apache-php::with_mm = yes +PreReq: apache-php::with_sendmail = yes +PreReq: MTA + +%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 = frsrelease/\d+/\d+/Joomla-(__VER__)\.tar\.gz + } + prog joomla:subdir = { + version = %{V_subdir} + url = http://joomlacode.org/gf/project/joomla/frs/ + regex = frsrelease/(\d+/\d+)/Joomla-__VER__\.tar\.gz + } + +%prep + %setup -q -T -c + unzip -q -x %{SOURCE0} + +%build + +%install + # create installation hierarchy + %{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 + + # 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 + +%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 + diff -r d2d0020cfafa -r ccd669318bc2 joomla/rc.joomla --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/joomla/rc.joomla Tue Aug 28 18:29:40 2012 +0200 @@ -0,0 +1,45 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.joomla -- Run-Commands +## + +%config + joomla_enable="$openpkg_rc_def" + +%common + joomla_cfgfile="@l_prefix@/etc/joomla/joomla-apache.conf" + joomla_pidfile="@l_prefix@/var/joomla/run/apache.pid" + joomla_signal () { + [ -f $joomla_pidfile ] && kill -$1 `cat $joomla_pidfile` + } + +%status -u @l_susr@ -o + joomla_usable="no" + joomla_active="no" + @l_prefix@/sbin/apache -t -f $joomla_cfgfile 2>/dev/null && \ + joomla_usable="yes" + joomla_signal 0 && \ + joomla_active="yes" + echo "joomla_enable=\"$joomla_enable\"" + echo "joomla_usable=\"$joomla_usable\"" + echo "joomla_active=\"$joomla_active\"" + +%start -u @l_susr@ + rcService joomla enable yes || exit 0 + rcService joomla active yes && exit 0 + ( export PATH="@l_path@" + @l_prefix@/sbin/apache -f $joomla_cfgfile + ) || exit $? + +%stop -u @l_susr@ + rcService joomla enable yes || exit 0 + rcService joomla active no && exit 0 + joomla_signal TERM + sleep 2 + rm -f $joomla_pidfile >/dev/null 2>&1 || true + +%restart -u @l_susr@ + rcService joomla enable yes || exit 0 + rcService joomla active no && exit 0 + rc joomla stop start +