summaryrefslogtreecommitdiffstats
path: root/php-evenement.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-evenement.spec')
-rw-r--r--php-evenement.spec52
1 files changed, 30 insertions, 22 deletions
diff --git a/php-evenement.spec b/php-evenement.spec
index 10abc6c..1768bbc 100644
--- a/php-evenement.spec
+++ b/php-evenement.spec
@@ -8,23 +8,25 @@
# Please preserve changelog entries
#
Name: php-evenement
-Version: 2.0.0
-Release: 3%{?dist}
+Version: 2.1.0
+Release: 1%{?dist}
BuildArch: noarch
License: MIT
Summary: Événement is a very simple event dispatching library for PHP
URL: https://github.com/igorw/evenement
Source0: %{url}/archive/v%{version}.tar.gz
-# https://github.com/igorw/evenement/pull/33
-Patch0: 0000-Fix-a-test-to-catch-TypeError-instead-of-Exception.patch
-BuildRequires: phpunit
+BuildRequires: php-composer(phpunit/phpunit)
BuildRequires: php-composer(fedora/autoloader)
+# phpcompatinfo (computed from version 2.1.0)
+# <none>
Requires: php(language) >= 5.4.0
# This is for the autoloader
Requires: php-composer(fedora/autoloader)
+# phpcompatinfo (computed from version 2.1.0)
+# <none>
Provides: php-composer(evenement/evenement) = %{version}
@@ -37,14 +39,14 @@ while staying concise and simple.
It is very strongly inspired by the EventEmitter API found in node.js.
-Autoloader: %{_datadir}/php/Evenement/autoload.php
+Autoloader: %{_datadir}/php/Evenement/autoload.php
%prep
%setup -q -n evenement-%{version}
-%patch0 -p1
+%build
: Create autoloader
cat <<'AUTOLOAD' | tee src/Evenement/autoload.php
<?php
@@ -69,25 +71,26 @@ cp -a -r src/Evenement %{buildroot}/%{_datadir}/php/
cat <<'AUTOLOAD' | tee autoload.php
<?php
require_once '%{buildroot}%{_datadir}/php/Evenement/autoload.php';
+
\Fedora\Autoloader\Autoload::addPsr4('Evenement\\Tests\\', __DIR__.'/tests/Evenement/Tests');
+
+\Fedora\Autoloader\Dependencies::required([
+ __DIR__.'/tests/Evenement/Tests/functions.php'
+]);
AUTOLOAD
-# remirepo:11
-run=0
-ret=0
-if which php56; then
- php56 %{_bindir}/phpunit --bootstrap autoload.php || ret=1
- run=1
-fi
-if which php71; then
- php71 %{_bindir}/phpunit --bootstrap autoload.php || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
phpunit --bootstrap autoload.php
-# remirepo:2
-fi
-exit $ret
+
+: Upstream tests
+RETURN_CODE=0
+PHPUNIT=$(which phpunit)
+for PHP_EXEC in "" %{?rhel:php55} php56 php70 php71 php72; do
+ if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC $PHPUNIT --verbose --bootstrap autoload.php \
+ || RETURN_CODE=1
+ fi
+done
+exit $RETURN_CODE
%files
@@ -98,6 +101,11 @@ exit $ret
%changelog
+* Sun Sep 10 2017 Shawn Iwinski <shawn@iwin.ski> - 2.1.0-1
+- Update to 2.1.0
+- Remove now unneeded patch
+- Test with SCLs if available
+
* Tue Jan 24 2017 Remi Collet <remi@remirepo.net> - 2.0.0-3
- backport for remi repo