Accepting request 754999 from home:adkorte

- Apply upstream patch for https://bugs.php.net/78890
  + pear-cacheid-array-check.patch
- Recommend php7-openssl to allow https sources to be used
- Modify metadata_dir for system configuration only
- Add /var/lib/pear directory where xml files are stored
- Cleanup %files section

OBS-URL: https://build.opensuse.org/request/show/754999
OBS-URL: https://build.opensuse.org/package/show/devel:languages:php/php7-pear?expand=0&rev=15
This commit is contained in:
Arjen de Korte 2019-12-07 23:05:20 +00:00 committed by Git OBS Bridge
parent 35d55c046c
commit 086bc75037
4 changed files with 41 additions and 12 deletions

View File

@ -0,0 +1,11 @@
--- a/PEAR/REST.php
+++ b/PEAR/REST.php
@@ -178,7 +178,7 @@
$cachettl = $this->config->get('cache_ttl');
// If cache is newer than $cachettl seconds, we use the cache!
- if (time() - $cacheid['age'] < $cachettl) {
+ if (is_array($cacheid) && time() - $cacheid['age'] < $cachettl) {
return $this->getCache($url);
}

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Sat Dec 7 22:57:56 UTC 2019 - Arjen de Korte <suse+build@de-korte.org>
- Apply upstream patch for https://bugs.php.net/78890
+ pear-cacheid-array-check.patch
- Recommend php7-openssl to allow https sources to be used
- Modify metadata_dir for system configuration only
- Add /var/lib/pear directory where xml files are stored
- Cleanup %files section
-------------------------------------------------------------------
Tue Nov 26 20:22:08 UTC 2019 - Arjen de Korte <suse+build@de-korte.org>

View File

@ -1,4 +1,5 @@
# Channel files in metadata_dir
addFilter("hidden-file-or-dir /var/lib/pear/.")
addFilter("zero-length /var/lib/pear/.")
# Forgot to add category?
addFilter("non-standard-group Development/Libraries/PHP")

View File

@ -32,15 +32,17 @@ Source0: https://github.com/pear/pearweb_phars/raw/v%{version}/install-pe
Source1: https://github.com/pear/pearweb_phars/raw/v%{version}/install-pear-nozlib.sig#/install-pear-nozlib.phar.sig
Source2: %{name}.keyring
Source3: %{name}.rpmlintrc
# PATCH-FIX-UPSTREAM https://bugs.php.net/78890
Patch0: pear-cacheid-array-check.patch
BuildRequires: php7
BuildRequires: php7-phar
Requires: php7
Recommends: php7-openssl
Provides: php-pear = %{version}
Provides: php-pear(Archive_Tar) = %pear_module_version Archive_Tar
Provides: php-pear(Console_Getopt) = %pear_module_version Console_Getopt
Provides: php-pear(PEAR) = %pear_module_version PEAR
Provides: php-pear(Structures_Graph) = %pear_module_version Structures_Graph
Provides: php-pear(XML_Util) = %pear_module_version XML_Util
Provides: php-pear = %{version}
Obsoletes: php-pear < %{version}
BuildArch: noarch
@ -53,11 +55,12 @@ See https://pear.php.net/manual for more details.
%package -n php7-pecl
Summary: PHP Extension Community Library
Group: Development/Libraries/PHP
Requires: autoconf
Requires: automake
Requires: gcc-c++
Requires: libtool
Requires: php-pear = %{version}
Requires: php7-pear = %{version}
Provides: php-pecl = %{version}
Obsoletes: php-pecl < %{version}
Conflicts: php7-devel < 7.4
@ -77,11 +80,13 @@ See https://pecl.php.net for more details.
# Empty build section, nothing to build
%install
export PHP_PEAR_INSTALL_DIR=%{peardir}
export PHP_PEAR_METADATA_DIR=%{metadir}
export PHP_PEAR_SIG_BIN=%{_bindir}/gpg
export PHP_PEAR_SYSCONF_DIR=%{_sysconfdir}/php7/cli
export INSTALL_ROOT=%{buildroot}
install -d %{buildroot}%{_localstatedir}/cache/pear
install -d %{buildroot}%{_localstatedir}/{cache,lib}/pear
php -d date.timezone=UTC -d memory_limit=64M -d short_open_tag=0 -d safe_mode=0 \
-d 'error_reporting=E_ALL&~E_DEPRECATED' -d detect_unicode=0 %{SOURCE0} \
@ -93,7 +98,9 @@ php -d date.timezone=UTC -d memory_limit=64M -d short_open_tag=0 -d safe_mode=0
--metadata %{metadir} \
--www %{peardir}/htdocs
rm -rf %{buildroot}/{.depdb,.depdblock}
pushd %{buildroot}%{peardir}
patch -p1 < %{PATCH0}
popd
%pre
if [ -d %{peardir}/.registry -a ! -d %{metadir}/.registry ]; then
@ -105,22 +112,22 @@ fi
mdir=$(%{_bindir}/pear config-get metadata_dir system)
if [ "${mdir}" != "%{metadir}" -a -d %{metadir}/.registry ]; then
%{_bindir}/pear config-set metadata_dir %{metadir} system
%{_bindir}/pear config-set metadata_dir %{metadir}
rm -rf %{peardir}/{.channels,.registry}
fi
%files
%{_bindir}/pear
%config(noreplace) %{_sysconfdir}/php7/cli/pear.conf
%dir %{peardir}
%{peardir}/*
%dir %{metadir}
%ghost %{metadir}/{.depdblock,.lock}
%{metadir}/.??*
%dir %{_localstatedir}/cache/pear
%dir %{_localstatedir}/lib/pear
%dir %{peardir}
%docdir %{peardir}/doc
%{peardir}/*
%{metadir}/.??*
%exclude %{_bindir}/peardev
%exclude %{peardir}/doc/PEAR/INSTALL
%exclude %{peardir}/test
%files -n php7-pecl
%{_bindir}/pecl