Import package vendor original specs for necessary manipulations.

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
parent 534
d2d0020cfafa
child 536
94aa9476a1c1

Import package vendor original specs for necessary manipulations.

joomla/joomla-apache.conf file | annotate | diff | comparison | revisions
joomla/joomla-setup.sh file | annotate | diff | comparison | revisions
joomla/joomla.spec file | annotate | diff | comparison | revisions
joomla/rc.joomla file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/joomla/joomla-apache.conf	Tue Aug 28 18:29:40 2012 +0200
     1.3 @@ -0,0 +1,113 @@
     1.4 +##
     1.5 +##  joomla-apache.conf -- Joomla Apache Custom Configuration
     1.6 +##
     1.7 +
     1.8 +ServerRoot             @l_prefix@
     1.9 +ServerAdmin            root@@l_hostname@.@l_domainname@
    1.10 +ServerName             @l_hostname@.@l_domainname@
    1.11 +ServerTokens           Prod
    1.12 +User                   @l_rusr@
    1.13 +Group                  @l_rgrp@
    1.14 +Listen                 127.0.0.1:8080
    1.15 +
    1.16 +#   runtime files
    1.17 +PidFile                @l_prefix@/var/joomla/run/apache.pid
    1.18 +ScoreBoardFile         @l_prefix@/var/joomla/run/apache.sb
    1.19 +LockFile               @l_prefix@/var/joomla/run/apache.lck
    1.20 +
    1.21 +#   include apache-php
    1.22 +Include                @l_prefix@/etc/apache/apache.d/apache-php.conf
    1.23 +
    1.24 +#  server behaviour
    1.25 +Timeout                300
    1.26 +KeepAlive              on
    1.27 +MaxKeepAliveRequests   100
    1.28 +KeepAliveTimeout       15
    1.29 +MinSpareServers        5
    1.30 +MaxSpareServers        10
    1.31 +StartServers           5
    1.32 +MaxClients             15
    1.33 +MaxRequestsPerChild    500
    1.34 +HostnameLookups        off
    1.35 +UseCanonicalName       on
    1.36 +
    1.37 +#   access logging
    1.38 +LogFormat              "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    1.39 +LogFormat              "%h %l %u %t \"%r\" %>s %b" common
    1.40 +LogFormat              "%{Referer}i -> %U" referer
    1.41 +LogFormat              "%{User-agent}i" agent
    1.42 +CustomLog              @l_prefix@/var/joomla/log/apache.access.log common
    1.43 +
    1.44 +#   error logging
    1.45 +LogLevel               warn
    1.46 +ErrorLog               @l_prefix@/var/joomla/log/apache.error.log
    1.47 +ServerSignature        on
    1.48 +
    1.49 +#   secure root directory
    1.50 +<Directory />
    1.51 +    Options FollowSymLinks
    1.52 +    AllowOverride None
    1.53 +</Directory>
    1.54 +
    1.55 +#   browser specifics
    1.56 +BrowserMatch "Mozilla/2"       nokeepalive
    1.57 +BrowserMatch "MSIE 4\.0b2;"    nokeepalive downgrade-1.0 force-response-1.0
    1.58 +BrowserMatch "RealPlayer 4\.0" force-response-1.0
    1.59 +BrowserMatch "Java/1\.0"       force-response-1.0
    1.60 +BrowserMatch "JDK/1\.0"        force-response-1.0
    1.61 +
    1.62 +#   SSL/TLS support
    1.63 +<IfModule ssl_module>
    1.64 +    SSLRandomSeed           startup builtin
    1.65 +    SSLRandomSeed           connect builtin
    1.66 +    SSLMutex                sem
    1.67 +    SSLSessionCache         shmcb:@l_prefix@/var/joomla/run/apache.scache(512000)
    1.68 +    SSLSessionCacheTimeout  300
    1.69 +    SSLCipherSuite          ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    1.70 +    SetEnvIf User-Agent ".*MSIE.*" \
    1.71 +             nokeepalive ssl-unclean-shutdown \
    1.72 +             downgrade-1.0 force-response-1.0
    1.73 +    <Files ~ "\.(cgi|shtml|phtml|php?)$">
    1.74 +        SSLOptions +StdEnvVars
    1.75 +    </Files>
    1.76 +    <Directory "@l_prefix@/cgi">
    1.77 +        SSLOptions +StdEnvVars
    1.78 +    </Directory>
    1.79 +</IfModule>
    1.80 +
    1.81 +#   configure PHP for Joomla!
    1.82 +AddType           application/x-httpd-php .php
    1.83 +php_admin_flag    register_globals      off
    1.84 +php_admin_flag    safe_mode             off
    1.85 +php_admin_flag    safe_mode_gid         off
    1.86 +php_admin_flag    allow_url_fopen       off
    1.87 +php_admin_flag    display_errors        on
    1.88 +php_admin_value   log_errors            on
    1.89 +php_admin_value   max_execution_time    60
    1.90 +php_admin_value   max_input_time        60
    1.91 +php_admin_value   memory_limit          8M
    1.92 +php_admin_value   post_max_size         8M
    1.93 +php_admin_value   include_path          .:@l_prefix@/lib/joomla/runtime
    1.94 +
    1.95 +#   configure Joomla!
    1.96 +RewriteEngine     on
    1.97 +RewriteRule       ^/$ /joomla/ [R,L]
    1.98 +Alias             /joomla @l_prefix@/lib/joomla/runtime
    1.99 +DocumentRoot      @l_prefix@/lib/joomla/runtime
   1.100 +DirectoryIndex    index.php
   1.101 +ErrorDocument     404 /index.php
   1.102 +ExpiresByType     text/html A1
   1.103 +<Directory        @l_prefix@/lib/joomla/runtime>
   1.104 +    Options       Indexes ExecCGI FollowSymLinks
   1.105 +    AllowOverride None
   1.106 +    Order         allow,deny
   1.107 +    Allow         from all
   1.108 +    RewriteEngine On
   1.109 +    RewriteBase   /joomla
   1.110 +    RewriteCond   %{REQUEST_URI} ^(/component/option,com)        [NC,OR]
   1.111 +    RewriteCond   %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
   1.112 +    RewriteCond   %{REQUEST_FILENAME} !-f
   1.113 +    RewriteCond   %{REQUEST_FILENAME} !-d
   1.114 +    RewriteRule   (.*) index.php
   1.115 +</Directory>
   1.116 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/joomla/joomla-setup.sh	Tue Aug 28 18:29:40 2012 +0200
     2.3 @@ -0,0 +1,45 @@
     2.4 +#!/bin/sh
     2.5 +##
     2.6 +##  joomla-setup.sh -- Joomla! RDBMS Setup Utility
     2.7 +##
     2.8 +
     2.9 +#   database configuration
    2.10 +db_name="joomla"
    2.11 +db_user="joomla"
    2.12 +db_pass="joomla"
    2.13 +
    2.14 +#   determine RDBMS-specific details
    2.15 +db_suser=`grep "^user" @l_prefix@/etc/mysql/my.pwd |\
    2.16 +          sed -e 's;^user[^=]*= *;;' -e 's; *$;;'`
    2.17 +db_spass=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\
    2.18 +          sed -e 's;^password[^=]*= *;;' -e 's; *$;;'`
    2.19 +
    2.20 +#   dispatch operation
    2.21 +cmd="${1:-"install"}"
    2.22 +case "$cmd" in
    2.23 +    install )
    2.24 +        #   create the database
    2.25 +        @l_prefix@/bin/mysqladmin --user="$db_suser" --password="$db_spass" create "$db_name"
    2.26 +        ( echo "GRANT ALL PRIVILEGES ON $db_name.* TO $db_user@localhost IDENTIFIED BY '$db_pass';"
    2.27 +          echo "FLUSH PRIVILEGES;"
    2.28 +        ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql
    2.29 +
    2.30 +        #   activate installer
    2.31 +        rm -f @l_prefix@/lib/joomla/runtime/configuration.php
    2.32 +        rm -rf @l_prefix@/lib/joomla/runtime/installation >/dev/null 2>&1 || true
    2.33 +        cp -rp @l_prefix@/lib/joomla/installation @l_prefix@/lib/joomla/runtime/
    2.34 +        ;;
    2.35 +    cleanup )
    2.36 +        #   deactivate installer
    2.37 +        rm -rf @l_prefix@/lib/joomla/runtime/installation >/dev/null 2>&1 || true
    2.38 +        ;;
    2.39 +    uninstall )
    2.40 +        #   remove the database
    2.41 +        ( echo "DROP DATABASE $db_name;"
    2.42 +        ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql
    2.43 +
    2.44 +        #   remove the generated configuration
    2.45 +        rm -f @l_prefix@/lib/joomla/runtime/configuration.php
    2.46 +        ;;
    2.47 +esac
    2.48 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/joomla/joomla.spec	Tue Aug 28 18:29:40 2012 +0200
     3.3 @@ -0,0 +1,192 @@
     3.4 +##
     3.5 +##  joomla.spec -- OpenPKG RPM Package Specification
     3.6 +##  Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
     3.7 +##
     3.8 +##  Permission to use, copy, modify, and distribute this software for
     3.9 +##  any purpose with or without fee is hereby granted, provided that
    3.10 +##  the above copyright notice and this permission notice appear in all
    3.11 +##  copies.
    3.12 +##
    3.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    3.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    3.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    3.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    3.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    3.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    3.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    3.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    3.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    3.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    3.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    3.24 +##  SUCH DAMAGE.
    3.25 +##
    3.26 +
    3.27 +#   package version
    3.28 +%define       V_dist   1.7.3
    3.29 +%define       V_opkg   1.7.3
    3.30 +%define       V_subdir 6/9/6/69674
    3.31 +
    3.32 +#   package information
    3.33 +Name:         joomla
    3.34 +Summary:      Content Management System (CMS)
    3.35 +URL:          http://www.joomla.org/
    3.36 +Vendor:       Open Source Matters
    3.37 +Packager:     OpenPKG Foundation e.V.
    3.38 +Distribution: OpenPKG Community
    3.39 +Class:        EVAL
    3.40 +Group:        CMS
    3.41 +License:      GPL/LGPL
    3.42 +Version:      %{V_opkg}
    3.43 +Release:      20111211
    3.44 +
    3.45 +#   list of sources
    3.46 +Source0:      http://downloads.joomlacode.org/frsrelease/%{V_subdir}/Joomla_%{V_dist}-Stable-Full_Package.zip
    3.47 +Source1:      joomla-setup.sh
    3.48 +Source2:      joomla-apache.conf
    3.49 +Source3:      rc.joomla
    3.50 +
    3.51 +#   build information
    3.52 +BuildPreReq:  OpenPKG, openpkg >= 20100101, infozip
    3.53 +PreReq:       OpenPKG, openpkg >= 20100101
    3.54 +PreReq:       apache
    3.55 +PreReq:       apache-php
    3.56 +PreReq:       apache-php::with_mysql = yes
    3.57 +PreReq:       apache-php::with_zlib = yes
    3.58 +PreReq:       apache-php::with_xml = yes
    3.59 +PreReq:       apache-php::with_gd = yes
    3.60 +PreReq:       apache-php::with_session = yes
    3.61 +PreReq:       apache-php::with_mm = yes
    3.62 +PreReq:       apache-php::with_sendmail = yes
    3.63 +PreReq:       MTA
    3.64 +
    3.65 +%description
    3.66 +    Joomla! is a popular Web-based Content Management System (CMS).
    3.67 +
    3.68 +%track
    3.69 +    prog joomla = {
    3.70 +        version   = %{V_dist}
    3.71 +        url       = http://joomlacode.org/gf/project/joomla/frs/
    3.72 +        regex     = frsrelease/\d+/\d+/Joomla-(__VER__)\.tar\.gz
    3.73 +    }
    3.74 +    prog joomla:subdir = {
    3.75 +        version   = %{V_subdir}
    3.76 +        url       = http://joomlacode.org/gf/project/joomla/frs/
    3.77 +        regex     = frsrelease/(\d+/\d+)/Joomla-__VER__\.tar\.gz
    3.78 +    }
    3.79 +
    3.80 +%prep
    3.81 +    %setup -q -T -c
    3.82 +    unzip -q -x %{SOURCE0}
    3.83 +
    3.84 +%build
    3.85 +
    3.86 +%install
    3.87 +    #   create installation hierarchy
    3.88 +    %{l_shtool} mkdir -f -p -m 755 \
    3.89 +        $RPM_BUILD_ROOT%{l_prefix}/sbin \
    3.90 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
    3.91 +        $RPM_BUILD_ROOT%{l_prefix}/etc/joomla \
    3.92 +        $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime \
    3.93 +        $RPM_BUILD_ROOT%{l_prefix}/var/joomla/db \
    3.94 +        $RPM_BUILD_ROOT%{l_prefix}/var/joomla/log \
    3.95 +        $RPM_BUILD_ROOT%{l_prefix}/var/joomla/run
    3.96 +
    3.97 +    #   adjust default configuration
    3.98 +    %{l_shtool} subst \
    3.99 +        -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;' \
   3.100 +        installation/template/tmpl/configuration.html
   3.101 +
   3.102 +    #   install main program files
   3.103 +    find . -name ".#*" -print | xargs rm -f
   3.104 +    find . -name "*.orig" -print | xargs rm -f
   3.105 +    cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/
   3.106 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/configuration.php-dist
   3.107 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/htaccess.txt
   3.108 +
   3.109 +    #   post-adjustment: move risky installation area out of runtime area
   3.110 +    #   (will be dynmically linked in again later)
   3.111 +    mv  $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/installation \
   3.112 +        $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/installation
   3.113 +
   3.114 +    #   install run-command script
   3.115 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   3.116 +        -e 's;@l_path@;%{l_build_path};' \
   3.117 +        %{SOURCE rc.joomla} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   3.118 +
   3.119 +    #   install setup script
   3.120 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   3.121 +        %{SOURCE joomla-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/joomla-setup
   3.122 +
   3.123 +    #   install Apache configuration
   3.124 +    l_hostname=`%{l_shtool} echo -e %h`
   3.125 +    l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
   3.126 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   3.127 +        -e "s;@l_hostname@;$l_hostname;g" \
   3.128 +        -e "s;@l_domainname@;$l_domainname;g" \
   3.129 +        %{SOURCE joomla-apache.conf} \
   3.130 +        $RPM_BUILD_ROOT%{l_prefix}/etc/joomla/
   3.131 +
   3.132 +    #   determine installation files
   3.133 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   3.134 +        %{l_files_std} \
   3.135 +        '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/joomla/*' \
   3.136 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla' \
   3.137 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*' \
   3.138 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*' \
   3.139 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*' \
   3.140 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*/*' \
   3.141 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla' \
   3.142 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla/*'
   3.143 +
   3.144 +%files -f files
   3.145 +
   3.146 +%clean
   3.147 +
   3.148 +%post
   3.149 +    if [ $1 -eq 1 ]; then
   3.150 +        #   display final hints on initial installation
   3.151 +        ( echo "To complete the Joomla! installation:"
   3.152 +          echo "1. start the MySQL RDBMS:"
   3.153 +          echo "   \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start"
   3.154 +          echo "2. setup the Joomla! database in the MySQL RDBMS:"
   3.155 +          echo "   \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup install"
   3.156 +          echo "3. start the Joomla! Apache webserver:"
   3.157 +          echo "   \$ $RPM_INSTALL_PREFIX/bin/openpkg rc joomla start"
   3.158 +          echo "4. setup Joomla! through the Web installer..."
   3.159 +          echo "   http://localhost:8080/joomla/"
   3.160 +          echo "   ..and on page \"4: Database\" use:"
   3.161 +          echo "   - Host Name:     \"localhost\""
   3.162 +          echo "   - User Name:     \"joomla\""
   3.163 +          echo "   - Password:      \"joomla\""
   3.164 +          echo "   - Database Name: \"joomla\""
   3.165 +          echo "5. fixup installation afterwards:"
   3.166 +          echo "   \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup cleanup"
   3.167 +          echo "6. access Joomla! via:"
   3.168 +          echo "   http://localhost:8080/joomla/              (website view)"
   3.169 +          echo "   http://localhost:8080/joomla/administrator (website admin)"
   3.170 +        ) | %{l_rpmtool} msg -b -t notice
   3.171 +    elif [ $1 -eq 2 ]; then
   3.172 +        #   after upgrade, restart service
   3.173 +        rm -f $RPM_INSTALL_PREFIX/lib/joomla/runtime/installation
   3.174 +        [ $1 -eq 2 ] || exit 0
   3.175 +        eval `%{l_rc} joomla status 2>/dev/null`
   3.176 +        [ ".$joomla_active" = .yes ] && %{l_rc} joomla restart
   3.177 +    fi
   3.178 +    exit 0
   3.179 +
   3.180 +%preun
   3.181 +    if [ $1 -eq 0 ]; then
   3.182 +        #   before erase, stop service
   3.183 +        %{l_rc} joomla stop 2>/dev/null
   3.184 +
   3.185 +        #   remove database
   3.186 +        $RPM_INSTALL_PREFIX/sbin/joomla-setup uninstall >/dev/null 2>&1 || true
   3.187 +
   3.188 +        #   remove run-time files
   3.189 +        rm -f $RPM_INSTALL_PREFIX/var/joomla/db/*   >/dev/null 2>&1 || true
   3.190 +        rm -f $RPM_INSTALL_PREFIX/var/joomla/db/*/* >/dev/null 2>&1 || true
   3.191 +        rm -f $RPM_INSTALL_PREFIX/var/joomla/run/*  >/dev/null 2>&1 || true
   3.192 +        rm -f $RPM_INSTALL_PREFIX/var/joomla/log/*  >/dev/null 2>&1 || true
   3.193 +    fi
   3.194 +    exit 0
   3.195 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/joomla/rc.joomla	Tue Aug 28 18:29:40 2012 +0200
     4.3 @@ -0,0 +1,45 @@
     4.4 +#!@l_prefix@/bin/openpkg rc
     4.5 +##
     4.6 +##  rc.joomla -- Run-Commands
     4.7 +##
     4.8 +
     4.9 +%config
    4.10 +    joomla_enable="$openpkg_rc_def"
    4.11 +
    4.12 +%common
    4.13 +    joomla_cfgfile="@l_prefix@/etc/joomla/joomla-apache.conf"
    4.14 +    joomla_pidfile="@l_prefix@/var/joomla/run/apache.pid"
    4.15 +    joomla_signal () {
    4.16 +        [ -f $joomla_pidfile ] && kill -$1 `cat $joomla_pidfile`
    4.17 +    }
    4.18 +
    4.19 +%status -u @l_susr@ -o
    4.20 +    joomla_usable="no"
    4.21 +    joomla_active="no"
    4.22 +    @l_prefix@/sbin/apache -t -f $joomla_cfgfile 2>/dev/null && \
    4.23 +        joomla_usable="yes"
    4.24 +    joomla_signal 0 && \
    4.25 +        joomla_active="yes"
    4.26 +    echo "joomla_enable=\"$joomla_enable\""
    4.27 +    echo "joomla_usable=\"$joomla_usable\""
    4.28 +    echo "joomla_active=\"$joomla_active\""
    4.29 +
    4.30 +%start -u @l_susr@
    4.31 +    rcService joomla enable yes || exit 0
    4.32 +    rcService joomla active yes && exit 0
    4.33 +    ( export PATH="@l_path@"
    4.34 +      @l_prefix@/sbin/apache -f $joomla_cfgfile
    4.35 +    ) || exit $?
    4.36 +
    4.37 +%stop -u @l_susr@
    4.38 +    rcService joomla enable yes || exit 0
    4.39 +    rcService joomla active no  && exit 0
    4.40 +    joomla_signal TERM
    4.41 +    sleep 2
    4.42 +    rm -f $joomla_pidfile >/dev/null 2>&1 || true
    4.43 +
    4.44 +%restart -u @l_susr@
    4.45 +    rcService joomla enable yes || exit 0
    4.46 +    rcService joomla active no  && exit 0
    4.47 +    rc joomla stop start
    4.48 +

mercurial