summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore9
-rw-r--r--composer.json48
-rwxr-xr-xmakesrc.sh28
-rw-r--r--php-nrk-Predis.spec180
4 files changed, 182 insertions, 83 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..01f0400
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+clog
+package-*.xml
+*.tgz
+*.tar.bz2
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..bde0b54
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,48 @@
+{
+ "name": "predis/predis",
+ "type": "library",
+ "description": "Flexible and feature-complete Redis client for PHP and HHVM",
+ "keywords": ["nosql", "redis", "predis"],
+ "homepage": "http://github.com/predis/predis",
+ "license": "MIT",
+ "support": {
+ "issues": "https://github.com/predis/predis/issues"
+ },
+ "authors": [
+ {
+ "name": "Daniele Alessandri",
+ "email": "suppakilla@gmail.com",
+ "homepage": "http://clorophilla.net",
+ "role": "Creator & Maintainer"
+ },
+ {
+ "name": "Till Krüss",
+ "homepage": "https://till.im",
+ "role": "Maintainer"
+ }
+ ],
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/tillkruss"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.9"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8"
+ },
+ "suggest": {
+ "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol",
+ "ext-curl": "Allows access to Webdis when paired with phpiredis"
+ },
+ "autoload": {
+ "psr-4": {
+ "Predis\\": "src/"
+ }
+ },
+ "scripts": {
+ "post-update-cmd": "@php -f tests/apply-patches.php"
+ }
+}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..4190c13
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+NAME=$(basename $PWD)
+OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec)
+PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec)
+VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec)
+COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec)
+SHORT=${COMMIT:0:7}
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
+
+echo "Cloning..."
+rm -rf $PROJECT-$COMMIT
+git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
+
+echo "Getting commit..."
+pushd $PROJECT-$COMMIT
+git checkout $COMMIT
+cp composer.json ../composer.json
+popd
+
+echo "Archiving..."
+tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs --exclude tools $PROJECT-$COMMIT
+
+echo "Cleaning..."
+rm -rf $PROJECT-$COMMIT
+
+echo "Done."
diff --git a/php-nrk-Predis.spec b/php-nrk-Predis.spec
index 3882fb7..c81c85a 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-2022 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 a2fb02d738bedadcffdbb07efa3a5e7bd57f8d6e
+%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.10
+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}/.??*
+mkdir -p %{buildroot}%{_datadir}/php/
+cp -pr src %{buildroot}%{_datadir}/php/%{ns_project}
-# Install XML package description
-mkdir -p %{buildroot}%{pear_xmldir}
-install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
-
-# 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
+
+# testHandlesBinaryData failing with 8.1
+# see https://github.com/predis/predis/issues/733
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 '^((?!(testHandlesBinaryData)).)*$' \
--verbose || ret=1
-# remirepo:1
-fi
-popd
: Cleanup
if [ -f $pidfile ]; then
@@ -137,30 +116,65 @@ 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
+* Thu Jan 6 2022 Remi Collet <remi@remirepo.net> - 1.1.10-1
+- update to 1.1.10
+
+* Wed Oct 6 2021 Remi Collet <remi@remirepo.net> - 1.1.9-1
+- update to 1.1.9
+
+* Thu Sep 30 2021 Remi Collet <remi@remirepo.net> - 1.1.8-1
+- update to 1.1.8
+
+* Tue Apr 6 2021 Remi Collet <remi@remirepo.net> - 1.1.7-1
+- update to 1.1.7
+- drop patch merged upstream
+
+* Thu Mar 18 2021 Remi Collet <remi@remirepo.net> - 1.1.6-3
+- fix test failure with redis 6.2 using patch from
+ https://github.com/predis/predis/pull/686
+
+* Sat Sep 12 2020 Remi Collet <remi@remirepo.net> - 1.1.6-1
+- update to 1.1.6
+
+* Fri Sep 11 2020 Remi Collet <remi@remirepo.net> - 1.1.5-1
+- update to 1.1.5
+
+* Mon Aug 31 2020 Remi Collet <remi@remirepo.net> - 1.1.4-1
+- update to 1.1.4
+
+* Wed Aug 19 2020 Remi Collet <remi@remirepo.net> - 1.1.3-1
+- update to 1.1.3 (no change)
+
+* 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