From 901285c50c6a7a062ba9835cbdf5eebc7ab3ab47 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 1 Oct 2019 14:42:51 +0200 Subject: - add patch for PHP 7.4 from https://github.com/horde/Crypt_Blowfish/pull/1 - use range dependencies --- 1.patch | 22 +++++++++++++++++++++ php-horde-Horde-Crypt-Blowfish.spec | 38 +++++++++++++++++++++++++------------ 2 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 1.patch diff --git a/1.patch b/1.patch new file mode 100644 index 0000000..bd2e053 --- /dev/null +++ b/1.patch @@ -0,0 +1,22 @@ +From 4b21f784621330b924f8a4693b7509047339fd30 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 1 Oct 2019 14:33:07 +0200 +Subject: [PATCH] Fix curly braces is deprecated + +--- + lib/Horde/Crypt/Blowfish/Php/Base.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/Horde/Crypt/Blowfish/Php/Base.php b/lib/Horde/Crypt/Blowfish/Php/Base.php +index 1e212bf..3ee9235 100644 +--- a/lib/Horde/Crypt/Blowfish/Php/Base.php ++++ b/lib/Horde/Crypt/Blowfish/Php/Base.php +@@ -328,7 +328,7 @@ public function __construct($key) + for ($i = 0; $i < 18; ++$i) { + $data = 0; + for ($j = 4; $j > 0; --$j) { +- $data = $data << 8 | ord($key{$k}); ++ $data = $data << 8 | ord($key[$k]); + $k = ($k + 1) % $len; + } + $this->_P[$i] ^= $data; diff --git a/php-horde-Horde-Crypt-Blowfish.spec b/php-horde-Horde-Crypt-Blowfish.spec index 65a428e..2d16e64 100644 --- a/php-horde-Horde-Crypt-Blowfish.spec +++ b/php-horde-Horde-Crypt-Blowfish.spec @@ -1,6 +1,6 @@ # remirepo/fedora spec file for php-horde-Horde-Crypt-Blowfish # -# Copyright (c) 2013-2017 Remi Collet +# Copyright (c) 2013-2019 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -12,21 +12,26 @@ Name: php-horde-Horde-Crypt-Blowfish Version: 1.1.2 -Release: 4%{?dist} +Release: 9%{?dist} Summary: Blowfish Encryption Library -Group: Development/Libraries License: LGPLv2 URL: http://pear.horde.org Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz +Patch0: https://patch-diff.githubusercontent.com/raw/horde/Crypt_Blowfish/pull/1.patch + BuildArch: noarch BuildRequires: php(language) >= 5.3.0 BuildRequires: php-pear(PEAR) >= 1.7.0 BuildRequires: php-hash BuildRequires: php-channel(%{pear_channel}) # To run unit tests -BuildRequires: php-pear(%{pear_channel}/Horde_Test) >= 2.1.0 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-pear(%{pear_channel}/Horde_Test) >= 2.1.0 with php-pear(%{pear_channel}/Horde_Test) < 3) +%else +BuildRequires: php-pear(%{pear_channel}/Horde_Test) >= 2.1.0 +%endif Requires(post): %{__pear} Requires(postun): %{__pear} @@ -35,12 +40,15 @@ Requires: php-hash Requires: php-openssl Requires: php-channel(%{pear_channel}) Requires: php-pear(PEAR) >= 1.7.0 -Requires: php-pear(%{pear_channel}/Horde_Exception) >= 2.0.0 -Requires: php-pear(%{pear_channel}/Horde_Exception) < 3.0.0 -Requires: php-pear(%{pear_channel}/Horde_Support) >= 2.0.0 -Requires: php-pear(%{pear_channel}/Horde_Support) < 3.0.0 -%if 0%{?fedora} >= 21 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-pear(%{pear_channel}/Horde_Exception) >= 2.0.0 with php-pear(%{pear_channel}/Horde_Exception) < 3) +Requires: (php-pear(%{pear_channel}/Horde_Support) >= 2.0.0 with php-pear(%{pear_channel}/Horde_Support) < 3) Suggests: php-mcrypt +%else +Requires: php-pear(%{pear_channel}/Horde_Exception) < 3.0.0 +Requires: php-pear(%{pear_channel}/Horde_Exception) >= 2.0.0 +Requires: php-pear(%{pear_channel}/Horde_Support) < 3.0.0 +Requires: php-pear(%{pear_channel}/Horde_Support) >= 2.0.0 %endif Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version} @@ -52,9 +60,10 @@ Provides blowfish encryption/decryption for PHP string data. %prep %setup -q -c - cd %{pear_name}-%{version} -cp ../package.xml %{name}.xml +%patch0 -p1 + +sed -e 's/md5sum="[^"]*"//' ../package.xml >%{name}.xml %build @@ -78,7 +87,7 @@ install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir} cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g) ret=0 -for cmd in php php56 php70 php71 php72; do +for cmd in php php56 php70 php71 php72 php73 php74; do if which $cmd; then $cmd %{_bindir}/phpunit --verbose . || ret=1 fi @@ -108,6 +117,11 @@ fi %changelog +* Tue Oct 1 2019 Remi Collet - 1.1.2-9 +- add patch for PHP 7.4 from + https://github.com/horde/Crypt_Blowfish/pull/1 +- use range dependencies + * Tue Oct 3 2017 Remi Collet - 1.1.2-4 - php-mcrypt is optional -- cgit