## ## wordpress.spec -- OpenPKG RPM Package Specification ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. ## Copyright (c) 2000-2007 Ralf S. Engelschall ## ## 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.2 %define V_plugin_simpletagging 1-6 %define V_plugin_dbmanager 211 %define V_plugin_pagenavi 211 %define V_plugin_polls 220 %define V_plugin_postviews 111 %define V_plugin_print 211 %define V_plugin_relativedate 111 %define V_plugin_stats 211 %define V_plugin_ban 111 %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: 20070531 # 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://sw-guide.de/_mw-uploads/simple-tagging_%{V_plugin_simpletagging}.zip Source11: http://www.lesterchan.net/others/downloads/wp-dbmanager%{V_plugin_dbmanager}.zip Source12: http://www.lesterchan.net/others/downloads/wp-pagenavi%{V_plugin_pagenavi}.zip Source13: http://www.lesterchan.net/others/downloads/wp-polls%{V_plugin_polls}.zip Source14: http://www.lesterchan.net/others/downloads/wp-postviews%{V_plugin_postviews}.zip Source15: http://www.lesterchan.net/others/downloads/wp-print%{V_plugin_print}.zip Source16: http://www.lesterchan.net/others/downloads/wp-relativedate%{V_plugin_relativedate}.zip Source17: http://www.lesterchan.net/others/downloads/wp-stats%{V_plugin_stats}.zip Source18: http://www.lesterchan.net/others/downloads/wp-ban%{V_plugin_ban}.zip Source19: http://www.sonsofskadi.net/wp-content/upload/af-extended-live-archive-%{V_plugin_ela}.zip Patch0: wordpress.patch # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} BuildPreReq: OpenPKG, openpkg >= 20060823, infozip PreReq: OpenPKG, openpkg >= 20060823 PreReq: apache, wget PreReq: apache::with_mod_php = yes PreReq: apache::with_mod_php_mysql = yes PreReq: apache::with_mod_php_pcre = yes PreReq: apache::with_mod_php_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-simpletagging = { version = %{V_plugin_simpletagging} url = http://sw-guide.de/wordpress/wordpress-plugins/simple-tagging-plugin/ regex = Download\s+Latest\s+Version\s+(\d+\.\d+) transform = "s/^(\d+)\.(\d+)$/$1-$2/s, $_" } prog wordpress:plugin-dbmanager = { version = %{V_plugin_dbmanager} url = http://www.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://www.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://www.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://www.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://www.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://www.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://www.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://www.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} %{l_prefix}/bin/unzip -q -o -x %{SOURCE19} %patch -p0 -d wordpress %build # create configuration file %{l_shtool} install -m 644 \ -e 's;putyourdbnamehere;wordpress;g' \ -e 's;wordpresshere;wordpress;g' \ -e 's;yourwordpresshere;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/ # 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/simpletagging \ $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/ela cp -rp simple-tagging/simpletagging* \ $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/simpletagging/ 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/ela/ # 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/ela/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 " \"Port 8081\" and \"Listen 127.0.0.1:8081\" directives in" 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