summaryrefslogtreecommitdiffstats
path: root/php-goutte.spec
blob: ae3df761d5ab2cf9843b30601770df53984ffd62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
%global github_owner    fabpot
%global github_name     Goutte
%global github_version  1.0.5
%global github_commit   a30e84e28fbaf14909d2d007249c24cd0ecd425e

# "php": ">=5.3.0"
%global php_min_ver     5.3.0
# "guzzle/*": "~3.1"
%global guzzle_min_ver  3.1
%global guzzle_max_ver  4.0
# "symfony/*": "~2.1"
%global symfony_min_ver 2.1
%global symfony_max_ver 3.0

Name:          php-goutte
Version:       %{github_version}
Release:       1%{?github_release}%{?dist}
Summary:       A simple PHP web scraper

Group:         Development/Libraries
License:       MIT
URL:           https://github.com/%{github_owner}/%{github_name}
Source0:       %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz

BuildArch:     noarch
# For tests
BuildRequires: php(language)           >= %{php_min_ver}
BuildRequires: php-symfony-browserkit  >= %{symfony_min_ver}
BuildRequires: php-symfony-browserkit  <  %{symfony_max_ver}
BuildRequires: php-symfony-cssselector >= %{symfony_min_ver}
BuildRequires: php-symfony-cssselector <  %{symfony_max_ver}
BuildRequires: php-symfony-domcrawler  >= %{symfony_min_ver}
BuildRequires: php-symfony-domcrawler  <  %{symfony_max_ver}
BuildRequires: php-symfony-finder      >= %{symfony_min_ver}
BuildRequires: php-symfony-finder      <  %{symfony_max_ver}
BuildRequires: php-symfony-process     >= %{symfony_min_ver}
BuildRequires: php-symfony-process     <  %{symfony_max_ver}
BuildRequires: php-pear(guzzlephp.org/pear/Guzzle) >= %{guzzle_min_ver}
BuildRequires: php-pear(guzzlephp.org/pear/Guzzle) <  %{guzzle_max_ver}
BuildRequires: php-pear(pear.phpunit.de/PHPUnit)
# For tests: phpcompatinfo (computed from v1.0.5)
BuildRequires: php-curl

Requires:      php(language)           >= %{php_min_ver}
Requires:      php-symfony-browserkit  >= %{symfony_min_ver}
Requires:      php-symfony-browserkit  <  %{symfony_max_ver}
Requires:      php-symfony-cssselector >= %{symfony_min_ver}
Requires:      php-symfony-cssselector <  %{symfony_max_ver}
Requires:      php-symfony-domcrawler  >= %{symfony_min_ver}
Requires:      php-symfony-domcrawler  <  %{symfony_max_ver}
Requires:      php-symfony-finder      >= %{symfony_min_ver}
Requires:      php-symfony-finder      <  %{symfony_max_ver}
Requires:      php-symfony-process     >= %{symfony_min_ver}
Requires:      php-symfony-process     <  %{symfony_max_ver}
Requires:      php-pear(guzzlephp.org/pear/Guzzle) >= %{guzzle_min_ver}
Requires:      php-pear(guzzlephp.org/pear/Guzzle) <  %{guzzle_max_ver}
# phpcompatinfo (computed from v1.0.5)
Requires:      php-curl

%description
Goutte is a screen scraping and web crawling library for PHP.

Goutte provides a nice API to crawl websites and extract data
from the HTML/XML responses.


%prep
%setup -qn %{github_name}-%{github_commit}


%build
# Empty build section, nothing required


%install
mkdir -pm 0755 %{buildroot}/%{_datadir}/php/%{github_name}
cp -p %{github_name}/Client.php %{buildroot}/%{_datadir}/php/%{github_name}/


%check
# Create tests' bootstrap
mkdir vendor
cat > vendor/autoload.php <<'AUTOLOAD'
<?php
spl_autoload_register(function ($class) {
    $src = str_replace(array('\\', '_'), '/', $class).'.php';
    @include_once $src;
});
AUTOLOAD

# Create PHPUnit config w/ colors turned off
sed 's/colors="true"/colors="false"/' phpunit.xml.dist > phpunit.xml

%{_bindir}/phpunit -d date.timezone="UTC"


%files
%doc LICENSE README.rst composer.json
%{_datadir}/php/%{github_name}


%changelog
* Wed Feb 19 2014 Shawn Iwinski <shawn.iwinski@gmail.com> 1.0.5-1
- Updated to 1.0.5
- Conditional release dist
- Fixed %%files

* Mon Jan 27 2014 Shawn Iwinski <shawn.iwinski@gmail.com> 1.0.3-1.20140118gite83f8f9
- Initial package