joomla/joomla.spec

changeset 535
ccd669318bc2
child 536
94aa9476a1c1
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/joomla/joomla.spec	Tue Aug 28 18:29:40 2012 +0200
     1.3 @@ -0,0 +1,192 @@
     1.4 +##
     1.5 +##  joomla.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package version
    1.28 +%define       V_dist   1.7.3
    1.29 +%define       V_opkg   1.7.3
    1.30 +%define       V_subdir 6/9/6/69674
    1.31 +
    1.32 +#   package information
    1.33 +Name:         joomla
    1.34 +Summary:      Content Management System (CMS)
    1.35 +URL:          http://www.joomla.org/
    1.36 +Vendor:       Open Source Matters
    1.37 +Packager:     OpenPKG Foundation e.V.
    1.38 +Distribution: OpenPKG Community
    1.39 +Class:        EVAL
    1.40 +Group:        CMS
    1.41 +License:      GPL/LGPL
    1.42 +Version:      %{V_opkg}
    1.43 +Release:      20111211
    1.44 +
    1.45 +#   list of sources
    1.46 +Source0:      http://downloads.joomlacode.org/frsrelease/%{V_subdir}/Joomla_%{V_dist}-Stable-Full_Package.zip
    1.47 +Source1:      joomla-setup.sh
    1.48 +Source2:      joomla-apache.conf
    1.49 +Source3:      rc.joomla
    1.50 +
    1.51 +#   build information
    1.52 +BuildPreReq:  OpenPKG, openpkg >= 20100101, infozip
    1.53 +PreReq:       OpenPKG, openpkg >= 20100101
    1.54 +PreReq:       apache
    1.55 +PreReq:       apache-php
    1.56 +PreReq:       apache-php::with_mysql = yes
    1.57 +PreReq:       apache-php::with_zlib = yes
    1.58 +PreReq:       apache-php::with_xml = yes
    1.59 +PreReq:       apache-php::with_gd = yes
    1.60 +PreReq:       apache-php::with_session = yes
    1.61 +PreReq:       apache-php::with_mm = yes
    1.62 +PreReq:       apache-php::with_sendmail = yes
    1.63 +PreReq:       MTA
    1.64 +
    1.65 +%description
    1.66 +    Joomla! is a popular Web-based Content Management System (CMS).
    1.67 +
    1.68 +%track
    1.69 +    prog joomla = {
    1.70 +        version   = %{V_dist}
    1.71 +        url       = http://joomlacode.org/gf/project/joomla/frs/
    1.72 +        regex     = frsrelease/\d+/\d+/Joomla-(__VER__)\.tar\.gz
    1.73 +    }
    1.74 +    prog joomla:subdir = {
    1.75 +        version   = %{V_subdir}
    1.76 +        url       = http://joomlacode.org/gf/project/joomla/frs/
    1.77 +        regex     = frsrelease/(\d+/\d+)/Joomla-__VER__\.tar\.gz
    1.78 +    }
    1.79 +
    1.80 +%prep
    1.81 +    %setup -q -T -c
    1.82 +    unzip -q -x %{SOURCE0}
    1.83 +
    1.84 +%build
    1.85 +
    1.86 +%install
    1.87 +    #   create installation hierarchy
    1.88 +    %{l_shtool} mkdir -f -p -m 755 \
    1.89 +        $RPM_BUILD_ROOT%{l_prefix}/sbin \
    1.90 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
    1.91 +        $RPM_BUILD_ROOT%{l_prefix}/etc/joomla \
    1.92 +        $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime \
    1.93 +        $RPM_BUILD_ROOT%{l_prefix}/var/joomla/db \
    1.94 +        $RPM_BUILD_ROOT%{l_prefix}/var/joomla/log \
    1.95 +        $RPM_BUILD_ROOT%{l_prefix}/var/joomla/run
    1.96 +
    1.97 +    #   adjust default configuration
    1.98 +    %{l_shtool} subst \
    1.99 +        -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;' \
   1.100 +        installation/template/tmpl/configuration.html
   1.101 +
   1.102 +    #   install main program files
   1.103 +    find . -name ".#*" -print | xargs rm -f
   1.104 +    find . -name "*.orig" -print | xargs rm -f
   1.105 +    cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/
   1.106 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/configuration.php-dist
   1.107 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/htaccess.txt
   1.108 +
   1.109 +    #   post-adjustment: move risky installation area out of runtime area
   1.110 +    #   (will be dynmically linked in again later)
   1.111 +    mv  $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/installation \
   1.112 +        $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/installation
   1.113 +
   1.114 +    #   install run-command script
   1.115 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.116 +        -e 's;@l_path@;%{l_build_path};' \
   1.117 +        %{SOURCE rc.joomla} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.118 +
   1.119 +    #   install setup script
   1.120 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.121 +        %{SOURCE joomla-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/joomla-setup
   1.122 +
   1.123 +    #   install Apache configuration
   1.124 +    l_hostname=`%{l_shtool} echo -e %h`
   1.125 +    l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
   1.126 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.127 +        -e "s;@l_hostname@;$l_hostname;g" \
   1.128 +        -e "s;@l_domainname@;$l_domainname;g" \
   1.129 +        %{SOURCE joomla-apache.conf} \
   1.130 +        $RPM_BUILD_ROOT%{l_prefix}/etc/joomla/
   1.131 +
   1.132 +    #   determine installation files
   1.133 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.134 +        %{l_files_std} \
   1.135 +        '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/joomla/*' \
   1.136 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla' \
   1.137 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*' \
   1.138 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*' \
   1.139 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*' \
   1.140 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*/*' \
   1.141 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla' \
   1.142 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla/*'
   1.143 +
   1.144 +%files -f files
   1.145 +
   1.146 +%clean
   1.147 +
   1.148 +%post
   1.149 +    if [ $1 -eq 1 ]; then
   1.150 +        #   display final hints on initial installation
   1.151 +        ( echo "To complete the Joomla! installation:"
   1.152 +          echo "1. start the MySQL RDBMS:"
   1.153 +          echo "   \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start"
   1.154 +          echo "2. setup the Joomla! database in the MySQL RDBMS:"
   1.155 +          echo "   \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup install"
   1.156 +          echo "3. start the Joomla! Apache webserver:"
   1.157 +          echo "   \$ $RPM_INSTALL_PREFIX/bin/openpkg rc joomla start"
   1.158 +          echo "4. setup Joomla! through the Web installer..."
   1.159 +          echo "   http://localhost:8080/joomla/"
   1.160 +          echo "   ..and on page \"4: Database\" use:"
   1.161 +          echo "   - Host Name:     \"localhost\""
   1.162 +          echo "   - User Name:     \"joomla\""
   1.163 +          echo "   - Password:      \"joomla\""
   1.164 +          echo "   - Database Name: \"joomla\""
   1.165 +          echo "5. fixup installation afterwards:"
   1.166 +          echo "   \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup cleanup"
   1.167 +          echo "6. access Joomla! via:"
   1.168 +          echo "   http://localhost:8080/joomla/              (website view)"
   1.169 +          echo "   http://localhost:8080/joomla/administrator (website admin)"
   1.170 +        ) | %{l_rpmtool} msg -b -t notice
   1.171 +    elif [ $1 -eq 2 ]; then
   1.172 +        #   after upgrade, restart service
   1.173 +        rm -f $RPM_INSTALL_PREFIX/lib/joomla/runtime/installation
   1.174 +        [ $1 -eq 2 ] || exit 0
   1.175 +        eval `%{l_rc} joomla status 2>/dev/null`
   1.176 +        [ ".$joomla_active" = .yes ] && %{l_rc} joomla restart
   1.177 +    fi
   1.178 +    exit 0
   1.179 +
   1.180 +%preun
   1.181 +    if [ $1 -eq 0 ]; then
   1.182 +        #   before erase, stop service
   1.183 +        %{l_rc} joomla stop 2>/dev/null
   1.184 +
   1.185 +        #   remove database
   1.186 +        $RPM_INSTALL_PREFIX/sbin/joomla-setup uninstall >/dev/null 2>&1 || true
   1.187 +
   1.188 +        #   remove run-time files
   1.189 +        rm -f $RPM_INSTALL_PREFIX/var/joomla/db/*   >/dev/null 2>&1 || true
   1.190 +        rm -f $RPM_INSTALL_PREFIX/var/joomla/db/*/* >/dev/null 2>&1 || true
   1.191 +        rm -f $RPM_INSTALL_PREFIX/var/joomla/run/*  >/dev/null 2>&1 || true
   1.192 +        rm -f $RPM_INSTALL_PREFIX/var/joomla/log/*  >/dev/null 2>&1 || true
   1.193 +    fi
   1.194 +    exit 0
   1.195 +

mercurial