| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- ##
- ## wordpress.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package versions
- %define V_wordpress 2.3.2
- %define V_plugin_dbmanager 220
- %define V_plugin_pagenavi 220
- %define V_plugin_polls 221
- %define V_plugin_postviews 120
- %define V_plugin_print 220
- %define V_plugin_relativedate 120
- %define V_plugin_stats 220
- %define V_plugin_ban 120
- %define V_plugin_ela 0.10
- # package information
- Name: wordpress
- Summary: Weblog Publishing System
- URL: http://wordpress.org/
- Vendor: R. Boren & M. Mullenweg et al.
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: PLUS
- Group: CMS
- License: GPL
- Version: %{V_wordpress}
- Release: 20071230
- # list of sources
- Source0: http://wordpress.org/wordpress-%{V_wordpress}.tar.gz
- Source1: wordpress-apache.conf
- Source2: wordpress-setup.sh
- Source3: wordpress-cron.sh
- Source4: rc.wordpress
- Source10: http://lesterchan.net/others/downloads/wp-dbmanager%{V_plugin_dbmanager}.zip
- Source11: http://lesterchan.net/others/downloads/wp-pagenavi%{V_plugin_pagenavi}.zip
- Source12: http://lesterchan.net/others/downloads/wp-polls%{V_plugin_polls}.zip
- Source13: http://lesterchan.net/others/downloads/wp-postviews%{V_plugin_postviews}.zip
- Source14: http://lesterchan.net/others/downloads/wp-print%{V_plugin_print}.zip
- Source15: http://lesterchan.net/others/downloads/wp-relativedate%{V_plugin_relativedate}.zip
- Source16: http://lesterchan.net/others/downloads/wp-stats%{V_plugin_stats}.zip
- Source17: http://lesterchan.net/others/downloads/wp-ban%{V_plugin_ban}.zip
- Source18: http://www.sonsofskadi.net/wp-content/upload/af-extended-live-archive-%{V_plugin_ela}.zip
- Patch0: wordpress.patch
- Patch1: wordpress.patch.ela
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20060823, infozip
- PreReq: OpenPKG, openpkg >= 20060823
- PreReq: apache, wget
- PreReq: apache-php
- PreReq: apache-php::with_mysql = yes
- PreReq: apache-php::with_pcre = yes
- PreReq: apache-php::with_sendmail = yes
- AutoReq: no
- AutoReqProv: no
- %description
- WordPress is a state-of-the-art semantic personal publishing
- platform (aka Weblog or BLOG) with a focus on aesthetics, web
- standards, and usability.
- %track
- prog wordpress:wordpress = {
- version = %{V_wordpress}
- url = http://wordpress.org/download/release-archive/
- regex = wordpress-(\d+\.\d+(\.\d+)?)\.tar\.gz
- }
- prog wordpress:plugin-dbmanager = {
- version = %{V_plugin_dbmanager}
- url = http://lesterchan.net/wordpress/readme/wp-dbmanager.html
- regex = WP-DBManager\s+(\d+\.\d+)
- transform = "s/^(\d+)\.(\d+)$/$1$2/s, $_"
- }
- prog wordpress:plugin-pagenavi = {
- version = %{V_plugin_pagenavi}
- url = http://lesterchan.net/wordpress/readme/wp-pagenavi.html
- regex = WP-PageNavi\s+(\d+\.\d+)
- transform = "s/^(\d+)\.(\d+)$/$1$2/s, $_"
- }
- prog wordpress:plugin-polls = {
- version = %{V_plugin_polls}
- url = http://lesterchan.net/wordpress/readme/wp-polls.html
- regex = WP-Polls\s+(\d+\.\d+)
- transform = "s/^(\d+)\.(\d+)$/$1$2/s, $_"
- }
- prog wordpress:plugin-postviews = {
- version = %{V_plugin_postviews}
- url = http://lesterchan.net/wordpress/readme/wp-postviews.html
- regex = WP-PostViews\s+(\d+\.\d+)
- transform = "s/^(\d+)\.(\d+)$/$1$2/s, $_"
- }
- prog wordpress:plugin-print = {
- version = %{V_plugin_print}
- url = http://lesterchan.net/wordpress/readme/wp-print.html
- regex = WP-Print\s+(\d+\.\d+)
- transform = "s/^(\d+)\.(\d+)$/$1$2/s, $_"
- }
- prog wordpress:plugin-relativedate = {
- version = %{V_plugin_relativedate}
- url = http://lesterchan.net/wordpress/readme/wp-relativedate.html
- regex = WP-RelativeDate\s+(\d+\.\d+)
- transform = "s/^(\d+)\.(\d+)$/$1$2/s, $_"
- }
- prog wordpress:plugin-stats = {
- version = %{V_plugin_stats}
- url = http://lesterchan.net/wordpress/readme/wp-stats.html
- regex = WP-Stats\s+(\d+\.\d+)
- transform = "s/^(\d+)\.(\d+)$/$1$2/s, $_"
- }
- prog wordpress:plugin-ban = {
- version = %{V_plugin_ban}
- url = http://lesterchan.net/wordpress/readme/wp-ban.html
- regex = WP-Ban\s+(\d+\.\d+)
- transform = "s/^(\d+)\.(\d+)$/$1$2/s, $_"
- }
- prog wordpress:plugin-ela = {
- version = %{V_plugin_ela}
- url = http://www.sonsofskadi.net/extended-live-archive/
- regex = af-extended-live-archive-(__VER__)\.zip
- }
- %prep
- %setup -q -c
- %{l_prefix}/bin/unzip -q -o -x %{SOURCE10}
- %{l_prefix}/bin/unzip -q -o -x %{SOURCE11}
- %{l_prefix}/bin/unzip -q -o -x %{SOURCE12}
- %{l_prefix}/bin/unzip -q -o -x %{SOURCE13}
- %{l_prefix}/bin/unzip -q -o -x %{SOURCE14}
- %{l_prefix}/bin/unzip -q -o -x %{SOURCE15}
- %{l_prefix}/bin/unzip -q -o -x %{SOURCE16}
- %{l_prefix}/bin/unzip -q -o -x %{SOURCE17}
- %{l_prefix}/bin/unzip -q -o -x %{SOURCE18}
- %patch -p0
- %patch -p0 -d af-extended-live-archive -P 1
- rm -f af-extended-live-archive/*.orig
- rm -f af-extended-live-archive/*/*.orig
- %build
- # create configuration file
- %{l_shtool} install -m 644 \
- -e 's;putyourdbnamehere;wordpress;g' \
- -e 's;usernamehere;wordpress;g' \
- -e 's;yourpasswordhere;wordpress;g' \
- wordpress/wp-config-sample.php wordpress/wp-config.php
- %install
- # create installation hierarchy
- rm -rf $RPM_BUILD_ROOT
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/sbin \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
- $RPM_BUILD_ROOT%{l_prefix}/etc/wordpress \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress \
- $RPM_BUILD_ROOT%{l_prefix}/etc/wordpress \
- $RPM_BUILD_ROOT%{l_prefix}/var/wordpress/run \
- $RPM_BUILD_ROOT%{l_prefix}/var/wordpress/log \
- $RPM_BUILD_ROOT%{l_prefix}/var/wordpress/tmp
- # install program files
- cp -rp wordpress/* $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/
- find $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress -name "*.orig" -print | xargs rm -f
- # install plugins
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/backup-db \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/dbmanager \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/pagenavi \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/polls \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/postviews \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/print \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/relativedate \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/stats \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/ban \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/af-extended-live-archive
- cp -rp dbmanager/* \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/dbmanager/
- cp -rp pagenavi/pagenavi* \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/pagenavi/
- cp -rp polls/* \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/polls/
- cp -rp postviews/* \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/postviews/
- cp -rp print/* \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/print/
- cp -rp relativedate/* \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/relativedate/
- cp -rp stats/* \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/stats/
- cp -rp ban/* \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/ban/
- cp -rp af-extended-live-archive/* \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/af-extended-live-archive/
- # create additional uploads directory
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/uploads
- # install run-command script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rc.wordpress} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # install MySQL database setup script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE wordpress-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/wordpress-setup
- # install cron-job script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE wordpress-cron.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/wordpress-cron
- # install custom Apache configuration
- l_hostname=`%{l_shtool} echo -e %h`
- l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- -e "s;@l_hostname@;$l_hostname;g" \
- -e "s;@l_domainname@;$l_domainname;g" \
- %{SOURCE wordpress-apache.conf} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/wordpress/
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %{l_prefix}/etc/wordpress/*' \
- '%config %{l_prefix}/libexec/wordpress/wp-config.php' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/wordpress' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/wordpress/*' \
- '%attr(-,%{l_rusr},%{l_ngrp}) %{l_prefix}/libexec/wordpress/wp-content/uploads' \
- '%attr(-,%{l_rusr},%{l_ngrp}) %{l_prefix}/libexec/wordpress/wp-content/backup-db' \
- '%attr(-,%{l_rusr},%{l_ngrp}) %{l_prefix}/libexec/wordpress/wp-content/plugins/af-extended-live-archive/cache'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- if [ $1 -eq 1 ]; then
- # display final hints on initial installation
- ( echo "1. To complete this installation of Wordpress please start MySQL and"
- echo " initialize the Wordpress database like this:"
- echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start"
- echo " \$ $RPM_INSTALL_PREFIX/sbin/wordpress-setup"
- echo " But remember to configure your MySQL installation first."
- echo " At least set a MySQL administrator password in:"
- echo " \$ $RPM_INSTALL_PREFIX/etc/mysql/my.pwd"
- echo ""
- echo "3. By default, Wordpress runs its own Apache server on IPv4 address"
- echo " 127.0.0.1, TCP port 8081. Please change this by editing the"
- echo " \"Listen 127.0.0.1:8081\" directives in the configuration file"
- echo " $RPM_INSTALL_PREFIX/etc/wordpress/wordpress-apache.conf"
- echo ""
- echo "4. After this postinstallation, start Wordpress by running"
- echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc wordpress start"
- echo " and initialize the Wordpress database by connecting to:"
- echo " http://127.0.0.1:8081/wp-admin/wp-install.php"
- ) | %{l_rpmtool} msg -b -t notice
- fi
- if [ $1 -eq 2 ]; then
- # display final hints on update installation
- ( echo "Please perform a Wordpress database upgrade by visiting the"
- echo " http://127.0.0.1:8081/wp-admin/upgrade.php"
- echo "page on your Wordpress website."
- ) | %{l_rpmtool} msg -b -t notice
- # after upgrade, restart service
- eval `%{l_rc} wordpress status 2>/dev/null`
- [ ".$wordpress_active" = .yes ] && %{l_rc} wordpress restart
- fi
- exit 0
- %preun
- if [ $1 -eq 0 ]; then
- # before erase, stop service and remove log files
- %{l_rc} wordpress stop 2>/dev/null
- rm -f $RPM_INSTALL_PREFIX/var/wordpress/log/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/wordpress/run/* >/dev/null 2>&1 || true
- fi
- exit 0
|