summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-05-12 20:34:47 +0200
committerRemi Collet <fedora@famillecollet.com>2014-05-12 20:34:47 +0200
commitc82b6506abe35570c5998d050c003a8b2ad10aa9 (patch)
tree6e6372d4fb187b5bbf56379787728265612aebb4
parent09d48ff817a5bd3b0042ae9080574d15bd71db3f (diff)
php-bartlett-PHP-CompatInfo: 3.1.0 (from github, instead of pear)
-rw-r--r--php-bartlett-PHP-CompatInfo-rpm.patch130
-rw-r--r--php-bartlett-PHP-CompatInfo.spec123
2 files changed, 176 insertions, 77 deletions
diff --git a/php-bartlett-PHP-CompatInfo-rpm.patch b/php-bartlett-PHP-CompatInfo-rpm.patch
new file mode 100644
index 0000000..b90f496
--- /dev/null
+++ b/php-bartlett-PHP-CompatInfo-rpm.patch
@@ -0,0 +1,130 @@
+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-12 20:24:33.177134072 +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-12 20:24:04.316031717 +0200
+@@ -1,32 +1,29 @@
+-#!/usr/bin/env php
++#!/usr/bin/php
+ <?php
+ // bin/console
+-//putenv("COMPATINFO=/path/to/dir/compatinfo.json");
++if (!getenv("COMPATINFO")) {
++ putenv("COMPATINFO=/etc/phpcompatinfo.json");
++}
+ ini_set('memory_limit', -1);
+
+-$baseDir = dirname(__DIR__);
+-$vendorDir = $baseDir . '/vendor';
++$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 . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
++
++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'),
++ 'Symfony\\Component\\Finder' => $vendorDir,
++ 'Symfony\\Component\\EventDispatcher' => $vendorDir,
++ 'Symfony\\Component\\Console' => $vendorDir,
++ 'Symfony\\Component\\ClassLoader' => $vendorDir,
++ 'Bartlett' => $vendorDir,
+ ));
+ $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-12 20:24:04.316031717 +0200
+@@ -1,21 +1,24 @@
+ <?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 . '/PhpParser/Autoloader.php';
++PhpParser\Autoloader::register();
++
++require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
++
++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',
++ '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',
+ ));
diff --git a/php-bartlett-PHP-CompatInfo.spec b/php-bartlett-PHP-CompatInfo.spec
index 42e8c22..b6cad6f 100644
--- a/php-bartlett-PHP-CompatInfo.spec
+++ b/php-bartlett-PHP-CompatInfo.spec
@@ -6,61 +6,48 @@
#
# Please, preserve the changelog entries
#
-%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
-%global pear_name PHP_CompatInfo
-%global channel bartlett.laurent-laville.org
-
-# TODO : link /usr/share/pear/data/PHP_CompatInfo/misc/jquery-min.js
-# to system jquery when available, then fix License (BSD only)
-
+%global gh_commit b9b813a906d0f2e18608c1c6d153418d99582622
+%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: 2.26.0
+Version: 3.1.0
Release: 1%{?dist}
Summary: Find out version and the extensions required for a piece of code to run
Group: Development/Libraries
-# PHP-CompatInfo is BSD, bundled jquery is MIT (or GPL)
-License: BSD and MIT
+License: BSD
URL: http://php5.laurent-laville.org/compatinfo/
-Source0: http://bartlett.laurent-laville.org/get/%{pear_name}-%{version}%{?prever}.tgz
-Source1: https://raw.github.com/llaville/php-compat-info/master/misc/phpcompatinfo.1
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz
-# Update configuration for best experience
-# Reference = ALL known extension (instead of installed ones)
-# Make cache / save_path user specific
-# Add .install .module to fileExtensions (for drupal)
-Patch0: %{pear_name}-conf.patch
+# Autoloader for RPM - die composer !
+Patch0: %{name}-rpm.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php(language) >= 5.3.0
-BuildRequires: php-pear(PEAR) >= 1.9.0
-BuildRequires: php-channel(%{channel})
# to run test suite
-BuildRequires: php-pear(pear.phpunit.de/PHPUnit) >= 3.6.0
-BuildRequires: php-pear(%{channel}/PHP_Reflect) >= 1.9.0
+BuildRequires: %{_bindir}/phpunit
+BuildRequires: php-bartlett-PHP-Reflect >= 2.0.0
-Requires(post): %{__pear}
-Requires(postun): %{__pear}
+# From composer.json
Requires: php(language) >= 5.3.0
-Requires: php-date
-Requires: php-dom
-Requires: php-libxml
+Requires: php-json
Requires: php-pcre
-Requires: php-reflection
Requires: php-spl
-Requires: php-pear(PEAR) >= 1.9.0
-Requires: php-pear(%{channel}/PHP_Reflect) >= 1.9.0
-Requires: php-pear(%{channel}/PHP_Reflect) < 2
-Requires: php-pear(Console_CommandLine) >= 1.2.0
-# Optional
-Requires: php-pear(pear.phpunit.de/PHPUnit) >= 3.6.0
-Requires: php-pear(pear.phpunit.de/PHP_Timer) >= 1.0.0
-# Optional and not yet availalble php-pear(Net_Growl) >= 2.2.2
+Requires: php-tokenizer
+Requires: php-phpunit-PHP-Timer >= 1.0.0
+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
+# From phpcompatinfo report for version 3.1.0
+Requires: php-curl
+Requires: php-mbstring
-Provides: php-pear(%{channel}/%{pear_name}) = %{version}%{?prever}
-Provides: phpcompatinfo = %{version}%{?prever}
+Provides: phpcompatinfo = %{version}
%description
@@ -69,48 +56,34 @@ version and extensions required for it to run. CLI version has many reports
(extension, interface, class, function, constant) to display and ability to
show content of dictionary references.
-HTML Documentation: %{pear_docdir}/%{pear_name}/html/index.html
+Documentation: http://php5.laurent-laville.org/compatinfo/manual/3.1/en/
%prep
-%setup -q -c
+%setup -q -n %{gh_project}-%{gh_commit}
-cd %{pear_name}-%{version}%{?prever}
+%patch0 -p1 -b .rpm
-# Copy upstream default configuration
-cp phpcompatinfo.xml.dist phpcompatinfo.xml
-# Apply our changes
-%patch0 -p1 -b .rpm
+find . -type f -name \*.rpm -print | xargs rm
-cp ../package.xml %{name}.xml
+sed -e 's/@package_version@/%{version}/' \
+ -i $(find src -name \*.php)
%build
-cd %{pear_name}-%{version}%{?prever}
+# Nothing
%install
rm -rf %{buildroot}
-cd %{pear_name}-%{version}%{?prever}
-%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
-
-# Clean up unnecessary files
-rm -rf %{buildroot}%{pear_metadir}/.??*
+mkdir -p %{buildroot}%{_datadir}/php
+cp -pr src/Bartlett %{buildroot}%{_datadir}/php/Bartlett
-# Install XML package description
-mkdir -p %{buildroot}%{pear_xmldir}
-install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
-
-# Create default package configuration
-install -pm 644 phpcompatinfo.xml %{buildroot}%{pear_cfgdir}/%{pear_name}/
-
-# Install the man page
-mkdir -p %{buildroot}%{_mandir}/man1
-install -pm 644 %{SOURCE1} %{buildroot}%{_mandir}/man1/phpcompatinfo.1
+install -D -p -m 755 bin/compatinfo %{buildroot}%{_bindir}/phpcompatinfo
+install -D -p -m 644 bin/compatinfo.json %{buildroot}%{_sysconfdir}/phpcompatinfo.json
%check
-cd %{pear_name}-%{version}%{?prever}
%if 0%{?rhel} == 6
# php-5.3.3-CVE-2012-0057.patch add new constants from php 5.3.9
@@ -126,11 +99,8 @@ rm -f tests/Reference/XslTest.php
%{_bindir}/phpunit \
-d date.timezone=UTC \
-d memory_limit=-1 \
- --bootstrap %{buildroot}%{pear_phpdir}/Bartlett/PHP/CompatInfo/Autoload.php \
%if 0%{?rhel} < 6 && 0%{?fedora} < 8
- tests || exit 0
-%else
- tests
+ || exit 0
%endif
@@ -147,21 +117,20 @@ fi
%files
%defattr(-,root,root,-)
-%doc %{pear_docdir}/%{pear_name}
-%dir %{pear_cfgdir}/%{pear_name}
-# Editable configuration
-%config(noreplace) %{pear_cfgdir}/%{pear_name}/phpcompatinfo.xml
-# Default configuration
-%{pear_cfgdir}/%{pear_name}/phpcompatinfo.xml.dist
-%{pear_xmldir}/%{name}.xml
-%{pear_phpdir}/Bartlett/PHP/Compat*
-%{pear_testdir}/%{pear_name}
-%{pear_datadir}/%{pear_name}
+%doc LICENSE composer.json README.*
+%config(noreplace) %{_sysconfdir}/phpcompatinfo.json
%{_bindir}/phpcompatinfo
-%{_mandir}/man1/phpcompatinfo.*
+%{_datadir}/php/Bartlett/CompatInfo
+%{_datadir}/php/Bartlett/CompatInfo.php
%changelog
+* Mon May 12 2014 Remi Collet <remi@fedoraproject.org> - 3.1.0-1
+- update to 3.1.0
+- sources from github
+- patch autoloader to not rely on composer
+- drop documentation (link to online doc in description)
+
* Fri Dec 13 2013 Remi Collet <remi@fedoraproject.org> - 2.26.0-1
- Update to 2.26.0 (stable)