summaryrefslogtreecommitdiffstats
path: root/php-phpdocumentor-reflection-docblock2.spec
blob: ce0be2a526587fce4cbdb78c5052c5aafe92ee66 (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
# spec file for php-phpdocumentor-reflection-docblock2
#
# Copyright (c) 2014-2015 Remi Collet
#               2017 Remi Collet, Shawn Iwinski
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%global gh_commit    d68dbdc53dc358a816f00b300704702b2eaff7b8
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner     phpDocumentor
%global gh_project   ReflectionDocBlock
%global with_tests   %{?_without_tests:0}%{!?_without_tests:1}

Name:           php-phpdocumentor-reflection-docblock2
Version:        2.0.4
Release:        5%{?dist}
Summary:        DocBlock parser (Version 2)

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

BuildArch:      noarch
BuildRequires:  php(language) >= 5.3.3
BuildRequires:  php-composer(phpunit/phpunit)
# Autoloader
BuildRequires:  php-fedora-autoloader-devel

# From composer.json, require
#        "php": ">=5.3.3"
# From composer.json, suggest
#        "dflydev/markdown": "1.0.*",
#        "erusev/parsedown": "~0.7"
Requires:       php(language) >= 5.3.3
# From phpcompatinfo report for 2.0.3
Requires:       php-pcre
Requires:       php-spl
# Autoloader
Requires:       php-composer(fedora/autoloader)

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

# Package rename (php-phpdocumentor-reflection-docblock => php-phpdocumentor-reflection-docblock2)
Obsoletes:      php-phpdocumentor-reflection-docblock < 2.0.4-5
Provides:       php-phpdocumentor-reflection-docblock = %{version}-%{release}
Conflicts:      drush < 8.1.10-2
Conflicts:      php-bartlett-PHP-Reflect < 4.0.2-3
Conflicts:      php-consolidation-annotated-command < 2.4.8
Conflicts:      php-phpdocumentor-reflection < 1.0.7-3
Conflicts:      php-phpspec-prophecy < 1.7.0-4


%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.


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

mv src/phpDocumentor/Reflection/DocBlock src/phpDocumentor/Reflection/DocBlock2
mv src/phpDocumentor/Reflection/DocBlock.php src/phpDocumentor/Reflection/DocBlock2.php


%build
phpab \
  --template fedora \
  --output   src/phpDocumentor/Reflection/DocBlock2/autoload.php \
  src/phpDocumentor/Reflection


%install
mkdir -p     %{buildroot}%{_datadir}/php
cp -pr src/* %{buildroot}%{_datadir}/php


%check
%if %{with_tests}
: Upstream tests
RETURN_CODE=0
for PHP_EXEC in %{_bindir}/php %{?rhel:php54 php55} php56 php70 php71; do
    if [ "%{_bindir}/php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
        $PHP_EXEC %{_bindir}/phpunit --verbose \
            --bootstrap %{buildroot}%{_datadir}/php/phpDocumentor/Reflection/DocBlock2/autoload.php \
            || RETURN_CODE=1
    fi
done
exit $RETURN_CODE
%else
: Test suite disabled
%endif


%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
%doc composer.json
%dir %{_datadir}/php/phpDocumentor
%dir %{_datadir}/php/phpDocumentor/Reflection
     %{_datadir}/php/phpDocumentor/Reflection/DocBlock2*


%changelog
* Thu Apr 13 2017 Shawn Iwinski <shawn@iwin.ski> - 2.0.4-5
- Package rename (php-phpdocumentor-reflection-docblock =>
  php-phpdocumentor-reflection-docblock2)
- Switch autoloader to php-composer(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