diff options
-rwxr-xr-x | fedora-review-check | 8 | ||||
-rw-r--r-- | php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch | 12 | ||||
-rw-r--r-- | php-bartlett-PHP-CompatInfo-dev.spec | 24 |
3 files changed, 41 insertions, 3 deletions
diff --git a/fedora-review-check b/fedora-review-check new file mode 100755 index 0000000..cc72fc4 --- /dev/null +++ b/fedora-review-check @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ $# -eq 2 ] +then exec /usr/bin/phpcompatinfo analyser:run $2 --output $1 --no-ansi + +else echo "usage $0 logname dirname" + exit 1 +fi diff --git a/php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch b/php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch index b5774a2..efbe0e4 100644 --- a/php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch +++ b/php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch @@ -118,3 +118,15 @@ diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php +# Class not catched by autoloader +require $vendorDir . '/Bartlett/Reflect.php'; require __DIR__ . '/Reference/GenericTest.php'; +diff -up src/Bartlett/CompatInfo/Console/Application.php.rpm src/Bartlett/CompatInfo/Console/Application.php +--- ./src/Bartlett/CompatInfo/Console/Application.php.rpm 2015-02-27 12:43:50.156932510 +0100 ++++ ./src/Bartlett/CompatInfo/Console/Application.php 2015-02-27 13:05:29.032971712 +0100 +@@ -57,7 +57,7 @@ class Application extends BaseApplicatio + $this->getVersion(), + $v['build.string'] + ); +- if (extension_loaded('xdebug')) { ++ if (extension_loaded('xdebug') && defined("STDOUT") && function_exists("posix_isatty") && posix_isatty(STDOUT)) { + $version .= PHP_EOL . PHP_EOL . + '<warning>You are encouraged to unload xdebug extension to speed up execution.</warning>'; + } diff --git a/php-bartlett-PHP-CompatInfo-dev.spec b/php-bartlett-PHP-CompatInfo-dev.spec index e8ecf11..eadd214 100644 --- a/php-bartlett-PHP-CompatInfo-dev.spec +++ b/php-bartlett-PHP-CompatInfo-dev.spec @@ -12,10 +12,11 @@ %global gh_owner llaville %global gh_project php-compat-info %global prever beta2 +%global with_tests %{?_without_tests:0}%{!?_without_tests:1} Name: php-bartlett-PHP-CompatInfo Version: 4.0.0 -%global specrel 6 +%global specrel 7 Release: %{?gh_short:0.%{specrel}.%{?gh_date}git%{gh_short}}%{!?gh_short:%{specrel}}%{?dist} Summary: Find out version and the extensions required for a piece of code to run @@ -23,6 +24,8 @@ 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}%{?gh_short:-%{gh_short}}.tar.gz +# Script for fedora-review +Source1: fedora-review-check # Autoloader for RPM - die composer ! # and sqlite database path @@ -32,9 +35,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: php(language) >= 5.3.0 BuildRequires: php-pdo_sqlite +BuildRequires: php-composer(bartlett/php-reflect) >= 3.0.0 +%if %{with_tests} # to run test suite BuildRequires: %{_bindir}/phpunit -BuildRequires: php-composer(bartlett/php-reflect) >= 3.0.0 +%endif # From composer.json, "require" # "php": ">=5.3.2", @@ -90,6 +95,10 @@ Documentation: http://php5.laurent-laville.org/compatinfo/manual/current/en/ %patch0 -p1 -b .rpm +# Cleanup patched files +find src -name \*rpm -delete -print + +# Set package version sed -e 's/@package_version@/%{version}%{?prever}/' \ -i $(find src -name \*.php) bin/phpcompatinfo @@ -109,7 +118,10 @@ install -D -p -m 644 bin/phpcompatinfo.json.dist %{buildroot}%{_sysconfdir}/phpc install -D -p -m 644 bin/phpcompatinfo.1 %{buildroot}%{_mandir}/man1/phpcompatinfo.1 install -D -p -m 644 data/compatinfo.sqlite %{buildroot}%{_datadir}/%{name}/compatinfo.sqlite +install -D -p -m 755 %{SOURCE1} %{buildroot}%{_datadir}/%{name}/fedora-review-check + +%if %{with_tests} %check %{_bindir}/phpunit \ --include-path src \ @@ -117,6 +129,7 @@ install -D -p -m 644 data/compatinfo.sqlite %{buildroot}%{_datadir}/%{name} %if 0%{?fedora} < 21 || exit 0 %endif +%endif %post @@ -135,10 +148,15 @@ fi %{_bindir}/phpcompatinfo %{_datadir}/php/Bartlett/CompatInfo %{_mandir}/man1/phpcompatinfo.1* -%{_datadir}/%{name}/compatinfo.sqlite +%{_datadir}/%{name} %changelog +* Fri Feb 27 2015 Remi Collet <remi@fedoraproject.org> - 4.0.0-0.7.20150227git4966955 +- don't display xdebug message when not on a tty +- add fedora-review-check script +- handle --without tests option to skip test suite during build + * Fri Feb 27 2015 Remi Collet <remi@fedoraproject.org> - 4.0.0-0.6.20150227git4966955 - update to 4.0.0beta3 |