From d012d4e1d0d9644762991ec1fa3d0034c5ead82a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 16 Dec 2019 15:22:04 +0100 Subject: v3.0.1 from Fedora --- ...t-to-catch-TypeError-instead-of-Exception.patch | 29 ------ composer.json | 9 +- php-evenement.spec | 100 ++++++++++++++------- 3 files changed, 69 insertions(+), 69 deletions(-) delete mode 100644 0000-Fix-a-test-to-catch-TypeError-instead-of-Exception.patch diff --git a/0000-Fix-a-test-to-catch-TypeError-instead-of-Exception.patch b/0000-Fix-a-test-to-catch-TypeError-instead-of-Exception.patch deleted file mode 100644 index 9c06cfa..0000000 --- a/0000-Fix-a-test-to-catch-TypeError-instead-of-Exception.patch +++ /dev/null @@ -1,29 +0,0 @@ -From ca430b3bff35f5fd7878a421b761fb6a7e408d75 Mon Sep 17 00:00:00 2001 -From: Randy Barlow -Date: Sat, 14 Jan 2017 23:55:50 -0500 -Subject: [PATCH] Fix a test to catch TypeError instead of Exception. - -In PHP 7, TypeError is no longer an Exception but is an Error -instead. This commit adjusts a test case to catch TypeError instead -of Exception. - -Signed-off-by: Randy Barlow ---- - tests/Evenement/Tests/EventEmitterTest.php | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tests/Evenement/Tests/EventEmitterTest.php b/tests/Evenement/Tests/EventEmitterTest.php -index 7eeaa3d..64c5ffc 100644 ---- a/tests/Evenement/Tests/EventEmitterTest.php -+++ b/tests/Evenement/Tests/EventEmitterTest.php -@@ -44,6 +44,7 @@ class EventEmitterTest extends \PHPUnit_Framework_TestCase - $this->emitter->on('foo', 'not a callable'); - $this->fail(); - } catch (\Exception $e) { -+ } catch (\TypeError $e) { - } - } - --- -2.11.0 - diff --git a/composer.json b/composer.json index 88849a8..cbb4827 100644 --- a/composer.json +++ b/composer.json @@ -10,10 +10,10 @@ } ], "require": { - "php": ">=5.4.0" + "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "^6.0||^5.7||^4.8.35" + "phpunit/phpunit": "^6.0" }, "autoload": { "psr-0": { @@ -25,10 +25,5 @@ "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 1768bbc..dc72f27 100644 --- a/php-evenement.spec +++ b/php-evenement.spec @@ -7,28 +7,55 @@ # # Please preserve changelog entries # -Name: php-evenement -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 - -BuildRequires: php-composer(phpunit/phpunit) +%global github_owner igorw +%global github_name evenement +%global github_version 3.0.1 +%global github_commit 531bfb9d15f8aa57454f5f0285b18bec903b8fb7 + +%global composer_vendor evenement +%global composer_project evenement + +# "php": ">=7.0" +%global php_min_ver 7.0 + +# Build using "--without tests" to disable tests +%global with_tests 0%{!?_without_tests:1} + +%{!?phpdir: %global phpdir %{_datadir}/php} + +Name: php-%{composer_project} +Epoch: 1 +Version: %{github_version} +Release: 1%{?github_release}%{?dist} + +License: MIT +Summary: Événement is a very simple event dispatching library for PHP +URL: https://github.com/%{github_owner}/%{github_name} +Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz + +BuildArch: noarch +# Tests +%if %{with_tests} +## composer.json +BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: phpunit6 +## phpcompatinfo (computed from version 3.0.1) +## +## Autoloader BuildRequires: php-composer(fedora/autoloader) -# phpcompatinfo (computed from version 2.1.0) -# +%endif -Requires: php(language) >= 5.4.0 -# This is for the autoloader -Requires: php-composer(fedora/autoloader) -# phpcompatinfo (computed from version 2.1.0) +# composer.json +Requires: php(language) >= %{php_min_ver} +# phpcompatinfo (computed from version 3.0.1) # +# Autoloader +Requires: php-composer(fedora/autoloader) -Provides: php-composer(evenement/evenement) = %{version} +# Standard "php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}" naming +Provides: php-%{composer_vendor}-%{composer_project} = %{epoch}:%{version}-%{release} +# Composer +Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} %description @@ -43,7 +70,7 @@ Autoloader: %{_datadir}/php/Evenement/autoload.php %prep -%setup -q -n evenement-%{version} +%setup -qn %{github_name}-%{github_commit} %build @@ -54,21 +81,21 @@ cat <<'AUTOLOAD' | tee src/Evenement/autoload.php * Autoloader for %{name} and its' dependencies * (created by %{name}-%{version}-%{release}). */ -require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php'; +require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('Evenement\\', __DIR__); AUTOLOAD %install -install -d -p -m 0755 %{buildroot}/%{_datadir}/php - -cp -a -r src/Evenement %{buildroot}/%{_datadir}/php/ +mkdir -p %{buildroot}%{phpdir} +cp -rp src/Evenement %{buildroot}%{phpdir}/ %check -: Create tests autoloader -cat <<'AUTOLOAD' | tee autoload.php +%if %{with_tests} +: Create tests bootstrap +cat <<'BOOTSTRAP' | tee bootstrap.php - 1:3.0.1-1 +- Update to 3.0.1 (RHBZ #1480022) +- Use PHPUnit 6 + * Sun Sep 10 2017 Shawn Iwinski - 2.1.0-1 - Update to 2.1.0 - Remove now unneeded patch -- cgit