use bundled libraries

This commit is contained in:
Remi Collet 2021-12-07 10:49:22 +01:00
commit f5806fdace

View file

@ -21,7 +21,7 @@ Summary: Blog tool and publishing platform
URL: http://www.wordpress.org
Name: wordpress
Version: %{upstream_version}%{?upstream_prever:~%upstream_lower}
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2
Source0: https://wordpress.org/%{name}-%{upstream_version}%{?upstream_prever:-%{upstream_prever}}.tar.gz
@ -78,8 +78,6 @@ Requires: php
%endif
Requires: php(language) >= 7.2
Requires: php-sodium
Requires: php-simplepie >= 1.3.1
Requires: php-getid3
Requires: php-ctype
Requires: php-filter
Requires: php-mysqli
@ -106,13 +104,20 @@ Requires: php-xml
Requires: php-xmlreader
Requires: php-zip
Requires: php-zlib
# Unbundled libraries
Requires: php-phpmailer6
Requires: httpd
# Unbundled
Requires: ca-certificates
# Bundled
# grep "SIMPLEPIE_VERSION'" wordpress/wp-includes/class-simplepie.php
Provides: bundled(php-simplepie) = 1.5.6
# grep ' VERSION ' wordpress/wp-includes/ID3/getid3.php
Provides: bundled(php-getid3) = 1.9.20
# grep ' VERSION ' wordpress/wp-includes/PHPMailer/PHPMailer.php
Provides: bundled(php-phpmailer) = 6.5.0
Provides: wordpress-mu = %{version}-%{release}
Obsoletes: wordpress-mu < 2.9.3
%description
Wordpress is an online publishing / weblog package that makes it very easy,
almost trivial, to get information out to people on the web.
@ -182,6 +187,11 @@ sed -e 's/\r//' wp-config-sample.php >wp-config.php
# fix file encoding
sed -i -e 's/\r//' license.txt
: Bundled library versions
grep "SIMPLEPIE_VERSION'" wp-includes/class-simplepie.php
grep ' VERSION ' wp-includes/ID3/getid3.php
grep ' VERSION ' wp-includes/PHPMailer/PHPMailer.php
%build
@ -212,20 +222,6 @@ find ${RPM_BUILD_ROOT} -type f -empty -exec rm -vf {} \;
# These are docs, remove them from here, docify them later
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 -r ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/SimplePie
ln -s /usr/share/php/php-simplepie/autoloader.php \
${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/class-simplepie.php
# Remove bundled PHPMailer and link to system one
rm -r ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/PHPMailer
ln -s /usr/share/php/PHPMailer/PHPMailer6 \
${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/PHPMailer
# Remove bundled php-getid3
rm -r ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/ID3
# Remove bundled ca-bundle.crt
rm ${RPM_BUILD_ROOT}%{_datadir}/wordpress/wp-includes/certificates/ca-bundle.crt
ln -s %{_sysconfdir}/pki/tls/certs/ca-bundle.crt \
@ -235,18 +231,14 @@ ln -s %{_sysconfdir}/pki/tls/certs/ca-bundle.crt \
find ${RPM_BUILD_ROOT} \( -name \*.dolly -o -name \*.rhbz522897 -o -name \*.orig \) \
-print -delete
## Move wp-content directory to /var/www location
#mkdir -p ${RPM_BUILD_ROOT}%%{_localstatedir}/www/wordpress
#mv -v ${RPM_BUILD_ROOT}%%{wp_content}/ \
# ${RPM_BUILD_ROOT}%%{_localstatedir}/www/wordpress
#%%post
#if [ $1 -eq 2 ] ; then
## In case user has old wp-content from previous version, move it to
## the new location.
#mv -uf %%{wp_content}/* %%{_localstatedir}/www/wordpress/
#/sbin/restorecon -R %%{_localstatedir}/www/wordpress/
#fi
%pretrans -p <lua>
-- Remove link to system library
path = "%{_datadir}/wordpress/wp-includes/PHPMailer"
st = posix.stat(path)
if st and st.type == "link" then
os.remove(path)
end
%files
@ -278,6 +270,9 @@ find ${RPM_BUILD_ROOT} \( -name \*.dolly -o -name \*.rhbz522897 -o -name \*.orig
%changelog
* Tue Dec 7 2021 Remi Collet <remi@remirepo.net> - 5.8.2-2
- use bundled libraries
* Thu Nov 11 2021 Remi Collet <remi@remirepo.net> - 5.8.2-1
- WordPress 5.8.2 Security and Maintenance Release