summaryrefslogtreecommitdiffstats
path: root/php-nrk-Predis.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-08-12 12:17:01 +0200
committerRemi Collet <remi@remirepo.net>2020-08-12 12:17:01 +0200
commitfd9cf3570d420926315b86a1fd5226b288b8c695 (patch)
tree103041ffed3576b116e9c5c2736bc2594f56b990 /php-nrk-Predis.spec
parente808e6064deae4fd924113a83ce544e63b61b713 (diff)
update to 1.1.2
sources from git snapshot obsolete php-channel-nrk drop dependency on pear move to /usr/share/php with autoloader link for BC
Diffstat (limited to 'php-nrk-Predis.spec')
-rw-r--r--php-nrk-Predis.spec152
1 files changed, 68 insertions, 84 deletions
diff --git a/php-nrk-Predis.spec b/php-nrk-Predis.spec
index 3882fb7..6dd4f17 100644
--- a/php-nrk-Predis.spec
+++ b/php-nrk-Predis.spec
@@ -1,100 +1,88 @@
# remirepo/fedora spec file for php-nrk-Predis
#
-# Copyright (c) 2013-2017 Remi Collet
+# Copyright (c) 2013-2020 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%{!?__pear: %global __pear %{_bindir}/pear}
-%global pear_name Predis
-%global pear_channel pear.nrk.io
-%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7
-%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
+%if 0%{?fedora} >= 31 || 0%{?rhel} >= 8
+%bcond_without tests
%else
-%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
+%bcond_with tests
%endif
+%global gh_owner nrk
+%global gh_project predis
+%global gh_commit 82eb18c6c3860849cb6e2ff34b0c4b39d5daee46
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+
+%global ns_project Predis
+
+%global pear_name Predis
+%global pear_channel pear.nrk.io
+
Name: php-nrk-Predis
-Version: 1.1.1
-Release: 2%{?dist}
+Version: 1.1.2
+Release: 1%{?dist}
Summary: PHP client library for Redis
-Group: Development/Libraries
License: MIT
-URL: http://%{pear_channel}
-Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
+URL: https://github.com/%{gh_owner}/%{gh_project}
+Source0: %{name}-%{version}-%{gh_short}.tgz
+Source1: makesrc.sh
-# https://github.com/nrk/predis/pull/393
-Patch0: %{name}-pr393.patch
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php(language) >= 5.3.9
-BuildRequires: php-pear(PEAR)
-BuildRequires: php-channel(%{pear_channel})
-%if %{with_tests}
+%if %{with tests}
BuildRequires: php-phpunit-PHPUnit
-BuildRequires: redis > 2.8
+BuildRequires: redis
%endif
-Requires(post): %{__pear}
-Requires(postun): %{__pear}
Requires: php(language) >= 5.3.9
Requires: php-reflection
-Requires: php-curl
Requires: php-filter
Requires: php-pcre
Requires: php-session
Requires: php-sockets
Requires: php-spl
-Requires: php-pear(PEAR)
-Requires: php-channel(%{pear_channel})
+%if 0%{?fedora} >= 30 || 0%{?rhel} >=8
+Recommends: php-curl
+Recommends: php-phpiredis
+%endif
Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
Provides: php-composer(predis/predis) = %{version}
+# This pkg was the only one in this channel so the channel is no longer needed
+Obsoletes: php-channel-nrk < 1.4
+
%description
Flexible and feature-complete PHP client library for Redis.
%prep
-%setup -q -c
-
-cd %{pear_name}-%{version}
-%patch0 -p1
-sed -e '/test/s/md5sum="[^"]*"//' ../package.xml >%{name}.xml
+%setup -q -n %{gh_project}-%{gh_commit}
%build
-cd %{pear_name}-%{version}
-# Empty build section, most likely nothing required.
-
+: nothing
%install
-rm -rf %{buildroot}
-cd %{pear_name}-%{version}
-%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
-
-# Clean up unnecessary files
-rm -rf %{buildroot}%{pear_metadir}/.??*
-
-# Install XML package description
-mkdir -p %{buildroot}%{pear_xmldir}
-install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
+mkdir -p %{buildroot}%{_datadir}/php/
+cp -pr src %{buildroot}%{_datadir}/php/%{ns_project}
-# Relocate PATH so test suite can be run from install dir
-sed -e 's:tests/::' \
- %{buildroot}%{pear_testdir}/%{pear_name}/phpunit.xml.dist \
- > %{buildroot}%{pear_testdir}/%{pear_name}/phpunit.xml
+# for compatibility with PEAR installation
+mkdir -p %{buildroot}%{_datadir}/pear/%{ns_project}
+ln -s ../../php/Predis/Autoloader.php %{buildroot}%{_datadir}/pear/%{ns_project}/Autoloader.php
%check
-%if %{with_tests}
+%if %{with tests}
: Launch redis server
-port=6379
+port=$(expr 6379 + %{?fedora}%{?rhel})
pidfile=$PWD/redis.pid
mkdir -p data
redis-server \
@@ -106,25 +94,16 @@ redis-server \
--pidfile $pidfile
: Run the installed test Suite against the installed library
-pushd %{buildroot}%{pear_testdir}/%{pear_name}
+sed -e "s/6379/$port/" phpunit.xml.dist > phpunit.xml
+sed -e "/expectedExceptionMessageRegExp/s/6379/$port/" -i tests/PHPUnit/PredisConnectionTestCase.php
+
+# testReturnsCommandInfoOnExistingCommand failing on recent Redis version
+
ret=0
-# remirepo:10
-run=0
-if which php71; then
- php71 %{_bindir}/phpunit --include-path=%{buildroot}%{pear_phpdir} || ret=1
- run=1
-fi
-if which php56; then
- php56 %{_bindir}/phpunit --include-path=%{buildroot}%{pear_phpdir} || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit \
- --include-path=%{buildroot}%{pear_phpdir} \
+php -d memory_limit=1G %{_bindir}/phpunit \
+ --include-path=%{buildroot}%{_datadir}/pear \
+ --filter '^((?!(testReturnsCommandInfoOnExistingCommand)).)*$' \
--verbose || ret=1
-# remirepo:1
-fi
-popd
: Cleanup
if [ -f $pidfile ]; then
@@ -137,30 +116,35 @@ exit $ret
%endif
-%clean
-rm -rf %{buildroot}
-
-
-%post
-%{__pear} install --nodeps --soft --force --register-only \
- %{pear_xmldir}/%{name}.xml >/dev/null || :
-
-%postun
-if [ $1 -eq 0 ] ; then
- %{__pear} uninstall --nodeps --ignore-errors --register-only \
- %{pear_channel}/%{pear_name} >/dev/null || :
+%pre
+if [ -x %{_bindir}/pear ]; then
+ %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
+ %{pear_channel}/%{pear_name} >/dev/null || :
fi
%files
-%defattr(-,root,root,-)
-%doc %{pear_docdir}/%{pear_name}
-%{pear_xmldir}/%{name}.xml
-%{pear_phpdir}/%{pear_name}
-%{pear_testdir}/%{pear_name}
-
+# remirepo:1
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc composer.json
+%doc *md
+%doc examples
+%{_datadir}/php/%{ns_project}
+%{_datadir}/pear/%{ns_project}
%changelog
+* Wed Aug 12 2020 Remi Collet <remi@remirepo.net> - 1.1.2-1
+- update to 1.1.2
+- sources from git snapshot
+- obsolete php-channel-nrk
+- drop dependency on pear
+- move to /usr/share/php with autoloader link for BC
+
+* Tue Feb 13 2018 Remi Collet <remi@remirepo.net> - 1.1.1-5
+- fix FTBFS from Koschei with patch from
+ https://github.com/nrk/predis/pull/486
+
* Thu Nov 17 2016 Remi Collet <remi@fedoraproject.org> - 1.1.1-2
- fix bootstraping to redis server for test suite
- add patch for PHP 7.1