summaryrefslogtreecommitdiffstats
path: root/php-tecnickcom-tc-lib-barcode.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-12-21 10:52:23 +0100
committerRemi Collet <remi@remirepo.net>2020-12-21 10:52:23 +0100
commit0a9233865866c0a0e6b655d5f6a041aa8ce5c6ed (patch)
tree8376fbe568d8894f6a2e619d43b1f337d79ee71f /php-tecnickcom-tc-lib-barcode.spec
parente57907e8d3eead74824b9fc0a672ac0a6a5588c0 (diff)
update to 1.17.1
switch to classmap autoloader
Diffstat (limited to 'php-tecnickcom-tc-lib-barcode.spec')
-rw-r--r--php-tecnickcom-tc-lib-barcode.spec50
1 files changed, 32 insertions, 18 deletions
diff --git a/php-tecnickcom-tc-lib-barcode.spec b/php-tecnickcom-tc-lib-barcode.spec
index 726babc..362498f 100644
--- a/php-tecnickcom-tc-lib-barcode.spec
+++ b/php-tecnickcom-tc-lib-barcode.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit ce05b56aba72be67df862e397189d29b151801ce
+%global gh_commit cd555b642ce04de1b0ffbe6aff322df914e74ef0
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global c_vendor tecnickcom
%global gh_owner tecnickcom
@@ -15,7 +15,7 @@
%bcond_without tests
Name: php-%{gh_owner}-%{gh_project}
-Version: 1.16.1
+Version: 1.17.1
Release: 1%{?dist}
Summary: PHP library to generate linear and bidimensional barcodes
@@ -26,14 +26,19 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
BuildArch: noarch
%if %{with tests}
# For tests
-%global phpunit %{_bindir}/phpunit7
-BuildRequires: %{phpunit}
+%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9
+%global phpunit %{_bindir}/phpunit9
+BuildRequires: phpunit9 >= 9.5.0
+%else
+%global phpunit %{_bindir}/phpunit8
+BuildRequires: phpunit8 >= 8.5.13
+%endif
BuildRequires: php(language) >= 5.4
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-composer(%{c_vendor}/tc-lib-color) >= 1.12.13 with php-composer(%{c_vendor}/tc-lib-color) < 2)
+BuildRequires: (php-composer(%{c_vendor}/tc-lib-color) >= 1.14 with php-composer(%{c_vendor}/tc-lib-color) < 2)
%else
-BuildRequires: php-composer(%{c_vendor}/tc-lib-color) < 2
-BuildRequires: php-composer(%{c_vendor}/tc-lib-color) >= 1.12.13
+BuildRequires: php-%{c_vendor}-tc-lib-color < 2
+BuildRequires: php-%{c_vendor}-tc-lib-color >= 1.14
%endif
BuildRequires: php-bcmath
BuildRequires: php-ctype
@@ -43,6 +48,7 @@ BuildRequires: php-pcre
# Optional but required for test
BuildRequires: php-pecl-imagick
%endif
+BuildRequires: php-fedora-autoloader-devel
# From composer.json, "require": {
# "php": ">=5.4"
@@ -58,13 +64,14 @@ Requires: php-date
Requires: php-gd
Requires: php-pcre
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-composer(%{c_vendor}/tc-lib-color) >= 1.12.13 with php-composer(%{c_vendor}/tc-lib-color) < 2)
+Requires: (php-composer(%{c_vendor}/tc-lib-color) >= 1.14 with php-composer(%{c_vendor}/tc-lib-color) < 2)
%else
-Requires: php-composer(%{c_vendor}/tc-lib-color) < 2
-Requires: php-composer(%{c_vendor}/tc-lib-color) >= 1.12.13
+Requires: php-%{c_vendor}-tc-lib-color < 2
+Requires: php-%{c_vendor}-tc-lib-color >= 1.14
%endif
# From phpcompatinfo report for version 1.15.5
# none
+Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{c_vendor}/%{gh_project}) = %{version}
@@ -98,31 +105,34 @@ sed -e 's:^require:////require:' \
%build
-# Empty build section, most likely nothing required.
+phpab --template fedora --output src/autoload.php src
+cat << 'EOF' | tee -a src/autoload.php
+\Fedora\Autoloader\Dependencies::required([
+ '%{_datadir}/php/Com/Tecnick/Color/autoload.php',
+]);
+
+EOF
%install
mkdir -p $(dirname %{buildroot}%{php_project})
cp -pr src %{buildroot}%{php_project}
-cp -p resources/autoload.php \
- %{buildroot}%{php_project}/autoload.php
%check
%if %{with tests}
mkdir vendor
-cat <<EOF | tee vendor/autoload.php
+cat << 'EOF' | tee vendor/autoload.php
<?php
require '%{buildroot}%{php_project}/autoload.php';
-require '%{php_project}/../Color/autoload.php';
-require __DIR__ . '/../test/TestStrings.php';
+\Fedora\Autoloader\Autoload::addPsr4('Test\\', dirname(__DIR__) . '/test');
EOF
ret=0
-for cmdarg in "php %{phpunit}" php72 php73 php74 php80; do
+for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do
if which $cmdarg; then
set $cmdarg
- $1 ${2:-%{_bindir}/phpunit7} --no-coverage --verbose || ret=1
+ $1 ${2:-%{_bindir}/phpunit9} --no-coverage --verbose || ret=1
fi
done
exit $ret
@@ -140,6 +150,10 @@ exit $ret
%changelog
+* Mon Dec 21 2020 Remi Collet <remi@remirepo.net> - 1.17.1-1
+- update to 1.17.1
+- switch to classmap autoloader
+
* Tue Jul 14 2020 Remi Collet <remi@remirepo.net> - 1.16.1-1
- update to 1.16.1