From 70e60058a0317e4986157c80a42d33f0b0948ef4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 30 Oct 2017 13:38:49 +0100 Subject: fix FTBFS fro mKoschei, add patch for test from https://github.com/sabre-io/vobject/pull/395 sources from https://github.com/sabre-io/vobject/pull/395 --- .gitignore | 8 +++++++ 395.patch | 21 +++++++++++++++++ php-sabre-vobject-bin.patch | 56 +++++++++++++++++++++++++++++++++++++++++++++ php-sabre-vobject.spec | 41 +++++++++++++++------------------ sabre-vobject-bin.patch | 56 --------------------------------------------- 5 files changed, 104 insertions(+), 78 deletions(-) create mode 100644 .gitignore create mode 100644 395.patch create mode 100644 php-sabre-vobject-bin.patch delete mode 100644 sabre-vobject-bin.patch 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/395.patch b/395.patch new file mode 100644 index 0000000..0e6c5a7 --- /dev/null +++ b/395.patch @@ -0,0 +1,21 @@ +From f70b5b5c7113c8781c1fb208a89093315be942da Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 30 Oct 2017 13:21:53 +0100 +Subject: [PATCH] Canada/East-Saskatchewan removed in 2017.3 + +--- + lib/timezonedata/php-bc.php | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/lib/timezonedata/php-bc.php b/lib/timezonedata/php-bc.php +index 906ccb0e..83f38f50 100644 +--- a/lib/timezonedata/php-bc.php ++++ b/lib/timezonedata/php-bc.php +@@ -68,7 +68,6 @@ + 'Brazil/West', + 'Canada/Atlantic', + 'Canada/Central', +- 'Canada/East-Saskatchewan', + 'Canada/Eastern', + 'Canada/Mountain', + 'Canada/Newfoundland', diff --git a/php-sabre-vobject-bin.patch b/php-sabre-vobject-bin.patch new file mode 100644 index 0000000..60b7f9a --- /dev/null +++ b/php-sabre-vobject-bin.patch @@ -0,0 +1,56 @@ +diff -up ./bin/generate_vcards.rpm ./bin/generate_vcards +--- ./bin/generate_vcards.rpm 2015-07-20 15:36:00.466610252 +0200 ++++ ./bin/generate_vcards 2015-07-20 15:36:24.434738474 +0200 +@@ -6,8 +6,7 @@ namespace Sabre\VObject; + // This sucks.. we have to try to find the composer autoloader. But chances + // are, we can't find it this way. So we'll do our bestest + $paths = array( +- __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly +- __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency. ++ '/usr/share/php/Sabre/VObject/autoload.php', // RPM installation + ); + + foreach($paths as $path) { +diff -up ./bin/vobject.rpm ./bin/vobject +--- ./bin/vobject.rpm 2015-07-20 15:34:43.499198500 +0200 ++++ ./bin/vobject 2015-07-20 15:36:20.645718203 +0200 +@@ -6,8 +6,7 @@ namespace Sabre\VObject; + // This sucks.. we have to try to find the composer autoloader. But chances + // are, we can't find it this way. So we'll do our bestest + $paths = array( +- __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly +- __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency. ++ '/usr/share/php/Sabre/VObject/autoload.php', // RPM installation + ); + + foreach($paths as $path) { +diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php +--- ./tests/bootstrap.php.rpm 2015-07-20 15:36:46.774857986 +0200 ++++ ./tests/bootstrap.php 2015-07-20 15:40:20.007998716 +0200 +@@ -3,8 +3,7 @@ + date_default_timezone_set('UTC'); + + $try = array( +- __DIR__ . '/../vendor/autoload.php', +- __DIR__ . '/../../../autoload.php', ++ '@BUILDROOT@/usr/share/php/Sabre/VObject/autoload.php', // RPM installation + ); + + foreach($try as $path) { +@@ -14,8 +13,6 @@ foreach($try as $path) { + } + } + +-$autoLoader->addPsr4('Sabre\\VObject\\',__DIR__ . '/VObject'); +- + if (!defined('SABRE_TEMPDIR')) { + define('SABRE_TEMPDIR', __DIR__ . '/temp/'); + } +@@ -23,3 +21,7 @@ if (!defined('SABRE_TEMPDIR')) { + if (!file_exists(SABRE_TEMPDIR)) { + mkdir(SABRE_TEMPDIR); + } ++ ++// Not catched by autoloader ++require_once __DIR__ . '/VObject/TestCase.php'; ++require_once __DIR__ . '/VObject/ITip/BrokerTester.php'; diff --git a/php-sabre-vobject.spec b/php-sabre-vobject.spec index 2f8f7d0..21ab7e9 100644 --- a/php-sabre-vobject.spec +++ b/php-sabre-vobject.spec @@ -8,8 +8,8 @@ # %global gh_commit 129d80533a9ec0d9cacfb50b51180c34edb6874c %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_owner fruux -%global gh_project sabre-vobject +%global gh_owner sabre-io +%global gh_project vobject %global with_tests %{?_without_tests:0}%{!?_without_tests:1} %if 0%{?fedora} > 25 @@ -18,21 +18,21 @@ %global with_cmd 1 %endif -Name: php-%{gh_project} +Name: php-sabre-vobject Summary: Library to parse and manipulate iCalendar and vCard objects Version: 3.5.3 -Release: 4%{?dist} +Release: 7%{?dist} URL: http://sabre.io/vobject/ License: BSD Group: Development/Libraries -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz Source1: %{name}-autoload.php # replace composer autloader -Patch0: %{gh_project}-bin.patch +Patch0: %{name}-bin.patch +Patch1: https://patch-diff.githubusercontent.com/raw/sabre-io/vobject/pull/395.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch %if %{with_tests} BuildRequires: php-composer(phpunit/phpunit) @@ -82,6 +82,8 @@ Autoloader: %{_datadir}/php/Sabre/VObject/autoload.php %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p1 -b .rpm +%patch1 -p1 + cp %{SOURCE1} lib/autoload.php @@ -110,21 +112,12 @@ cd tests sed -e 's:@BUILDROOT@:%{buildroot}:' -i bootstrap.php : Run upstream test suite against installed library -# remirepo:11 -run=0 ret=0 -if which php56; then - php56 %{_bindir}/phpunit || ret=1 - run=1 -fi -if which php71; then - php71 %{_bindir}/phpunit || ret=1 - run=1 -fi -if [ $run -eq 0 ]; then -%{_bindir}/phpunit --verbose -# remirepo:2 -fi +for cmd in php php56 php70 php71 php72; do + if which $cmd; then + $cmd %{_bindir}/phpunit --verbose || ret=1 + fi +done exit $ret %else : Skip upstream test suite @@ -132,7 +125,6 @@ exit $ret %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc *md @@ -145,6 +137,11 @@ exit $ret %changelog +* Mon Oct 30 2017 Remi Collet - 4.1.3-2 +- fix FTBFS fro mKoschei, add patch for test from + https://github.com/sabre-io/vobject/pull/395 +- sources from https://github.com/sabre-io/vobject/pull/395 + * Tue Jan 17 2017 Remi Collet - 3.5.3-4 - commands moved to php-sabre-vobject4 in F26 diff --git a/sabre-vobject-bin.patch b/sabre-vobject-bin.patch deleted file mode 100644 index 60b7f9a..0000000 --- a/sabre-vobject-bin.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff -up ./bin/generate_vcards.rpm ./bin/generate_vcards ---- ./bin/generate_vcards.rpm 2015-07-20 15:36:00.466610252 +0200 -+++ ./bin/generate_vcards 2015-07-20 15:36:24.434738474 +0200 -@@ -6,8 +6,7 @@ namespace Sabre\VObject; - // This sucks.. we have to try to find the composer autoloader. But chances - // are, we can't find it this way. So we'll do our bestest - $paths = array( -- __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly -- __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency. -+ '/usr/share/php/Sabre/VObject/autoload.php', // RPM installation - ); - - foreach($paths as $path) { -diff -up ./bin/vobject.rpm ./bin/vobject ---- ./bin/vobject.rpm 2015-07-20 15:34:43.499198500 +0200 -+++ ./bin/vobject 2015-07-20 15:36:20.645718203 +0200 -@@ -6,8 +6,7 @@ namespace Sabre\VObject; - // This sucks.. we have to try to find the composer autoloader. But chances - // are, we can't find it this way. So we'll do our bestest - $paths = array( -- __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly -- __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency. -+ '/usr/share/php/Sabre/VObject/autoload.php', // RPM installation - ); - - foreach($paths as $path) { -diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php ---- ./tests/bootstrap.php.rpm 2015-07-20 15:36:46.774857986 +0200 -+++ ./tests/bootstrap.php 2015-07-20 15:40:20.007998716 +0200 -@@ -3,8 +3,7 @@ - date_default_timezone_set('UTC'); - - $try = array( -- __DIR__ . '/../vendor/autoload.php', -- __DIR__ . '/../../../autoload.php', -+ '@BUILDROOT@/usr/share/php/Sabre/VObject/autoload.php', // RPM installation - ); - - foreach($try as $path) { -@@ -14,8 +13,6 @@ foreach($try as $path) { - } - } - --$autoLoader->addPsr4('Sabre\\VObject\\',__DIR__ . '/VObject'); -- - if (!defined('SABRE_TEMPDIR')) { - define('SABRE_TEMPDIR', __DIR__ . '/temp/'); - } -@@ -23,3 +21,7 @@ if (!defined('SABRE_TEMPDIR')) { - if (!file_exists(SABRE_TEMPDIR)) { - mkdir(SABRE_TEMPDIR); - } -+ -+// Not catched by autoloader -+require_once __DIR__ . '/VObject/TestCase.php'; -+require_once __DIR__ . '/VObject/ITip/BrokerTester.php'; -- cgit