[wordpress] fix include in sources instead of fucking symlink

Remi Collet remi at fedoraproject.org
Tue Sep 30 07:05:32 UTC 2014


commit a7a4c3a8e5f259e722bbff93c667df05d2a1a230
Author: Remi Collet <remi at fedoraproject.org>
Date:   Tue Sep 30 09:05:22 2014 +0200

    fix include in sources instead of fucking symlink

 wordpress-4.0-systemlibs.patch |   21 +++++++++++++++++++++
 wordpress.spec                 |   32 ++++++++++++++------------------
 2 files changed, 35 insertions(+), 18 deletions(-)
---
diff --git a/wordpress-4.0-systemlibs.patch b/wordpress-4.0-systemlibs.patch
new file mode 100644
index 0000000..9d16ee6
--- /dev/null
+++ b/wordpress-4.0-systemlibs.patch
@@ -0,0 +1,21 @@
+diff -up wordpress/wp-admin/includes/media.php.old wordpress/wp-admin/includes/media.php
+--- wordpress/wp-admin/includes/media.php.old	2014-09-30 08:54:21.666519693 +0200
++++ wordpress/wp-admin/includes/media.php	2014-09-30 08:55:11.247757421 +0200
+@@ -2907,7 +2907,7 @@ function wp_read_video_metadata( $file )
+ 	$metadata = array();
+ 
+ 	if ( ! class_exists( 'getID3' ) )
+-		require( ABSPATH . WPINC . '/ID3/getid3.php' );
++		require( '/usr/share/php/getid3/getid3.php' );
+ 	$id3 = new getID3();
+ 	$data = $id3->analyze( $file );
+ 
+@@ -2962,7 +2962,7 @@ function wp_read_audio_metadata( $file )
+ 	$metadata = array();
+ 
+ 	if ( ! class_exists( 'getID3' ) )
+-		require( ABSPATH . WPINC . '/ID3/getid3.php' );
++		require( '/usr/share/php/getid3/getid3.php' );
+ 	$id3 = new getID3();
+ 	$data = $id3->analyze( $file );
+ 
diff --git a/wordpress.spec b/wordpress.spec
index 14fce7d..3f61035 100644
--- a/wordpress.spec
+++ b/wordpress.spec
@@ -7,6 +7,7 @@
 %global with_cacert 1
 %endif
 # https://bugzilla.redhat.com/1147802 missing in EPEL-7
+# https://bugzilla.redhat.com/1147817 php53-getid3 review
 %if 0%{?fedora} >= 17 || 0%{?rhel} == 6
 %global with_getid3 1
 %else
@@ -18,7 +19,7 @@ URL:        http://www.wordpress.org
 Name:       wordpress
 Version:    4.0
 Group:      Applications/Publishing
-Release:    2%{?dist}
+Release:    3%{?dist}
 License:    GPLv2
 
 Source0:    http://wordpress.org/%{name}-%{version}.tar.gz
@@ -51,6 +52,8 @@ Patch5: wordpress-4.0-config.patch
 # change DISALLOW_FILE_MODS default value to true
 # ignore WP_AUTO_UPDATE_CORE (always false)
 Patch6: wordpress-4.0-noupdate.patch
+# Use system libraries
+Patch7: wordpress-4.0-systemlibs.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: noarch
@@ -58,9 +61,15 @@ BuildArch: noarch
 %if 0%{?rhel} == 5
 Requires: php53 >= 5.2.4
 Requires: php53-simplepie >= 1.3.1
+%if %{with_getid3}
+Requires: php53-getid3
+%endif
 %else
 Requires: php >= 5.2.4
 Requires: php-simplepie >= 1.3.1
+%if %{with_getid3}
+Requires: php-getid3
+%endif
 %endif
 # From phpcompatinfo report for version 3.8
 Requires: php-curl
@@ -91,9 +100,6 @@ 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
@@ -141,6 +147,9 @@ rm wp-content/plugins/akismet/.htaccess
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%if %{with_getid3}
+%patch7 -p1
+%endif
 
 # We patch a .js file, used patched file instead of unpatch minified one
 ln -sf plugin.js wp-includes/js/tinymce/plugins/media/plugin.min.js
@@ -242,19 +251,6 @@ 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}
@@ -285,7 +281,7 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_datadir}/wordpress/xmlrpc.php
 
 %changelog
-* Tue Sep 30 2014 Remi Collet <remi at fedoraproject.org> - 4.0-2
+* Tue Sep 30 2014 Remi Collet <remi at fedoraproject.org> - 4.0-3
 - use system php-getid3 when available #1145574
 
 * Mon Sep  8 2014 Remi Collet <remi at fedoraproject.org> - 4.0-1


More information about the scm-commits mailing list