summaryrefslogtreecommitdiffstats
path: root/php-theseer-fDOMDocument.spec
blob: c5f85e84bdc2bbfbcf0e8ff0f3d51e03ce3cf90a (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# remirepo/fedora spec file for php-theseer-fDOMDocument
#
# Copyright (c) 2013-2017 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%global gh_commit    8dcfd392135a5bd938c3c83ea71419501ad9855d
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner     theseer
%global gh_project   fDOMDocument
%global php_home     %{_datadir}/php/TheSeer
%global pear_name    fDOMDocument
%global pear_channel pear.netpirates.net

Name:           php-theseer-fDOMDocument
Version:        1.6.5
Release:        1%{?dist}
Summary:        An Extension to PHP standard DOM

Group:          Development/Libraries
License:        BSD
URL:            https://github.com/%{gh_owner}/%{gh_project}
Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz

BuildArch:      noarch
BuildRequires:  php(language) >= 5.3.3
# For test
%if 0%{?fedora} >= 26
%global phpunit %{_bindir}/phpunit6
%else
%global phpunit %{_bindir}/phpunit
%endif
BuildRequires:  %{phpunit}
BuildRequires:  php-dom
BuildRequires:  php-libxml
# Autoloader
BuildRequires:  php-fedora-autoloader-devel

# From composer.json, requires
#        "php": ">=5.3.3",
#        "ext-dom": "*",
#        "lib-libxml": "*"
Requires:       php(language) >= 5.3.3
Requires:       php-dom
Requires:       php-libxml
# From phpcompatinfo report for version 1.6.0
Requires:       php-pcre
Requires:       php-spl
# Autoloader
Requires:       php-composer(fedora/autoloader)

Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
Provides:       php-composer(theseer/fdomdocument) = %{version}


%description
An Extension to PHP's standard DOM to add various convenience methods
and exceptions by default


%prep
%setup -q -n %{gh_project}-%{gh_commit}


%build
: Generate a simple classmap autoloader
%{_bindir}/phpab --template fedora --output src/autoload.php src


%install
mkdir -p   %{buildroot}%{php_home}
cp -pr src %{buildroot}%{php_home}/%{gh_project}


%check
ret=0
for cmd in "php %{phpunit}" "php56 %{_bindir}/phpunit" php70 php71 php72; do
  if which $cmd; then
    set $cmd
    $1 ${2:-%{_bindir}/phpunit6} \
      --bootstrap %{buildroot}%{php_home}/%{gh_project}/autoload.php \
      --verbose || ret=1
  fi
done
exit $ret


%post
if [ -x %{_bindir}/pear ]; then
  %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
      %{pear_channel}/%{pear_name} >/dev/null || :
fi


%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.md composer.json
%{php_home}/%{gh_project}


%changelog
* Mon Apr 24 2017 Remi Collet <remi@remirepo.net> - 1.6.5-1
- Update to 1.6.5 (no change)
- sources from git archive (tests are back)

* Fri Apr 21 2017 Remi Collet <remi@remirepo.net> - 1.6.4-1
- Update to 1.6.4 (no change)
- sources from git snapshot to retrieve test suite

* Fri Apr 14 2017 Remi Collet <remi@remirepo.net> - 1.6.3-1
- Update to 1.6.3
- drop patch merged upstream

* Fri Apr 14 2017 Remi Collet <remi@remirepo.net> - 1.6.2-1
- Update to 1.6.2
- use phpunit6 when available
- add fix for PHP 7.2 and PHPUnit 6 from
  https://github.com/theseer/fDOMDocument/pull/29

* Thu May 28 2015 Remi Collet <remi@fedoraproject.org> - 1.6.1-1
- Update to 1.6.1

* Wed Nov 26 2014 Remi Collet <remi@fedoraproject.org> - 1.6.0-2
- switch from pear to github sources

* Sun Sep 14 2014 Remi Collet <remi@fedoraproject.org> - 1.6.0-1
- Update to 1.6.0
- provide php-composer(theseer/fdomdocument)

* Wed Feb 19 2014 Remi Collet <remi@fedoraproject.org> - 1.5.0-1
- Update to 1.5.0

* Sat Dec 21 2013 Remi Collet <remi@fedoraproject.org> - 1.4.3-1
- Update to 1.4.3 (stable)

* Sun Jun 30 2013 Remi Collet <remi@fedoraproject.org> - 1.4.2-1
- Update to 1.4.2

* Sun Apr 28 2013 Remi Collet <remi@fedoraproject.org> - 1.4.1-1
- Update to 1.4.1

* Fri Apr 26 2013 Remi Collet <remi@fedoraproject.org> - 1.4.0-1
- Update to 1.4.0

* Sun Oct 28 2012 Remi Collet <remi@fedoraproject.org> - 1.3.2-1
- Version 1.3.2 (stable) - API 1.3.0 (stable)
- run test units

* Thu Oct 11 2012 Remi Collet <remi@fedoraproject.org> - 1.3.1-1
- Version 1.3.1 (stable) - API 1.3.0 (stable)
- Initial packaging