summaryrefslogtreecommitdiffstats
path: root/php-phpdocumentor-reflection-docblock5.spec
blob: 9200ff278a1611dba8c254c2129a337a3f025561 (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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# Fedora/remirepo spec file for php-phpdocumentor-reflection-docblock5
#
# Copyright (c) 2017-2020 Remi Collet, Shawn Iwinski
#               2014-2015 Remi Collet
#
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%global gh_commit    cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner     phpDocumentor
%global gh_project   ReflectionDocBlock
%global major        5
%global with_tests   %{?_without_tests:0}%{!?_without_tests:1}

Name:           php-phpdocumentor-reflection-docblock%{major}
Version:        5.1.0
Release:        1%{?dist}
Summary:        DocBlock parser

License:        MIT
URL:            https://github.com/%{gh_owner}/%{gh_project}

# GitHub export does not include tests.
# Run php-phpdocumentor-reflection-docblock-get-source.sh to create full source.
Source0:       %{name}-%{version}-%{gh_short}.tar.gz
Source1:       makesrc.sh

BuildArch:      noarch
BuildRequires:  php-fedora-autoloader-devel
%if %{with_tests}
BuildRequires:  php(language) >= 7.2
BuildRequires:  php-filter
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(phpdocumentor/type-resolver)     >= 1.0   with php-composer(phpdocumentor/type-resolver)     <  2)
BuildRequires: (php-composer(webmozart/assert)                >= 1.0   with php-composer(webmozart/assert)                <  2)
BuildRequires: (php-composer(phpdocumentor/reflection-common) >= 2.0   with php-composer(phpdocumentor/reflection-common) <  3)
# remirepo:5
%else
BuildRequires:  php-phpdocumentor-reflection-common2
BuildRequires:  php-phpdocumentor-type-resolver1
BuildRequires:  php-webmozart-assert
%endif
# From composer.json, require-dev
#        "mockery/mockery": "^1",
#        "doctrine/instantiator": "^1"
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(mockery/mockery) >= 1.0 with php-composer(mockery/mockery) <  2)
# remirepo:3
%else
BuildRequires:  php-mockery                   >= 1.0
%endif
BuildRequires:  phpunit8
# From phpcompatinfo report for 5.0.0
BuildRequires:  php-reflection
BuildRequires:  php-pcre
BuildRequires:  php-spl
%endif

# From composer.json, require
#        "php": "^7.2",
#        "phpdocumentor/type-resolver": "^1.0",
#        "webmozart/assert": "^1",
#        "phpdocumentor/reflection-common": "^2.0",
#        "ext-filter": "^7.1"
Requires:       php(language) >= 7.2
Requires:       php-filter
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires:      (php-composer(phpdocumentor/type-resolver)     >= 1.0   with php-composer(phpdocumentor/type-resolver)     < 2)
Requires:      (php-composer(webmozart/assert)                >= 1.0   with php-composer(webmozart/assert)                < 2)
Requires:      (php-composer(phpdocumentor/reflection-common) >= 2.0   with php-composer(phpdocumentor/reflection-common) < 3)
# remirepo:5
%else
Requires:       php-phpdocumentor-reflection-common2
Requires:       php-phpdocumentor-type-resolver1
Requires:       php-webmozart-assert
%endif
# From phpcompatinfo report for 4.3.2
Requires:       php-reflection
Requires:       php-pcre
Requires:       php-spl
# Autoloader
Requires:       php-composer(fedora/autoloader)

Provides:       php-composer(phpdocumentor/reflection-docblock) = %{version}


%description
The ReflectionDocBlock component of phpDocumentor provides a DocBlock
parser that is fully compatible with the PHPDoc standard.

With this component, a library can provide support for annotations via
DocBlocks or otherwise retrieve information that is embedded in a DocBlock.

Autoloader: %{_datadir}/php/phpDocumentor/Reflection/DocBlock%{major}/autoload.php


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

sed 's#vendor/mockery/mockery/library/Mockery#%{_datadir}/php/Mockery1#' phpunit.xml.dist \
    > phpunit.xml

# single directory tree
mv src/*php src/DocBlock/


%build
phpab \
  --template fedora \
  --output src/DocBlock/autoload.php \
  src/

cat <<AUTOLOAD | tee -a src/DocBlock/autoload.php

\Fedora\Autoloader\Dependencies::required([
    '%{_datadir}/php/phpDocumentor/Reflection2/autoload-common.php',
    '%{_datadir}/php/phpDocumentor/Reflection2/autoload-type-resolver.php',
    '%{_datadir}/php/Webmozart/Assert/autoload.php',
]);
AUTOLOAD


%install
mkdir -p            %{buildroot}%{_datadir}/php/phpDocumentor/Reflection
cp -pr src/DocBlock %{buildroot}%{_datadir}/php/phpDocumentor/Reflection/DocBlock%{major}


%check
%if %{with_tests}
sed -e '/autoload.php/d' -i examples/*.php examples/*/*.php

phpab \
  --template fedora \
  --output bootstrap.php \
  tests/unit/

cat <<BOOTSTRAP | tee -a bootstrap.php

\Fedora\Autoloader\Dependencies::required([
    '%{buildroot}%{_datadir}/php/phpDocumentor/Reflection/DocBlock%{major}/autoload.php',
    '%{_datadir}/php/Mockery1/autoload.php',
]);
BOOTSTRAP

RETURN_CODE=0
for PHP_EXEC in php php72 php73 php74; do
    if which $PHP_EXEC; then
        $PHP_EXEC -d auto_prepend_file=$PWD/bootstrap.php \
            %{_bindir}/phpunit8 \
                --bootstrap bootstrap.php \
                --verbose || RETURN_CODE=1
    fi
done
exit $RETURN_CODE
%else
: Test suite disabled
%endif


%files
# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
%doc composer.json
%dir %{_datadir}/php/phpDocumentor/Reflection
     %{_datadir}/php/phpDocumentor/Reflection/DocBlock%{major}


%changelog
* Wed Feb 26 2020 Remi Collet <remi@remirepo.net> - 5.1.0-1
- update to 5.1.0
- drop unneeded hack as our PR was merged upstream

* Wed Feb 12 2020 Remi Collet <remi@remirepo.net> - 5.0.0-1
- update to 5.0.0
- rename to php-phpdocumentor-reflection-docblock5
- move to /usr/share/php/phpDocumentor/Reflection/DocBlock5
- raise dependency on PHP 7.2
- raise dependency on type-resolver 1
- raise dependency on reflection-common 2
- switch to phpunit8

* Fri Jan  3 2020 Remi Collet <remi@remirepo.net> - 4.3.4-1
- update to 4.3.4

* Fri Dec 20 2019 Remi Collet <remi@remirepo.net> - 4.3.3-1
- update to 4.3.3

* Fri Sep 13 2019 Remi Collet <remi@remirepo.net> - 4.3.2-1
- update to 4.3.2
- allow reflection-common 2.0
- allow type-resolver 1.0

* Thu May  2 2019 Remi Collet <remi@remirepo.net> - 4.3.1-1
- update to 4.3.1

* Wed Jan 31 2018 Remi Collet <remi@remirepo.net> - 4.3.0-1
- Update to 4.3.0

* Mon Jan 22 2018 Remi Collet <remi@remirepo.net> - 4.2.0-1
- Update to 4.2.0
- rename to php-phpdocumentor-reflection-docblock4
- move to /usr/share/php/phpDocumentor/Reflection/DocBlock4
- raise dependency on PHP 7.0
- raise dependency on phpdocumentor/type-resolver 0.4.0
- use phpunit6 and php-mockery for test suite

* Tue Aug  8 2017 Remi Collet <remi@remirepo.net> - 3.2.2-1
- Update to 3.2.2

* Mon Aug  7 2017 Remi Collet <remi@remirepo.net> - 3.2.1-2
- add patch to fix BC break, thanks to Koschei,  from
  https://github.com/phpDocumentor/ReflectionDocBlock/pull/113

* Sat Aug 05 2017 Shawn Iwinski <shawn@iwin.ski> - 3.2.1-1
- Update to 3.2.1 (RHBZ #1471379)

* Tue Jul 18 2017 Shawn Iwinski <shawn@iwin.ski> - 3.2.0-1
- Update to 3.2.0 (RHBZ #1471379)

* Fri May  5 2017 Shawn Iwinski <shawn@iwin.ski>, Remi Collet <remi@remirepo.net> - 3.1.1-1
- update to 3.1.1
- raise dependency on PHP 5.5
- add dependency on phpdocumentor/reflection-common
- add dependency on phpdocumentor/type-resolver
- add dependency on webmozart/assert
- switch to fedora/autoloader

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Feb 11 2015 Remi Collet <remi@fedoraproject.org> - 2.0.4-1
- update to 2.0.4
- LICENSE is in upstream archive

* Tue Feb  3 2015 Remi Collet <remi@fedoraproject.org> - 2.0.3-2
- add LICENSE from upstream repository

* Fri Dec 19 2014 Remi Collet <remi@fedoraproject.org> - 2.0.3-1
- initial package
- open https://github.com/phpDocumentor/ReflectionDocBlock/issues/40
  for missing LICENSE file