diff --git a/wordpress.spec b/wordpress.spec index 34bd21e..14fce7d 100644 --- a/wordpress.spec +++ b/wordpress.spec @@ -6,13 +6,19 @@ %else %global with_cacert 1 %endif +# https://bugzilla.redhat.com/1147802 missing in EPEL-7 +%if 0%{?fedora} >= 17 || 0%{?rhel} == 6 +%global with_getid3 1 +%else +%global with_getid3 0 +%endif Summary: Blog tool and publishing platform URL: http://www.wordpress.org Name: wordpress Version: 4.0 Group: Applications/Publishing -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Source0: http://wordpress.org/%{name}-%{version}.tar.gz @@ -85,6 +91,9 @@ Requires: php-zip Requires: php-zlib # Unbundled libraries Requires: php-PHPMailer +%if %{with_getid3} +Requires: php-getid3 +%endif Requires: httpd %if %{with_cacert} Requires: ca-certificates @@ -187,12 +196,12 @@ find ${RPM_BUILD_ROOT} -type f -empty -exec rm -vf {} \; rm -f ${RPM_BUILD_ROOT}%{_datadir}/wordpress/{license.txt,readme.html} # Remove bundled php-simplepie and link to system copy -rm ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/class-simplepie.php -rm -rf ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/SimplePie +rm ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/class-simplepie.php +rm -r ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/SimplePie %if 0%{?rhel} == 5 -ln -sf /usr/share/php/php53-simplepie/autoloader.php \ +ln -s /usr/share/php/php53-simplepie/autoloader.php \ %else -ln -sf /usr/share/php/php-simplepie/autoloader.php \ +ln -s /usr/share/php/php-simplepie/autoloader.php \ %endif ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/class-simplepie.php @@ -204,6 +213,11 @@ for fic in phpmailer smtp; do ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/class-$fic.php done +%if %{with_getid3} +# Remove bundled php-getid3 +rm -r ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/ID3 +%endif + # Remove bundled ca-bundle.crt %if %{with_cacert} rm ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/certificates/ca-bundle.crt @@ -228,6 +242,20 @@ find ${RPM_BUILD_ROOT} \( -name \*.dolly -o -name \*.rhbz522897 -o -name \*.orig #/sbin/restorecon -R %{_localstatedir}/www/wordpress/ #fi +%if %{with_getid3} +%pretrans +if [ -L %{_datadir}/wordpress/wp-includes/ID3 ] ; then + rm %{_datadir}/wordpress/wp-includes/ID3 +fi + +%posttrans +if [ -d %{_datadir}/wordpress/wp-includes ] ; then + ln -sfn %{_datadir}/php/getid3 \ + %{_datadir}/wordpress/wp-includes/ID3 +fi +%endif + + %clean rm -rf ${RPM_BUILD_ROOT} @@ -257,6 +285,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_datadir}/wordpress/xmlrpc.php %changelog +* Tue Sep 30 2014 Remi Collet - 4.0-2 +- use system php-getid3 when available #1145574 + * Mon Sep 8 2014 Remi Collet - 4.0-1 - WordPress 4.0 “Benny”