michael@535: ## michael@535: ## joomla.spec -- OpenPKG RPM Package Specification michael@535: ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. michael@535: ## michael@535: ## Permission to use, copy, modify, and distribute this software for michael@535: ## any purpose with or without fee is hereby granted, provided that michael@535: ## the above copyright notice and this permission notice appear in all michael@535: ## copies. michael@535: ## michael@535: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@535: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@535: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@535: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@535: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@535: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@535: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@535: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@535: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@535: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@535: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@535: ## SUCH DAMAGE. michael@535: ## michael@535: michael@535: # package version michael@536: %define V_dist 2.5.6 michael@536: %define V_opkg 2.5.6 michael@536: %define V_subdir 17173/74756 michael@535: michael@535: # package information michael@535: Name: joomla michael@535: Summary: Content Management System (CMS) michael@535: URL: http://www.joomla.org/ michael@535: Vendor: Open Source Matters michael@535: Packager: OpenPKG Foundation e.V. michael@535: Distribution: OpenPKG Community michael@535: Class: EVAL michael@535: Group: CMS michael@535: License: GPL/LGPL michael@535: Version: %{V_opkg} michael@536: Release: 20120800 michael@535: michael@535: # list of sources michael@536: Source0: http://joomlacode.org/gf/download/frsrelease/%{V_subdir}/Joomla_%{V_dist}-Stable-Full_Package.tar.bz2 michael@535: Source1: joomla-setup.sh michael@535: Source2: joomla-apache.conf michael@535: Source3: rc.joomla michael@535: michael@535: # build information michael@536: BuildPreReq: OpenPKG, openpkg >= 20100101 michael@535: PreReq: OpenPKG, openpkg >= 20100101 michael@535: PreReq: apache michael@535: PreReq: apache-php michael@535: PreReq: apache-php::with_mysql = yes michael@535: PreReq: apache-php::with_zlib = yes michael@535: PreReq: apache-php::with_xml = yes michael@535: PreReq: apache-php::with_gd = yes michael@535: PreReq: apache-php::with_session = yes michael@535: PreReq: apache-php::with_mm = yes michael@535: PreReq: apache-php::with_sendmail = yes michael@535: PreReq: MTA michael@535: michael@535: %description michael@536: Joomla is a web based content management system (CMS) for publishing michael@536: content on the internet and intranets. It features a model view michael@536: controller (MVC) Web application framework and is useful for easily michael@536: creating and building a websites and web enabled applications. michael@536: michael@536: Joomla is written using object oriented programming techniques michael@536: and software design patterns, stores data in a MySQL database, michael@536: and includes features such as page caching, RSS feeds, printable michael@536: versions of pages, news flashes, blogs, polls, search, and support michael@536: for language internationalization. michael@535: michael@535: %track michael@535: prog joomla = { michael@535: version = %{V_dist} michael@535: url = http://joomlacode.org/gf/project/joomla/frs/ michael@535: regex = frsrelease/\d+/\d+/Joomla-(__VER__)\.tar\.gz michael@535: } michael@535: prog joomla:subdir = { michael@535: version = %{V_subdir} michael@535: url = http://joomlacode.org/gf/project/joomla/frs/ michael@535: regex = frsrelease/(\d+/\d+)/Joomla-__VER__\.tar\.gz michael@535: } michael@535: michael@535: %prep michael@536: %setup -q -T -c -a 0 michael@535: michael@535: %build michael@535: michael@535: %install michael@535: # create installation hierarchy michael@535: %{l_shtool} mkdir -f -p -m 755 \ michael@535: $RPM_BUILD_ROOT%{l_prefix}/sbin \ michael@535: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ michael@535: $RPM_BUILD_ROOT%{l_prefix}/etc/joomla \ michael@535: $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime \ michael@535: $RPM_BUILD_ROOT%{l_prefix}/var/joomla/db \ michael@535: $RPM_BUILD_ROOT%{l_prefix}/var/joomla/log \ michael@535: $RPM_BUILD_ROOT%{l_prefix}/var/joomla/run michael@535: michael@535: # adjust default configuration michael@535: %{l_shtool} subst \ michael@536: -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;g' \ michael@536: libraries/phpmailer/phpmailer.php \ michael@536: installation/models/configuration.php \ michael@536: installation/configuration.php-dist \ michael@536: administrator/components/com_config/models/forms/application.xml michael@535: michael@535: # install main program files michael@535: find . -name ".#*" -print | xargs rm -f michael@535: find . -name "*.orig" -print | xargs rm -f michael@535: cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/ michael@535: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/configuration.php-dist michael@535: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/htaccess.txt michael@535: michael@536: # postadjustment: move risky installation area out of runtime area michael@536: # which will be dynmically linked in again later michael@535: mv $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/installation \ michael@535: $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/installation michael@535: michael@536: # install runcommand script michael@535: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@535: -e 's;@l_path@;%{l_build_path};' \ michael@535: %{SOURCE rc.joomla} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ michael@535: michael@535: # install setup script michael@535: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@535: %{SOURCE joomla-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/joomla-setup michael@535: michael@535: # install Apache configuration michael@535: l_hostname=`%{l_shtool} echo -e %h` michael@535: l_domainname=`%{l_shtool} echo -e %d | cut -c2-` michael@535: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@535: -e "s;@l_hostname@;$l_hostname;g" \ michael@535: -e "s;@l_domainname@;$l_domainname;g" \ michael@535: %{SOURCE joomla-apache.conf} \ michael@535: $RPM_BUILD_ROOT%{l_prefix}/etc/joomla/ michael@535: michael@535: # determine installation files michael@535: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@535: %{l_files_std} \ michael@535: '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/joomla/*' \ michael@535: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla' \ michael@535: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*' \ michael@535: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*' \ michael@535: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*' \ michael@535: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*/*' \ michael@535: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla' \ michael@535: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla/*' michael@535: michael@535: %files -f files michael@535: michael@535: %clean michael@535: michael@535: %post michael@535: if [ $1 -eq 1 ]; then michael@535: # display final hints on initial installation michael@535: ( echo "To complete the Joomla! installation:" michael@535: echo "1. start the MySQL RDBMS:" michael@535: echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start" michael@535: echo "2. setup the Joomla! database in the MySQL RDBMS:" michael@535: echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup install" michael@535: echo "3. start the Joomla! Apache webserver:" michael@535: echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc joomla start" michael@535: echo "4. setup Joomla! through the Web installer..." michael@535: echo " http://localhost:8080/joomla/" michael@535: echo " ..and on page \"4: Database\" use:" michael@535: echo " - Host Name: \"localhost\"" michael@535: echo " - User Name: \"joomla\"" michael@535: echo " - Password: \"joomla\"" michael@535: echo " - Database Name: \"joomla\"" michael@535: echo "5. fixup installation afterwards:" michael@535: echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup cleanup" michael@535: echo "6. access Joomla! via:" michael@535: echo " http://localhost:8080/joomla/ (website view)" michael@535: echo " http://localhost:8080/joomla/administrator (website admin)" michael@535: ) | %{l_rpmtool} msg -b -t notice michael@535: elif [ $1 -eq 2 ]; then michael@535: # after upgrade, restart service michael@535: rm -f $RPM_INSTALL_PREFIX/lib/joomla/runtime/installation michael@535: [ $1 -eq 2 ] || exit 0 michael@535: eval `%{l_rc} joomla status 2>/dev/null` michael@535: [ ".$joomla_active" = .yes ] && %{l_rc} joomla restart michael@535: fi michael@535: exit 0 michael@535: michael@535: %preun michael@535: if [ $1 -eq 0 ]; then michael@535: # before erase, stop service michael@535: %{l_rc} joomla stop 2>/dev/null michael@535: michael@535: # remove database michael@535: $RPM_INSTALL_PREFIX/sbin/joomla-setup uninstall >/dev/null 2>&1 || true michael@535: michael@536: # remove runtime files michael@535: rm -f $RPM_INSTALL_PREFIX/var/joomla/db/* >/dev/null 2>&1 || true michael@535: rm -f $RPM_INSTALL_PREFIX/var/joomla/db/*/* >/dev/null 2>&1 || true michael@535: rm -f $RPM_INSTALL_PREFIX/var/joomla/run/* >/dev/null 2>&1 || true michael@535: rm -f $RPM_INSTALL_PREFIX/var/joomla/log/* >/dev/null 2>&1 || true michael@535: fi michael@535: exit 0 michael@535: