Skip to content

Commit d573576

Browse files
committed
[php-PhpCollection] Updated to version 0.2.0
- Added phpoption_max_ver global - Bad licensed files stripped from source - php-common => php(language) - Removed tests sub-package
1 parent 86c2c10 commit d573576

File tree

2 files changed

+46
-30
lines changed

2 files changed

+46
-30
lines changed

php-PhpCollection-strip.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
if [ $# != 2 ]; then
4+
echo "Usage: $0 VERSION GITHUB_COMMIT" 1>&2
5+
exit 1
6+
fi
7+
8+
VERSION=$1
9+
GITHUB_COMMIT=$2
10+
11+
ORIGINAL_SOURCE_FILE="${GITHUB_COMMIT}.tar.gz"
12+
NEW_SOURCE_FILE="php-PhpCollection-${VERSION}-${GITHUB_COMMIT}.tar.gz"
13+
14+
if [ ! -f "$ORIGINAL_SOURCE_FILE" ]; then
15+
echo "ERROR: Original source file '${ORIGINAL_SOURCE_FILE}' not found" 1>&2
16+
exit 1
17+
fi
18+
19+
TAR=`which tar`
20+
21+
$TAR -xzf "$ORIGINAL_SOURCE_FILE"
22+
rm -rf "php-collection-${GITHUB_COMMIT}/doc" "$NEW_SOURCE_FILE"
23+
$TAR -czf "$NEW_SOURCE_FILE" "php-collection-${GITHUB_COMMIT}"
24+
25+
echo "${NEW_SOURCE_FILE} created"
26+
exit 0

php-PhpCollection.spec

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
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

1112
Name: php-%{lib_name}
1213
Version: %{github_version}
@@ -16,23 +17,26 @@ Summary: General purpose collection library for PHP
1617
Group: Development/Libraries
1718
License: ASL 2.0
1819
URL: 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

2125
BuildArch: noarch
2226
# Test build requires
23-
BuildRequires: php-common >= %{php_min_ver}
27+
BuildRequires: php(language) >= %{php_min_ver}
2428
BuildRequires: php-pear(pear.phpunit.de/PHPUnit)
2529
BuildRequires: php-PhpOption >= %{phpoption_min_ver}
30+
BuildRequires: php-PhpOption < %{phpoption_max_ver}
2631
# Test build requires:phpci
2732
BuildRequires: php-spl
2833

29-
Requires: php-common >= %{php_min_ver}
34+
Requires: php(language) >= %{php_min_ver}
3035
Requires: php-PhpOption >= %{phpoption_min_ver}
36+
Requires: php-PhpOption < %{phpoption_max_ver}
3137
# phpci requires
3238
Requires: php-spl
3339

34-
Conflicts: php-PhpOption >= 2.0
35-
3640
%description
3741
This 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
8777
spl_autoload_register(function ($class) {
@@ -100,25 +90,25 @@ AUTOLOAD
10090
mkdir -p -m 755 %{buildroot}%{_datadir}/php
10191
cp -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

Comments
 (0)