summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-bartlett-PHP-CompatInfo-rpm.patch144
-rw-r--r--php-bartlett-PHP-CompatInfo.spec58
2 files changed, 70 insertions, 132 deletions
diff --git a/php-bartlett-PHP-CompatInfo-rpm.patch b/php-bartlett-PHP-CompatInfo-rpm.patch
index 6401929..0589316 100644
--- a/php-bartlett-PHP-CompatInfo-rpm.patch
+++ b/php-bartlett-PHP-CompatInfo-rpm.patch
@@ -1,140 +1,70 @@
-diff -up php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/bin/compatinfo.json.rpm php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/bin/compatinfo.json
---- php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/bin/compatinfo.json.rpm 2014-05-02 11:02:24.000000000 +0200
-+++ php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/bin/compatinfo.json 2014-05-13 08:57:47.713593892 +0200
-@@ -1,35 +1,8 @@
- {
- "source-providers": [
- {
-- "in": "phar:///var/dist/PHP_CompatInfo-2.0.0.zip as CompatInfo2",
-- "name": "*.php",
-- "path": "PHP/"
-- },
-- {
-- "in": "phar:///var/dist/PHP_Reflect-1.0.0.tar as Reflect1",
-- "path": "PHP/",
-- "name": "*.php"
-- },
-- {
-- "in": "phar:///var/dist/PHP_Reflect-1.0.0.tar as ReflectAL",
-- "path": "PHP/",
-- "name": "Autoload.php"
-- },
-- {
-- "in": "phar:///var/dist/phing-2.7.0.tgz as phing27",
-- "name": "*.php",
-- "path": "tasks/system",
-- "notPath": "contrib/",
-- "size": "< 4K"
-- },
-- {
-- "in": "phar:///var/dist/Zend-1.12.3.tgz as ZF1123",
-- "name": "*.php"
-- },
-- {
-- "in": "phar:///var/dist/Zend-1.12.3.tgz as ZFDate",
-- "name": "Date.php",
-- "depth": "== 1"
-+ "in": ". as current",
-+ "name": "/\\.(php|inc|phtml|module|install)$/"
- }
- ],
- "plugins": [
-diff -up php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/bin/compatinfo.rpm php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/bin/compatinfo
---- php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/bin/compatinfo.rpm 2014-05-02 11:02:24.000000000 +0200
-+++ php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/bin/compatinfo 2014-05-13 08:59:10.469913479 +0200
-@@ -1,32 +1,39 @@
+diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo
+--- ./bin/phpcompatinfo.rpm 2014-07-22 20:58:01.000000000 +0200
++++ ./bin/phpcompatinfo 2014-07-24 07:35:44.357468394 +0200
+@@ -1,4 +1,4 @@
-#!/usr/bin/env php
+#!/usr/bin/php
<?php
- // bin/console
--//putenv("COMPATINFO=/path/to/dir/compatinfo.json");
-+if (!getenv("COMPATINFO")) {
-+ $files = array(
-+ realpath('./compatinfo.json'),
-+ getenv('HOME').'/.config/phpcompatinfo.json',
-+ '/etc/phpcompatinfo.json',
-+ );
-+ foreach ($files as $file) {
-+ if (file_exists($file)) {
-+ putenv("COMPATINFO=$file");
-+ break;
-+ }
-+ }
-+}
ini_set('memory_limit', -1);
--$baseDir = dirname(__DIR__);
--$vendorDir = $baseDir . '/vendor';
+@@ -22,7 +22,24 @@ if (\Phar::running()) {
+ }
+ }
+ }
+-require_once $vendorDir . '/autoload.php';
+$vendorDir = '/usr/share/php';
-
--if (\Phar::running()) {
-- require_once 'phar://phpcompatinfo.phar/vendor/nikic/php-parser/lib/bootstrap.php';
-- require_once 'phar://phpcompatinfo.phar/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-- require_once 'phar://phpcompatinfo.phar/vendor/phpunit/php-timer/PHP/Timer.php';
--} else {
-- require_once $vendorDir . '/nikic/php-parser/lib/bootstrap.php';
-- require_once $vendorDir . '/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-- require_once $vendorDir . '/phpunit/php-timer/PHP/Timer.php';
--}
+require_once $vendorDir . '/PhpParser/Autoloader.php';
+PhpParser\Autoloader::register();
+
++require_once $vendorDir . '/PHP/Timer.php';
++
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
++use Symfony\Component\ClassLoader\UniversalClassLoader;
+
-+require_once $vendorDir . '/PHP/Timer.php';
-
- use Symfony\Component\ClassLoader\UniversalClassLoader;
-
- $loader = new UniversalClassLoader();
- $loader->registerNamespaces(array(
-- 'Symfony\\Component\\Finder' => $vendorDir . '/symfony/finder',
-- 'Symfony\\Component\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher',
-- 'Symfony\\Component\\Console' => $vendorDir . '/symfony/console',
-- 'Symfony\\Component\\ClassLoader' => $vendorDir . '/symfony/class-loader',
-- 'Bartlett\\Tests\\CompatInfo' => $baseDir . '/tests',
-- 'Bartlett' => array($baseDir . '/src', $vendorDir . '/bartlett/php-reflect/src'),
++$loader = new UniversalClassLoader();
++$loader->registerNamespaces(array(
+ 'Symfony\\Component\\Finder' => $vendorDir,
+ 'Symfony\\Component\\EventDispatcher' => $vendorDir,
+ 'Symfony\\Component\\Console' => $vendorDir,
+ 'Symfony\\Component\\ClassLoader' => $vendorDir,
+ 'Bartlett' => $vendorDir,
- ));
- $loader->register();
++));
++$loader->register();
-diff -up php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/tests/bootstrap.php.rpm php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/tests/bootstrap.php
---- php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/tests/bootstrap.php.rpm 2014-05-02 11:02:24.000000000 +0200
-+++ php-compat-info-b9b813a906d0f2e18608c1c6d153418d99582622/tests/bootstrap.php 2014-05-13 08:57:47.713593892 +0200
-@@ -1,21 +1,24 @@
+ if (PHP_SAPI !== 'cli') {
+ return;
+diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
+--- ./tests/bootstrap.php.rpm 2014-07-22 20:58:01.000000000 +0200
++++ ./tests/bootstrap.php 2014-07-24 07:35:28.060391649 +0200
+@@ -1,8 +1,29 @@
<?php
$baseDir = dirname(__DIR__);
-$vendorDir = $baseDir . '/vendor';
+$vendorDir = '/usr/share/php';
--require_once $vendorDir . '/nikic/php-parser/lib/bootstrap.php';
--require_once $vendorDir . '/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
--require_once $vendorDir . '/phpunit/php-timer/PHP/Timer.php';
+-require_once $vendorDir . '/autoload.php';
+require_once $vendorDir . '/PhpParser/Autoloader.php';
+PhpParser\Autoloader::register();
+
++require_once $vendorDir . '/PHP/Timer.php';
+
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
++use Symfony\Component\ClassLoader\UniversalClassLoader;
+
-+require_once $vendorDir . '/PHP/Timer.php';
-
- use Symfony\Component\ClassLoader\UniversalClassLoader;
-
- $loader = new UniversalClassLoader();
- $loader->registerNamespaces(array(
-- 'Symfony\\Component\\Finder' => $vendorDir . '/symfony/finder',
-- 'Symfony\\Component\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher',
-- 'Symfony\\Component\\Console' => $vendorDir . '/symfony/console',
-- 'Symfony\\Component\\ClassLoader' => $vendorDir . '/symfony/class-loader',
-- 'Bartlett\\Reflect' => $vendorDir . '/bartlett/php-reflect/src',
++$loader = new UniversalClassLoader();
++$loader->registerNamespaces(array(
+ 'Symfony\\Component\\Finder' => $vendorDir,
+ 'Symfony\\Component\\EventDispatcher' => $vendorDir,
+ 'Symfony\\Component\\Console' => $vendorDir,
+ 'Symfony\\Component\\ClassLoader' => $vendorDir,
+ 'Bartlett\\Reflect' => $vendorDir,
- 'Bartlett\\Tests\\CompatInfo' => $baseDir . '/tests',
- 'Bartlett' => $baseDir . '/src',
- ));
++ 'Bartlett\\Tests\\CompatInfo' => $baseDir . '/tests',
++ 'Bartlett' => $baseDir . '/src',
++ ));
++
++$loader->register();
++
++# Class not catched by autoloader
++require $vendorDir . '/Bartlett/Reflect.php';
+ require __DIR__ . '/Reference/GenericTest.php';
diff --git a/php-bartlett-PHP-CompatInfo.spec b/php-bartlett-PHP-CompatInfo.spec
index f164a61..d449a3f 100644
--- a/php-bartlett-PHP-CompatInfo.spec
+++ b/php-bartlett-PHP-CompatInfo.spec
@@ -6,20 +6,20 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit b9b813a906d0f2e18608c1c6d153418d99582622
+%global gh_commit 970d967fee265cd32379402ae0002c0e7987449d
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner llaville
%global gh_project php-compat-info
Name: php-bartlett-PHP-CompatInfo
-Version: 3.1.0
-Release: 2%{?dist}
+Version: 3.2.0
+Release: %{?gh_short:0.1.git%{gh_short}}%{!?gh_short:1}%{?dist}
Summary: Find out version and the extensions required for a piece of code to run
Group: Development/Libraries
License: BSD
URL: http://php5.laurent-laville.org/compatinfo/
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?gh_short:-%{gh_short}}.tar.gz
# Autoloader for RPM - die composer !
Patch0: %{name}-rpm.patch
@@ -29,28 +29,38 @@ BuildArch: noarch
BuildRequires: php(language) >= 5.3.0
# to run test suite
BuildRequires: %{_bindir}/phpunit
-BuildRequires: php-bartlett-PHP-Reflect >= 2.0.0
+BuildRequires: php-composer(bartlett/php-reflect) >= 2
# From composer.json
+# "php": ">=5.3.0",
+# "ext-tokenizer": "*",
+# "ext-pcre": "*",
+# "ext-spl": "*",
+# "ext-json": "*",
+# "symfony/console": "~2.5",
+# "bartlett/php-reflect": "2.*"
Requires: php(language) >= 5.3.0
Requires: php-json
Requires: php-pcre
Requires: php-spl
Requires: php-tokenizer
-Requires: php-bartlett-PHP-Reflect >= 2.0.0
+Requires: php-composer(bartlett/php-reflect) >= 2
+Requires: php-composer(bartlett/php-reflect) < 3
+Requires: php-composer(symfony/console) >= 2.5
+Requires: php-composer(symfony/console) < 3
# Required by autoloader
# php-timer 1.0.5-3 is first version in /usr/share/php
-Requires: php-phpunit-PHP-Timer >= 1.0.5-3
-Requires: php-PHPParser >= 1.0.0
-Requires: php-symfony-classloader >= 2.4
-Requires: php-symfony-eventdispatcher >= 2.4
-Requires: php-symfony-finder >= 2.4
-Requires: php-symfony-console >= 2.4
+Requires: php-composer(phpunit/php-timer)
+Requires: php-composer(nikic/php-parser)
+Requires: php-composer(symfony/class-loader)
+Requires: php-composer(symfony/event-dispatcher)
+Requires: php-composer(symfony/finder)
# From phpcompatinfo report for version 3.1.0
Requires: php-curl
Requires: php-mbstring
Provides: phpcompatinfo = %{version}
+Provides: php-composer(bartlett/php-compatinfo) = %{version}
%description
@@ -67,8 +77,6 @@ Documentation: http://php5.laurent-laville.org/compatinfo/manual/3.1/en/
%patch0 -p1 -b .rpm
-find . -type f -name \*.rpm -print | xargs rm
-
sed -e 's/@package_version@/%{version}/' \
-i $(find src -name \*.php)
@@ -82,19 +90,12 @@ rm -rf %{buildroot}
mkdir -p %{buildroot}%{_datadir}/php
cp -pr src/Bartlett %{buildroot}%{_datadir}/php/Bartlett
-install -D -p -m 755 bin/compatinfo %{buildroot}%{_bindir}/phpcompatinfo
-install -D -p -m 644 bin/compatinfo.json %{buildroot}%{_sysconfdir}/phpcompatinfo.json
+install -D -p -m 755 bin/phpcompatinfo %{buildroot}%{_bindir}/phpcompatinfo
+install -D -p -m 644 bin/phpcompatinfo.json.dist %{buildroot}%{_sysconfdir}/phpcompatinfo.json
+install -D -p -m 644 bin/phpcompatinfo.1 %{buildroot}%{_mandir}/man1/phpcompatinfo.1
%check
-
-%if 0%{?rhel} == 6
-# php-5.3.3-CVE-2012-0057.patch add new constants from php 5.3.9
-# so drop this test which fails with
-# Constant 'XSL_SECPREF_CREATE_DIRECTORY', found in Reference (5.3.9,), exists.
-rm -f tests/Reference/XslTest.php
-%endif
-
# OK, but incomplete or skipped tests!
# Tests: 810, Assertions: 10996, Skipped: 80, when most extensions installed
# Tests: 551, Assertions: 6833, Skipped: 378, in mock
@@ -120,14 +121,21 @@ fi
%files
%defattr(-,root,root,-)
-%doc LICENSE composer.json README.*
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc composer.json README.*
%config(noreplace) %{_sysconfdir}/phpcompatinfo.json
%{_bindir}/phpcompatinfo
%{_datadir}/php/Bartlett/CompatInfo
%{_datadir}/php/Bartlett/CompatInfo.php
+%{_mandir}/man1/phpcompatinfo.1*
%changelog
+* Wed Jul 23 2014 Remi Collet <remi@fedoraproject.org> - 3.2.0-0.1.970d967
+- Test build of upcoming 3.2.0
+- add manpage
+
* Mon May 26 2014 Remi Collet <remi@fedoraproject.org> - 3.1.0-2
- fix dependencies