joomla/joomla.spec

Mon, 17 Sep 2012 19:10:10 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 17 Sep 2012 19:10:10 +0200
changeset 689
9fe04d4d4e5a
parent 535
ccd669318bc2
child 723
f051a589a05a
permissions
-rw-r--r--

Update to new version of vendor software although Oracle fails to deliver.
More specifically, newer db(3) patch revisions exist but Oracle has
removed them from the canonical download server URI for Berkely DB.

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

mercurial