You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

344 lines
15 KiB

##
## wordpress.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2013 OpenPKG Foundation e.V. <http://openpkg.net/>
##
## 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 3.7.1
%define V_plugin_akismet 2.5.9
%define V_plugin_dbmanager 2.62
%define V_plugin_pagenavi 2.74
%define V_plugin_polls 2.61
%define V_plugin_postviews 1.60
%define V_plugin_print 2.50
%define V_plugin_relativedate 1.50
%define V_plugin_ban 1.50
%define V_plugin_ela 0.20alpha3
%define V_plugin_stats 1.8.6
%define V_plugin_peterantispam 3.1.4
%define V_plugin_hashcash 4.6
%define V_plugin_twittergoodies 7.8.1
%define V_plugin_cumulus 1.23
# 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: 20131030
# 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://downloads.wordpress.org/plugin/akismet.%{V_plugin_akismet}.zip
Source11: http://downloads.wordpress.org/plugin/wp-dbmanager.%{V_plugin_dbmanager}.zip
Source12: http://downloads.wordpress.org/plugin/wp-pagenavi.%{V_plugin_pagenavi}.zip
Source13: http://downloads.wordpress.org/plugin/wp-polls.%{V_plugin_polls}.zip
Source14: http://downloads.wordpress.org/plugin/wp-postviews.%{V_plugin_postviews}.zip
Source15: http://downloads.wordpress.org/plugin/wp-print.%{V_plugin_print}.zip
Source16: http://downloads.wordpress.org/plugin/wp-relativedate.%{V_plugin_relativedate}.zip
Source17: http://downloads.wordpress.org/plugin/wp-ban.%{V_plugin_ban}.zip
Source18: http://extended-live-archive.googlecode.com/files/af-extended-live-archive_v%{V_plugin_ela}.zip
Source19: http://downloads.wordpress.org/plugin/stats.%{V_plugin_stats}.zip
Source20: http://downloads.wordpress.org/plugin/peters-custom-anti-spam-image.%{V_plugin_peterantispam}.zip
Source21: http://downloads.wordpress.org/plugin/wp-hashcash.%{V_plugin_hashcash}.zip
Source22: http://downloads.wordpress.org/plugin/twitter-goodies.%{V_plugin_twittergoodies}.zip
Source23: http://downloads.wordpress.org/plugin/wp-cumulus.%{V_plugin_cumulus}.zip
Patch0: wordpress.patch
# build information
BuildPreReq: OpenPKG, openpkg >= 20100101, infozip
PreReq: OpenPKG, openpkg >= 20100101
PreReq: apache, wget
PreReq: apache-php
PreReq: apache-php::with_mysql = yes
PreReq: apache-php::with_sendmail = yes
PreReq: apache-extfwd
%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-akismet = {
version = %{V_plugin_akismet}
url = http://wordpress.org/extend/plugins/akismet/download/
regex = akismet\.(__VER__)\.zip
}
prog wordpress:plugin-dbmanager = {
version = %{V_plugin_dbmanager}
url = http://lesterchan.net/wordpress/readme/wp-dbmanager.html
regex = WP-DBManager\s+(\d+\.\d+)
}
prog wordpress:plugin-pagenavi = {
version = %{V_plugin_pagenavi}
url = http://lesterchan.net/wordpress/readme/wp-pagenavi.html
regex = WP-PageNavi\s+(\d+\.\d+)
}
prog wordpress:plugin-polls = {
version = %{V_plugin_polls}
url = http://lesterchan.net/wordpress/readme/wp-polls.html
regex = WP-Polls\s+(\d+\.\d+)
}
prog wordpress:plugin-postviews = {
version = %{V_plugin_postviews}
url = http://lesterchan.net/wordpress/readme/wp-postviews.html
regex = WP-PostViews\s+(\d+\.\d+)
}
prog wordpress:plugin-print = {
version = %{V_plugin_print}
url = http://lesterchan.net/wordpress/readme/wp-print.html
regex = WP-Print\s+(\d+\.\d+)
}
prog wordpress:plugin-relativedate = {
version = %{V_plugin_relativedate}
url = http://lesterchan.net/wordpress/readme/wp-relativedate.html
regex = WP-RelativeDate\s+(\d+\.\d+)
}
prog wordpress:plugin-ban = {
version = %{V_plugin_ban}
url = http://lesterchan.net/wordpress/readme/wp-ban.html
regex = WP-Ban\s+(\d+\.\d+)
}
prog wordpress:plugin-ela = {
version = %{V_plugin_ela}
url = http://code.google.com/p/extended-live-archive/downloads/list
regex = af-extended-live-archive-(__VER__)\.zip
}
prog wordpress:plugin-stats = {
version = %{V_plugin_stats}
url = http://wordpress.org/extend/plugins/stats/
regex = stats\.(__VER__)\.zip
}
prog wordpress:plugin-peterantispam = {
version = %{V_plugin_peterantispam}
url = http://wordpress.org/extend/plugins/peters-custom-anti-spam-image/
regex = peters-custom-anti-spam-image\.(__VER__)\.zip
}
prog wordpress:plugin-hashcash = {
version = %{V_plugin_hashcash}
url = http://wordpress.org/extend/plugins/wp-hashcash/
regex = wp-hashcash\.(__VER__)\.zip
}
prog wordpress:plugin-twittergoodies = {
version = %{V_plugin_twittergoodies}
url = http://wordpress.org/extend/plugins/twitter-goodies/
regex = twitter-goodies\.(__VER__)\.zip
}
prog wordpress:plugin-cumulus = {
version = %{V_plugin_cumulus}
url = http://wordpress.org/extend/plugins/wp-cumulus/
regex = wp-cumulus\.(__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}
%{l_prefix}/bin/unzip -q -o -x %{SOURCE20}
%{l_prefix}/bin/unzip -q -o -x %{SOURCE21}
%{l_prefix}/bin/unzip -q -o -x %{SOURCE22}
%{l_prefix}/bin/unzip -q -o -x %{SOURCE23}
%patch -p0
%build
# create configuration file
%{l_shtool} install -m 644 \
-e 's;database_name_here;wordpress;g' \
-e 's;username_here;wordpress;g' \
-e 's;password_here;wordpress;g' \
wordpress/wp-config-sample.php wordpress/wp-config.php
%install
# create installation hierarchy
%{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
# update akismet plugin
cp -rp akismet/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/akismet/
# 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/ban \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/af-extended-live-archive \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/stats \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/peters-custom-anti-spam-image \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/hashcash \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/twitter-goodies \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/wp-cumulus
cp -rp wp-dbmanager/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/dbmanager/
cp -rp wp-pagenavi/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/pagenavi/
cp -rp wp-polls/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/polls/
cp -rp wp-postviews/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/postviews/
cp -rp wp-print/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/print/
cp -rp wp-relativedate/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/relativedate/
cp -rp wp-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/
cp -rp stats/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/stats/
cp -rp peters-custom-anti-spam-image/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/peters-custom-anti-spam-image/
cp -rp wp-hashcash/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/hashcash/
cp -rp twitter-goodies/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/twitter-goodies/
cp -rp wp-cumulus/* \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/plugins/wp-cumulus/
# 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
%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 install"
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 "2. 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 "3. 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/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
# remove database
$RPM_INSTALL_PREFIX/sbin/wordpress-setup uninstall >/dev/null 2>&1 || true
# remove run-time files
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