11%global github_owner schmittjoh
22%global github_name php-collection
3- %global github_version 0.1 .0
4- %global github_commit 360a888f246773e660fce0d175cf62e41f50dd22
3+ %global github_version 0.2 .0
4+ %global github_commit acb02a921bb364f360ce786b13455345063c4a07
55
66%global lib_name PhpCollection
77
88%global php_min_ver 5.3.0
9- %global phpoption_min_ver 0.9
9+ %global phpoption_min_ver 1.0
10+ %global phpoption_max_ver 2.0
1011
1112Name: php-%{lib_name }
1213Version: %{github_version }
@@ -16,23 +17,26 @@ Summary: General purpose collection library for PHP
1617Group: Development/Libraries
1718License: ASL 2.0
1819URL: http://jmsyst.com/libs/%{github_name }
19- Source0: https://github.com/%{github_owner }/%{github_name }/archive/%{github_commit }/%{name }-%{github_version }-%{github_commit }.tar.gz
20+ # To create source:
21+ # wget https://github.com/schmittjoh/php-collection/archive/%%{github_commit}.tar.gz
22+ # php-PhpCollection-strip.sh %%{github_version} %%{github_commit}
23+ Source0: %{name }-%{github_version }-%{github_commit }.tar.gz
2024
2125BuildArch: noarch
2226# Test build requires
23- BuildRequires: php-common >= %{php_min_ver }
27+ BuildRequires: php(language) >= %{php_min_ver }
2428BuildRequires: php-pear(pear.phpunit.de/PHPUnit)
2529BuildRequires: php-PhpOption >= %{phpoption_min_ver }
30+ BuildRequires: php-PhpOption < %{phpoption_max_ver }
2631# Test build requires:phpci
2732BuildRequires: php-spl
2833
29- Requires: php-common >= %{php_min_ver }
34+ Requires: php(language) >= %{php_min_ver }
3035Requires: php-PhpOption >= %{phpoption_min_ver }
36+ Requires: php-PhpOption < %{phpoption_max_ver }
3137# phpci requires
3238Requires: php-spl
3339
34- Conflicts: php-PhpOption >= 2.0
35-
3640%description
3741This library adds basic collections for PHP.
3842
@@ -63,25 +67,11 @@ General Characteristics:
6367 undefined (the default, and only PHP behavior).
6468
6569
66- %package tests
67- Summary: Test suite for %{name }
68- Group: Development/Libraries
69- Requires: %{name } = %{version }-%{release }
70-
71- %description tests
72- %{summary }.
73-
74-
7570%prep
7671%setup -q -n %{github_name }-%{github_commit }
7772
78- # PHPUnit config
79- sed 's:\(\./\)\?tests/:./:' -i phpunit.xml.dist
80- mv phpunit.xml.dist tests/
81-
8273# Rewrite tests' bootstrap (which uses Composer autoloader) with simple
8374# autoloader that uses include path
84- mv tests/bootstrap.php tests/bootstrap.php.dist
8575( cat << 'AUTOLOAD'
8676< ?php
8777spl_autoload_register(function ($class) {
@@ -100,25 +90,25 @@ AUTOLOAD
10090mkdir -p -m 755 %{buildroot }%{_datadir }/php
10191cp -rp src/%{lib_name } %{buildroot }%{_datadir }/php/
10292
103- mkdir -p -m 755 %{buildroot }%{_datadir }/tests/%{name }
104- cp -rp tests/* %{buildroot }%{_datadir }/tests/%{name }/
105-
10693
10794%check
10895%{_bindir }/phpunit \
10996 -d include_path=" ./src:./tests:.:%{pear_phpdir}:%{_datadir}/php" \
110- -c tests/ phpunit.xml.dist
97+ -c phpunit.xml.dist
11198
11299
113100%files
114101%doc LICENSE README.md composer.json
115102%{_datadir }/php/%{lib_name }
116103
117- %files tests
118- %dir %{_datadir }/tests
119- %{_datadir }/tests/%{name }
120-
121104
122105%changelog
106+ * Wed Jan 23 2013 Shawn Iwinski <shawn.iwinski@gmail.com> 0.2.0-1
107+ - Updated to version 0.2.0
108+ - Added phpoption_max_ver global
109+ - Bad licensed files stripped from source
110+ - php-common => php(language)
111+ - Removed tests sub-package
112+
123113* Wed Jan 23 2013 Shawn Iwinski <shawn.iwinski@gmail.com> 0.1.0-1
124114- Initial package
0 commit comments