summaryrefslogtreecommitdiffstats
path: root/php-gettext-gettext.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-gettext-gettext.spec')
-rw-r--r--php-gettext-gettext.spec38
1 files changed, 30 insertions, 8 deletions
diff --git a/php-gettext-gettext.spec b/php-gettext-gettext.spec
index 44729fa..c1777c2 100644
--- a/php-gettext-gettext.spec
+++ b/php-gettext-gettext.spec
@@ -14,7 +14,7 @@
Name: php-gettext-gettext
Version: 4.7.0
-Release: 1%{?dist}
+Release: 2%{?dist}
BuildArch: noarch
License: MIT
@@ -25,10 +25,14 @@ Source0: %{url}/archive/v%{version}.tar.gz
# dltests.sh is used to do this, and is included in this repository.
Source1: tests-v%{version}.tar.bz2
+Patch0: https://patch-diff.githubusercontent.com/raw/oscarotero/Gettext/pull/230.patch
+
BuildRequires: dos2unix
-#BuildRequires: php-composer(gettext/languages) >= 2.3.0
-#BuildRequires: php-composer(gettext/languages) < 3.0.0
-BuildRequires: php-gettext-languages
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(gettext/languages) >= 2.3.0 with php-composer(gettext/languages) < 3)
+%else
+BuildRequires: php-gettext-languages >= 2.3.0
+%endif
BuildRequires: phpunit
Requires: php(language) >= 5.4.0
@@ -41,8 +45,11 @@ Requires: php-simplexml
Requires: php-spl
Requires: php-tokenizer
-Requires: php-composer(gettext/languages) >= 2.3.0
-Requires: php-composer(gettext/languages) < 3.0.0
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(gettext/languages) >= 2.3.0 with php-composer(gettext/languages) < 3)
+%else
+Requires: php-gettext-languages >= 2.3.0
+%endif
Provides: php-composer(gettext/gettext) = %{version}
@@ -55,7 +62,8 @@ Autoloader: %{_datadir}/php/Gettext/autoload.php
%prep
-%autosetup -p1 -a1 -n Gettext-%{version}
+%setup -a1 -n Gettext-%{version}
+%patch0 -p1
# The documentation has the wrong newline codes
dos2unix *.md
@@ -94,7 +102,15 @@ sed -i "s:include_once.*:\ninclude_once '%{buildroot}/%{_datadir}/php/Gettext/au
# if desired). Thus, we need to skip the tests on these integration points since they will fail
# without the dependencies. There is an upstream issue about compatibility issues with Twig:
# https://github.com/oscarotero/Gettext/issues/137
-phpunit --bootstrap tests/bootstrap.php --filter ^\(\(?!\(testBlade\|testTwig\)\).\)*$ tests
+
+: run upstream test suite with all installed PHP versions
+ret=0
+for cmd in php php71 php72 php73 php74; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit --bootstrap tests/bootstrap.php --filter ^\(\(?!\(testBlade\|testTwig\)\).\)*$ tests
+ fi
+done
+exit $ret
%files
@@ -108,6 +124,12 @@ phpunit --bootstrap tests/bootstrap.php --filter ^\(\(?!\(testBlade\|testTwig\)\
%changelog
+* Thu Oct 10 2019 Remi Collet <remi@remirepo.net> - 4.7.0-2
+- update to 4.7.0
+- use range dependencies
+- add patch for PHP 7.4 from
+ https://github.com/oscarotero/Gettext/pull/230
+
* Thu Oct 10 2019 Sundeep Anand <suanand@fedoraproject.org> - 4.7.0-1
- Update to 4.7.0 (#1759099).
- https://github.com/oscarotero/Gettext/blob/v4.7.0/CHANGELOG.md