joomla.spec 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. ##
  2. ## joomla.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package version
  25. %define V_dist 1.5.Beta2
  26. %define V_opkg 1.5b2
  27. # package information
  28. Name: joomla
  29. Summary: Content Management System (CMS)
  30. URL: http://www.joomla.org/
  31. Vendor: Open Source Matters
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: EVAL
  35. Group: Web
  36. License: GPL/LGPL
  37. Version: %{V_opkg}
  38. Release: 20070626
  39. # list of sources
  40. Source0: http://downloads.joomlacode.org/frsrelease/1/0/1/10113/Joomla-%{V_dist}.tar.gz
  41. Source1: joomla-setup.sh
  42. Source2: joomla-apache.conf
  43. Source3: rc.joomla
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20060823
  48. PreReq: OpenPKG, openpkg >= 20060823
  49. PreReq: apache
  50. PreReq: apache-php
  51. PreReq: apache-php::with_mysql = yes
  52. PreReq: apache-php::with_zlib = yes
  53. PreReq: apache-php::with_pcre = yes
  54. PreReq: apache-php::with_xml = yes
  55. PreReq: apache-php::with_gd = yes
  56. PreReq: apache-php::with_mm = yes
  57. PreReq: MTA
  58. AutoReq: no
  59. AutoReqProv: no
  60. %description
  61. Joomla! is a popular Web-based Content Management System (CMS).
  62. %track
  63. prog joomla = {
  64. version = %{V_dist}
  65. url = http://joomlacode.org/gf/project/joomla/frs/
  66. regex = joomla-(__VER__)\.tar\.gz
  67. }
  68. %prep
  69. %setup -q -c
  70. %build
  71. %install
  72. # create installation hierarchy
  73. rm -rf $RPM_BUILD_ROOT
  74. %{l_shtool} mkdir -f -p -m 755 \
  75. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  76. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  77. $RPM_BUILD_ROOT%{l_prefix}/etc/joomla \
  78. $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime \
  79. $RPM_BUILD_ROOT%{l_prefix}/var/joomla/db \
  80. $RPM_BUILD_ROOT%{l_prefix}/var/joomla/log \
  81. $RPM_BUILD_ROOT%{l_prefix}/var/joomla/run
  82. # avoid trouble
  83. mv "libraries/simplepie/compatibility_test/COMPATIBILITY README.txt" \
  84. "libraries/simplepie/compatibility_test/COMPATIBILITY-README.txt"
  85. # adjust default configuration
  86. %{l_shtool} subst \
  87. -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;' \
  88. installation/template/tmpl/configuration.html
  89. # install main program files
  90. find . -name ".#*" -print | xargs rm -f
  91. find . -name "*.orig" -print | xargs rm -f
  92. cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/
  93. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/configuration.php-dist
  94. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/htaccess.txt
  95. # post-adjustment: move risky installation area out of runtime area
  96. # (will be dynmically linked in again later)
  97. mv $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/runtime/installation \
  98. $RPM_BUILD_ROOT%{l_prefix}/lib/joomla/installation
  99. # install run-command script
  100. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  101. -e 's;@l_path@;%{l_build_path};' \
  102. %{SOURCE rc.joomla} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  103. # install setup script
  104. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  105. %{SOURCE joomla-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/joomla-setup
  106. # install Apache configuration
  107. l_hostname=`%{l_shtool} echo -e %h`
  108. l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
  109. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  110. -e "s;@l_hostname@;$l_hostname;g" \
  111. -e "s;@l_domainname@;$l_domainname;g" \
  112. %{SOURCE joomla-apache.conf} \
  113. $RPM_BUILD_ROOT%{l_prefix}/etc/joomla/
  114. # determine installation files
  115. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  116. %{l_files_std} \
  117. '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/joomla/*' \
  118. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla' \
  119. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*' \
  120. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*' \
  121. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*' \
  122. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/joomla/*/*/*/*' \
  123. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla' \
  124. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/joomla/*'
  125. %files -f files
  126. %clean
  127. rm -rf $RPM_BUILD_ROOT
  128. %post
  129. if [ $1 -eq 1 ]; then
  130. # display final hints on initial installation
  131. ( echo "To complete the Joomla! installation:"
  132. echo "1. start the MySQL RDBMS:"
  133. echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start"
  134. echo "2. setup the Joomla! database in the MySQL RDBMS:"
  135. echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup install"
  136. echo "3. start the Joomla! Apache webserver:"
  137. echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc joomla start"
  138. echo "4. setup Joomla! through the Web installer..."
  139. echo " http://localhost:8080/joomla/"
  140. echo " ..and on page \"4: Database\" use:"
  141. echo " - Host Name: \"localhost\""
  142. echo " - User Name: \"joomla\""
  143. echo " - Password: \"joomla\""
  144. echo " - Database Name: \"joomla\""
  145. echo "5. fixup installation afterwards:"
  146. echo " \$ $RPM_INSTALL_PREFIX/sbin/joomla-setup cleanup"
  147. echo "6. access Joomla! via:"
  148. echo " http://localhost:8080/joomla/ (website view)"
  149. echo " http://localhost:8080/joomla/administrator (website admin)"
  150. ) | %{l_rpmtool} msg -b -t notice
  151. elif [ $1 -eq 2 ]; then
  152. # after upgrade, restart service
  153. rm -f $RPM_INSTALL_PREFIX/lib/joomla/runtime/installation
  154. [ $1 -eq 2 ] || exit 0
  155. eval `%{l_rc} joomla status 2>/dev/null`
  156. [ ".$joomla_active" = .yes ] && %{l_rc} joomla restart
  157. fi
  158. exit 0
  159. %preun
  160. if [ $1 -eq 0 ]; then
  161. # before erase, stop service
  162. %{l_rc} joomla stop 2>/dev/null
  163. # remove database
  164. $RPM_INSTALL_PREFIX/sbin/joomla-setup uninstall >/dev/null 2>&1 || true
  165. # remove run-time files
  166. rm -f $RPM_INSTALL_PREFIX/var/joomla/db/* >/dev/null 2>&1 || true
  167. rm -f $RPM_INSTALL_PREFIX/var/joomla/db/*/* >/dev/null 2>&1 || true
  168. rm -f $RPM_INSTALL_PREFIX/var/joomla/run/* >/dev/null 2>&1 || true
  169. rm -f $RPM_INSTALL_PREFIX/var/joomla/log/* >/dev/null 2>&1 || true
  170. fi
  171. exit 0