summaryrefslogtreecommitdiffstats
path: root/php-kdyby-events.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-04 12:24:17 +0100
committerRemi Collet <remi@remirepo.net>2017-12-04 12:24:17 +0100
commit7f3ab7fbc787bba9fd18a5f0e188a449cc998894 (patch)
tree8706f0d3844eae3c79593e6088fab38de273e5de /php-kdyby-events.spec
parentbc326a92dc11f2485e3a73eaf2fbbd4070f67fdb (diff)
Update to 3.1.1
add dependency on kdyby/strict-objects raise dependency on nette/di 2.4.8 raise dependency on nette/utils 2.4.5
Diffstat (limited to 'php-kdyby-events.spec')
-rw-r--r--php-kdyby-events.spec109
1 files changed, 73 insertions, 36 deletions
diff --git a/php-kdyby-events.spec b/php-kdyby-events.spec
index bba9327..8fda6fb 100644
--- a/php-kdyby-events.spec
+++ b/php-kdyby-events.spec
@@ -6,19 +6,21 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit f63b92eaf75df33d0a449af80de8e9f1d85dd6f6
+%global gh_commit c0234d66fa3a4b16e40ca06ca8679c12552f3ce0
#global gh_date 20150728
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
-%global gh_owner kdyby
-%global gh_project events
-%global ns_vendor Kdyby
-%global ns_project Events
+%global gh_owner Kdyby
+%global gh_project Events
+%global ns_vendor %{gh_owner}
+%global ns_project %{gh_project}
+%global pk_vendor kdyby
+%global pk_project events
%global php_home %{_datadir}/php
%global with_tests 0%{!?_without_tests:1}
-Name: php-%{gh_owner}-%{gh_project}
-Version: 3.1.0
-%global specrel 2
+Name: php-%{pk_vendor}-%{pk_project}
+Version: 3.1.1
+%global specrel 1
Release: %{?gh_date:1%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist}
Summary: Events for Nette Framework
@@ -28,82 +30,107 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{name}-%{version}-%{gh_short}.tgz
# pull a git snapshot to get test sutie
Source1: makesrc.sh
-# Autoloader
-Source2: %{name}-autoload.php
-
-Patch0: %{name}-php72.patch
BuildArch: noarch
+BuildRequires: php-fedora-autoloader-devel
%if %{with_tests}
+BuildRequires: php-reflection
BuildRequires: php-pcre
BuildRequires: php-spl
BuildRequires: php-composer(nette/di) < 3
-BuildRequires: php-composer(nette/di) >= 2.3
+BuildRequires: php-composer(nette/di) >= 2.4.8
BuildRequires: php-composer(nette/utils) < 3
-BuildRequires: php-composer(nette/utils) >= 2.3
+BuildRequires: php-composer(nette/utils) >= 2.4.5
BuildRequires: php-composer(nette/reflection) < 3
BuildRequires: php-composer(nette/reflection) >= 2.3
BuildRequires: php-composer(doctrine/common) < 3
BuildRequires: php-composer(doctrine/common) >= 2.5.0
-BuildRequires: php-composer(fedora/autoloader)
+BuildRequires: php-composer(%{pk_vendor}/strict-objects) >= 1.0
+BuildRequires: php-composer(%{pk_vendor}/strict-objects) < 2
# From composer.json, "require-dev": {
# "nette/application": "^2.4@dev",
# "nette/bootstrap": "^2.4@dev",
+# "nette/caching": "^2.5@dev",
# "nette/security": "^2.4@dev",
-# "nette/http": "^2.4@dev",
+# "nette/http": "^2.4.7@dev",
# "tracy/tracy": "^2.4@dev",
-# "symfony/event-dispatcher": "^3.0",
+# "symfony/event-dispatcher": "^3.0 || ^4.0",
# "nette/tester": "~1.7"
BuildRequires: php-composer(nette/application) < 3
BuildRequires: php-composer(nette/application) >= 2.4
BuildRequires: php-composer(nette/bootstrap) < 3
BuildRequires: php-composer(nette/bootstrap) >= 2.4
+BuildRequires: php-composer(nette/caching) < 3
+BuildRequires: php-composer(nette/caching) >= 2.5
BuildRequires: php-composer(nette/security) < 3
BuildRequires: php-composer(nette/security) >= 2.4
BuildRequires: php-composer(nette/http) < 3
-BuildRequires: php-composer(nette/http) >= 2.4
+BuildRequires: php-composer(nette/http) >= 2.4.7
BuildRequires: php-composer(tracy/tracy) < 3
BuildRequires: php-composer(tracy/tracy) >= 2.4
BuildRequires: php-composer(nette/tester) >= 1.7
-BuildRequires: php-composer(symfony/event-dispatcher) < 4
+BuildRequires: php-composer(symfony/event-dispatcher) < 5
BuildRequires: php-composer(symfony/event-dispatcher) >= 3.0
%endif
# from composer.json, "require": {
-# "nette/di": "~2.4@dev",
-# "nette/utils": "~2.4@dev"
-# "nette/reflection": "^2.4@dev"
-Requires: php-composer(nette/di) >= 2.4
+# "php": "^5.6 || ^7.0",
+# "nette/di": "^2.4.8@dev",
+# "nette/utils": "^2.4.5@dev",
+# "nette/reflection": "^2.4@dev",
+# "kdyby/strict-objects": "^1.0"
+Requires: php(language) >= 5.6
+Requires: php-composer(nette/di) >= 2.4.8
Requires: php-composer(nette/di) < 3
-Requires: php-composer(nette/utils) >= 2.4
+Requires: php-composer(nette/utils) >= 2.4.5
Requires: php-composer(nette/utils) < 3
Requires: php-composer(nette/reflection) >= 2.4
Requires: php-composer(nette/reflection) < 3
+Requires: php-composer(%{pk_vendor}/strict-objects) >= 1.0
+Requires: php-composer(%{pk_vendor}/strict-objects) < 2
# To avoid having to provide the compatibility layer
# version 2.5.0 for autoloader
Requires: php-composer(doctrine/common) >= 2.5.0
Requires: php-composer(doctrine/common) < 3
# For autoloader
Requires: php-composer(fedora/autoloader)
-# from phpcompatinfo report for version 2.4.0
+# from phpcompatinfo report for version 3.1.1
+Requires: php-reflection
Requires: php-pcre
Requires: php-spl
-Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version}
%description
This extension is here to provide robust events system for Nette Framework.
-To use this library, you just have to add, in your project:
- require_once '%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php';
+Autoloader: %{php_home}/%{ns_vendor}/%{ns_project}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-%patch0 -p1
-cp %{SOURCE2} src/%{ns_project}/autoload.php
+mv src/Doctrine src/%{ns_project}/Doctrine
+mv src/Symfony src/%{ns_project}/Symfony
+
+cat << 'EOF' | tee src/%{ns_project}/autoload.php
+<?php
+/* Autoloader for %{name} and its dependencies */
+require_once '%{php_home}/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\', __DIR__);
+\Fedora\Autoloader\Dependencies::required([
+ __DIR__ . '/exceptions.php',
+ '%{php_home}/Doctrine/Common/autoload.php',
+ '%{php_home}/Nette/DI/autoload.php',
+ '%{php_home}/Nette/Utils/autoload.php',
+ '%{php_home}/Nette/Reflection/autoload.php',
+ '%{php_home}/Kdyby/StrictObjects/autoload.php',
+ __DIR__ . '/Doctrine/compatibility.php',
+ __DIR__ . '/Symfony/compatibility.php',
+]);
+EOF
%build
@@ -121,18 +148,23 @@ export LANG=fr_FR.utf8
: Generate autoloader
mkdir vendor
-cat << 'EOF' | tee vendor/autoload.php
-<?php
+phpab --output vendor/autoload.php tests/KdybyTests
+
+cat << 'EOF' | tee -a vendor/autoload.php
require_once '%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php';
-\Fedora\Autoloader\Dependencies::required(array(
+\Fedora\Autoloader\Dependencies::required([
'%{php_home}/Tester/autoload.php',
'%{php_home}/Nette/Application/autoload.php',
'%{php_home}/Nette/Bootstrap/autoload.php',
+ '%{php_home}/Nette/Caching/autoload.php',
'%{php_home}/Nette/Security/autoload.php',
'%{php_home}/Nette/Http/autoload.php',
'%{php_home}/Tracy/autoload.php',
- '%{php_home}/Symfony3/Component/EventDispatcher/autoload.php',
-));
+ [
+ '%{php_home}/Symfony4/Component/EventDispatcher/autoload.php',
+ '%{php_home}/Symfony3/Component/EventDispatcher/autoload.php',
+ ],
+]);
EOF
php -r 'require "%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php";'
@@ -140,7 +172,6 @@ php -r 'require "vendor/autoload.php";'
: Run test suite in sources tree
ret=0
-# PHP 7.2: https://github.com/Kdyby/Events/issues/108
for cmd in php php56 php70 php71 php72; do
if which $cmd; then
$cmd %{_bindir}/nette-tester --colors 0 -p $cmd -C tests/KdybyTests -s || ret=1
@@ -161,6 +192,12 @@ exit $ret
%changelog
+* Mon Dec 4 2017 Remi Collet <remi@remirepo.net> - 3.1.1-1
+- Update to 3.1.1
+- add dependency on kdyby/strict-objects
+- raise dependency on nette/di 2.4.8
+- raise dependency on nette/utils 2.4.5
+
* Thu Nov 9 2017 Remi Collet <remi@remirepo.net> - 3.1.0-2
- fix FTBFS from Koschei, add patch for PHP 7.2