From e17c9b8c0f11d87a3b96e8bd61f2308ac9015a1c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 3 May 2014 19:02:26 +0200 Subject: php-phpunit-phploc: 2.0.5, sources from github --- autoload.php.in | 25 +++++++++++ php-phpunit-phploc.spec | 111 ++++++++++++++++++++++++++++-------------------- phploc-rpm.patch | 34 +++++++++++++++ 3 files changed, 124 insertions(+), 46 deletions(-) create mode 100644 autoload.php.in create mode 100644 phploc-rpm.patch diff --git a/autoload.php.in b/autoload.php.in new file mode 100644 index 0000000..52a3f0c --- /dev/null +++ b/autoload.php.in @@ -0,0 +1,25 @@ += 1.9.4 -BuildRequires: php-channel(%{pear_channel}) - -Requires(post): %{__pear} -Requires(postun): %{__pear} -# From package.xml +BuildRequires: php(language) >= 5.3.3 +BuildRequires: %{_bindir}/phpab +%if %{with_tests} +BuildRequires: %{_bindir}/phpunit +BuildRequires: php-phpunit-FinderFacade >= 1.1.0 +BuildRequires: php-phpunit-git >= 1.0.0 +BuildRequires: php-phpunit-Version >= 1.0.3 +BuildRequires: php-symfony-console >= 2.2.0 +%endif + +# From composer.json Requires: php(language) >= 5.3.3 -Requires: php-tokenizer -Requires: php-pear(PEAR) >= 1.9.4 -Requires: php-channel(%{pear_channel}) -Requires: php-pear(pear.symfony.com/Console) >= 2.2.0 -Requires: php-pear(%{pear_channel}/FinderFacade) >= 1.1.0 -Requires: php-pear(%{pear_channel}/Git) >= 1.0.0 -Requires: php-pear(%{pear_channel}/Version) >= 1.0.0 -# From phpcompatinfo report for version 2.0.3 +Requires: php-phpunit-FinderFacade >= 1.1.0 +Requires: php-phpunit-git >= 1.0.0 +Requires: php-phpunit-Version >= 1.0.3 +Requires: php-symfony-console >= 2.2.0 +# From phpcompatinfo report for version 2.0.5 Requires: php-dom Requires: php-spl +Requires: php-tokenizer +# For compat Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version} +Provides: phploc = %{version} %description @@ -45,54 +59,59 @@ need to get a quick understanding of a project's size. %prep -%setup -q -c -[ -f package2.xml ] || mv package.xml package2.xml -%{__mv} package2.xml %{pear_name}-%{version}/%{name}.xml -cd %{pear_name}-%{version} +%setup -q -n %{gh_project}-%{gh_commit} + +%patch0 -p1 -b .rpm + %build -cd %{pear_name}-%{version} -# Empty build section, most likely nothing required. +phpab \ + --output src/autoload.php \ + --template %{SOURCE1} \ + src %install -cd %{pear_name}-%{version} -%{__rm} -rf %{buildroot} docdir -%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml +rm -rf %{buildroot} +mkdir -p %{buildroot}%{php_home} +cp -pr src %{buildroot}%{php_home}/PHPLOC + +install -D -p -m 755 phploc %{buildroot}%{_bindir}/phploc -# Clean up unnecessary files -%{__rm} -rf %{buildroot}%{pear_metadir}/.??* -# Install XML package description -%{__mkdir} -p %{buildroot}%{pear_xmldir} -%{__install} -pm 644 %{name}.xml %{buildroot}%{pear_xmldir} +%if %{with_tests} +%check +phpunit \ + --bootstrap src/autoload.php \ + -d date.timezone=UTC \ + tests +%endif %clean -%{__rm} -rf %{buildroot} +rm -rf %{buildroot} %post -%{__pear} install --nodeps --soft --force --register-only \ - %{pear_xmldir}/%{name}.xml >/dev/null || : - - -%postun -if [ $1 -eq 0 ] ; then - %{__pear} uninstall --nodeps --ignore-errors --register-only \ - %{pear_channel}/%{pear_name} >/dev/null || : +if [ -x %{_bindir}/pear ]; then + %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \ + %{pear_channel}/%{pear_name} >/dev/null || : fi %files %defattr(-,root,root,-) -%doc %{pear_docdir}/%{pear_name} -%{pear_xmldir}/%{name}.xml -%{pear_phpdir}/SebastianBergmann/PHPLOC +%doc LICENSE README.md composer.json +%{php_home}/PHPLOC %{_bindir}/phploc %changelog +* Sat May 3 2014 Remi Collet - 2.0.5-1 +- update to 2.0.5 +- sources from github +- run test suite during build + * Wed Dec 18 2013 Remi Collet - 2.0.4-1 - Update to 2.0.4 diff --git a/phploc-rpm.patch b/phploc-rpm.patch new file mode 100644 index 0000000..fc04bb6 --- /dev/null +++ b/phploc-rpm.patch @@ -0,0 +1,34 @@ +diff -up ./phploc.rpm ./phploc +--- ./phploc.rpm 2014-05-03 18:50:56.000000000 +0200 ++++ ./phploc 2014-05-03 18:51:38.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env php ++#!/usr/bin/php + run(); -- cgit