summaryrefslogtreecommitdiffstats
path: root/php-amqplib.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-amqplib.spec')
-rw-r--r--php-amqplib.spec71
1 files changed, 54 insertions, 17 deletions
diff --git a/php-amqplib.spec b/php-amqplib.spec
index 48f5f54..a3b8d3d 100644
--- a/php-amqplib.spec
+++ b/php-amqplib.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-amqplib
#
-# Copyright (c) 2017-2019 Shawn Iwinski <shawn@iwin.ski>
+# Copyright (c) 2017-2020 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,30 +12,40 @@
%global github_owner php-amqplib
%global github_name php-amqplib
-%global github_version 2.9.2
-%global github_commit 76faddcd668dabb8d4f7c00e86b8a9decd781a59
+%global github_version 2.12.0
+%global github_commit dfcccd36bf12b4c7cc3ec74d571e00e0f767232e
%global composer_vendor php-amqplib
%global composer_project php-amqplib
-# "php": ">=5.4.0"
-%global php_min_ver 5.4.0
+# "php": ">=5.6.3"
+%global php_min_ver 5.6.3
+# "phpseclib/phpseclib": "^2.0.0"
+%global phpseclib_min_ver 2.0
+%global phpseclib_max_ver 3.0
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
+# Range dependencies supported?
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+%global with_range_dependencies 1
+%else
+%global with_range_dependencies 0
+%endif
+
%{!?phpdir: %global phpdir %{_datadir}/php}
Name: %{composer_project}
Version: %{github_version}
-Release: 1%{?github_release}%{?dist}
+Release: 2%{?github_release}%{?dist}
Summary: Pure PHP implementation of the AMQP protocol
License: LGPLv2+
URL: https://github.com/%{github_owner}/%{github_name}
-# GitHub export does not include tests.
-# Run php-php-amqplib-php-amqplib-get-source.sh to create full source.
+# GitHub export does not include tests
+# Run php-php-amqplib-php-amqplib-get-source.sh to create full source
Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
Source1: %{name}-get-source.sh
@@ -44,13 +54,18 @@ BuildArch: noarch
%if %{with_tests}
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
-BuildRequires: php-composer(phpunit/phpunit)
-BuildRequires: php-bcmath
+BuildRequires: phpunit7
+BuildRequires: php-mbstring
BuildRequires: php-sockets
-## phpcompatinfo for version 2.9.2
+%if %{with_range_dependencies}
+BuildRequires: (php-composer(phpseclib/phpseclib) >= %{phpseclib_min_ver} with php-composer(phpseclib/phpseclib) < %{phpseclib_max_ver})
+%else
+BuildRequires: php-phpseclib >= %{phpseclib_min_ver}
+%endif
+## phpcompatinfo for version 2.12.0
BuildRequires: php-date
+BuildRequires: php-hash
BuildRequires: php-json
-BuildRequires: php-mbstring
BuildRequires: php-pcntl
BuildRequires: php-pcre
BuildRequires: php-reflection
@@ -61,11 +76,15 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
-Requires: php-bcmath
+%if %{with_range_dependencies}
+Requires: (php-composer(phpseclib/phpseclib) >= %{phpseclib_min_ver} with php-composer(phpseclib/phpseclib) < %{phpseclib_max_ver})
+%else
+Requires: php-phpseclib >= %{phpseclib_min_ver}
+%endif
+Requires: php-mbstring
Requires: php-sockets
-# phpcompatinfo for version 2.9.2
+# phpcompatinfo for version 2.12.0
Requires: php-date
-Requires: php-mbstring
Requires: php-pcntl
Requires: php-pcre
Requires: php-spl
@@ -77,6 +96,11 @@ Requires: php-composer(fedora/autoloader)
Suggests: php-pcntl
%endif
+# Conflicts
+## composer.json
+Conflicts: php(language) = 7.4.0
+Conflicts: php(language) = 7.4.1
+
# Standard "php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}" naming
Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release}
Provides: %{composer_vendor}-%{composer_project} = %{version}-%{release}
@@ -106,6 +130,10 @@ cat <<'AUTOLOAD' | tee PhpAmqpLib/autoload.php
*/
require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
+\Fedora\Autoloader\Dependencies::required([
+ '%{phpdir}/phpseclib/autoload.php',
+]);
+
\Fedora\Autoloader\Autoload::addPsr4('PhpAmqpLib\\', __DIR__);
AUTOLOAD
@@ -122,7 +150,10 @@ cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
date_default_timezone_set('UTC');
require '%{buildroot}%{phpdir}/PhpAmqpLib/autoload.php';
-require __DIR__.'/tests/config.php';
+
+\Fedora\Autoloader\Dependencies::required([
+ __DIR__.'/tests/config.php',
+]);
\Fedora\Autoloader\Autoload::addPsr4('PhpAmqpLib\\Tests\\Unit\\', __DIR__.'/tests/Unit');
BOOTSTRAP
@@ -132,7 +163,7 @@ rm -f tests/Unit/Wire/IO/SocketIOTest.php
: Upstream tests
RETURN_CODE=0
-PHPUNIT=$(which phpunit)
+PHPUNIT=$(which phpunit7)
for PHP_EXEC in php %{?rhel:php54 php55 php56 php70} php71 php72 php73 php74; do
if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
$PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \
@@ -154,6 +185,12 @@ exit $RETURN_CODE
%changelog
+* Sat Sep 05 2020 Shawn Iwinski <shawn@iwin.ski> - 2.12.0-2
+- Require phpseclib for runtime in additional to build require
+
+* Sat Sep 05 2020 Shawn Iwinski <shawn@iwin.ski> - 2.12.0-1
+- Update to 2.12.0 (RHBZ #1742616)
+
* Sun May 26 2019 Shawn Iwinski <shawn@iwin.ski> - 2.9.2-1
- Update to 2.9.2 (RHBZ #1535736)