diff options
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | composer.json | 34 | ||||
-rw-r--r-- | php-evenement.spec | 52 |
3 files changed, 72 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc9aa8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..88849a8 --- /dev/null +++ b/composer.json @@ -0,0 +1,34 @@ +{ + "name": "evenement/evenement", + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": ["event-dispatcher", "event-emitter"], + "license": "MIT", + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0||^5.7||^4.8.35" + }, + "autoload": { + "psr-0": { + "Evenement": "src" + } + }, + "autoload-dev": { + "psr-0": { + "Evenement": "tests" + }, + "files": ["tests/Evenement/Tests/functions.php"] + }, + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + } +} 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 |