[php-phpunit-PHPUnit-SkeletonGenerator] sources from github

Remi Collet remi at fedoraproject.org
Tue Apr 29 10:29:53 UTC 2014


commit 23ed3eb187706d3ffd73f19da4d851d94c8030d7
Author: Remi Collet <remi at fedoraproject.org>
Date:   Tue Apr 29 12:29:50 2014 +0200

    sources from github

 .gitignore                                 |    1 +
 php-phpunit-PHPUnit-SkeletonGenerator.spec |   95 ++++++++++++++++-----------
 sources                                    |    2 +-
 3 files changed, 58 insertions(+), 40 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6dc129a..c33ae5e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ package-*.xml
 /PHPUnit_SkeletonGenerator-1.1.0.tgz
 /PHPUnit_SkeletonGenerator-1.2.0.tgz
 /PHPUnit_SkeletonGenerator-1.2.1.tgz
+/phpunit-skeleton-generator-1.2.1.tar.gz
diff --git a/php-phpunit-PHPUnit-SkeletonGenerator.spec b/php-phpunit-PHPUnit-SkeletonGenerator.spec
index 95874a2..9b21071 100644
--- a/php-phpunit-PHPUnit-SkeletonGenerator.spec
+++ b/php-phpunit-PHPUnit-SkeletonGenerator.spec
@@ -1,37 +1,46 @@
-%{!?pear_metadir: %global pear_metadir %{pear_phpdir}}
-%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
-%global pear_name PHPUnit_SkeletonGenerator
-%global channel   pear.phpunit.de
+# spec file for php-phpunit-PHPUnit-SkeletonGenerator
+#
+# Copyright (c) 2012-2014 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/3.0/
+#
+# Please, preserve the changelog entries
+#
+%global gh_commit    8a524d3a65ebebc89ce63c937b9e5a4b305e90e1
+%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner     sebastianbergmann
+%global gh_project   phpunit-skeleton-generator
+%global php_home     %{_datadir}/php
+%global pear_name    PHPUnit_SkeletonGenerator
+%global pear_channel pear.phpunit.de
+# Circular dependency with phpunit
+%global with_tests   %{?_with_tests:1}%{!?_with_tests:0}
 
 Name:           php-phpunit-PHPUnit-SkeletonGenerator
 Version:        1.2.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Tool that can generate skeleton test classes
 
 Group:          Development/Libraries
 License:        BSD
-URL:            http://pear.phpunit.de/
-Source0:        http://pear.phpunit.de/get/%{pear_name}-%{version}.tgz
+URL:            https://github.com/%{gh_owner}/%{gh_project}
+Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz
 
 BuildArch:      noarch
 BuildRequires:  php(language) >= 5.3.3
-BuildRequires:  php-pear(PEAR) >= 1.9.4
-BuildRequires:  php-channel(%{channel})
 
-Requires(post): %{__pear}
-Requires(postun): %{__pear}
 Requires:       php(language) >= 5.3.3
 Requires:       php-date
 Requires:       php-pcre
 Requires:       php-reflection
 Requires:       php-spl
 Requires:       php-tokenizer
-Requires:       php-pear(PEAR) >= 1.9.4
-Requires:       php-channel(%{channel})
-Requires:       php-pear(%{channel}/Text_Template) >= 1.1.1
+Requires:       php-phpunit-Text-Template >= 1.1.1
 Requires:       php-pear(components.ez.no/ConsoleTools) >= 1.6
 
-Provides:       php-pear(%{channel}/%{pear_name}) = %{version}
+# For compatibility with PEAR mode
+Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
+
 
 %description
 Tool that can generate skeleton test classes from production code classes
@@ -39,48 +48,56 @@ and vice versa.
 
 
 %prep
-%setup -q -c
-cd %{pear_name}-%{version}
-# Package.xml is V2
-mv ../package.xml %{name}.xml
+%setup -q -n %{gh_project}-%{gh_commit}
+
+rm src/autoload.php.in
+
+# Fix loader
+sed -e 's:/usr/bin/env php:/%{_bindir}/php:' \
+    -e 's:@php_bin@:%{php_home}:' \
+    -i phpunit-skelgen.php
 
 
 %build
-cd %{pear_name}-%{version}
 # Empty build section, most likely nothing required.
 
+# If upstream drop Autoload.php, command to generate it.
+# Also remember to fix the command to use it.
 
-%install
-cd %{pear_name}-%{version}
-%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
+#phpab \
+#  --output   src/autoload.php \
+#  --template src/autoload.php.in \
+#  src
 
-# 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}
+%install
+mkdir -p   %{buildroot}%{php_home}/SebastianBergmann/PHPUnit
+cp -pr src %{buildroot}%{php_home}/SebastianBergmann/PHPUnit/SkeletonGenerator
 
+install -D -p -m 755 phpunit-skelgen.php %{buildroot}%{_bindir}/phpunit-skelgen
 
-%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 \
-        %{channel}/%{pear_name} >/dev/null || :
-fi
+%if %{with_tests}
+%check
+phpunit \
+  --test-suffix .phpt \
+  -d date.timezone=UTC \
+  tests
+%endif
 
 
 %files
-%doc %{pear_docdir}/%{pear_name}
-%{pear_xmldir}/%{name}.xml
+%doc README.markdown ChangeLog.markdown LICENSE
 %{_bindir}/phpunit-skelgen
-%{pear_phpdir}/SebastianBergmann/PHPUnit/SkeletonGenerator
+%dir %{php_home}/SebastianBergmann
+%dir %{php_home}/SebastianBergmann/PHPUnit
+     %{php_home}/SebastianBergmann/PHPUnit/SkeletonGenerator
 
 
 %changelog
+* Tue Apr 29 2014 Remi Collet <remi at fedoraproject.org> - 1.2.1-3
+- sources from github
+
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.2.1-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 
diff --git a/sources b/sources
index ddc8278..743de5a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-1686e7a4e7387250d8eab12f88060931  PHPUnit_SkeletonGenerator-1.2.1.tgz
+2dcae746b005967bd5559bfdc6eb0b0e  phpunit-skeleton-generator-1.2.1.tar.gz


More information about the scm-commits mailing list