blob: 6fcdbe7177a1f42bb0a50ec1bd199fc235165a4e (
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
|
# remirepo/fedora spec file for php-theseer-tokenizer
#
# Copyright (c) 2017-2021 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%global gh_commit 34a41e998c2183e22995f158c581e7b5e755ab9e
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_vendor theseer
%global gh_project tokenizer
%global ns_vendor TheSeer
%global ns_project Tokenizer
Name: php-%{gh_vendor}-%{gh_project}
Version: 1.2.1
Release: 1%{?dist}
Summary: Library for converting tokenized PHP source code into XML
License: BSD
URL: https://github.com/%{gh_vendor}/%{gh_project}
Source0: %{name}-%{version}-%{?gh_short}.tgz
Source1: makesrc.sh
BuildArch: noarch
BuildRequires: php(language) >= 7.0
BuildRequires: php-xmlwriter
BuildRequires: php-dom
BuildRequires: php-tokenizer
BuildRequires: php-pcre
BuildRequires: php-spl
# Autoloader
BuildRequires: php-fedora-autoloader-devel >= 1.0.0
# Tests
%global phpunit %{_bindir}/phpunit7
BuildRequires: %{phpunit}
# From composer.json, "require": {
# "php": "^7.0 || ^8.0",
# "ext-xmlwriter": "*",
# "ext-dom": "*",
# "ext-tokenizer": "*"
Requires: php(language) >= 7.0
Requires: php-xmlwriter
Requires: php-dom
Requires: php-tokenizer
# From phpcompatinfo report for version 1.1.0
Requires: php-pcre
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
Provides: php-composer(%{gh_vendor}/%{gh_project}) = %{version}
%description
A small library for converting tokenized PHP source code into XML
and potentially other formats.
Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php
%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}%{_datadir}/php/%{ns_vendor}
cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}
%check
ret=0
for cmdarg in "php %{phpunit}" php73 php74 php80; do
if which $cmdarg; then
set $cmdarg
$1 -d auto_prepend_file=%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php \
${2:-%{_bindir}/phpunit7} \
--no-coverage --verbose || ret=1
fi
done
exit $ret
%files
# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.md composer.json
%dir %{_datadir}/php/%{ns_vendor}
%{_datadir}/php/%{ns_vendor}/%{ns_project}
%changelog
* Wed Jul 28 2021 Remi Collet <remi@remirepo.net> - 1.2.1-1
- update to 1.2.1
* Mon Jul 13 2020 Remi Collet <remi@remirepo.net> - 1.2.0-1
- update to 1.2.0
- sources from git snapshot
* Fri Jun 14 2019 Remi Collet <remi@remirepo.net> - 1.1.3-1
- update to 1.1.3
* Thu Apr 4 2019 Remi Collet <remi@remirepo.net> - 1.1.2-1
- update to 1.1.2 (no change)
- switch back to phpunit 6 and 7
* Thu Apr 4 2019 Remi Collet <remi@remirepo.net> - 1.1.1-2
- add patch from https://github.com/theseer/tokenizer/pull/4
and use phpunit7 with 7.1
* Thu Apr 4 2019 Remi Collet <remi@remirepo.net> - 1.1.1-1
- update to 1.1.1
- use phpunit8
* Fri Apr 21 2017 Remi Collet <remi@remirepo.net> - 1.1.0-1
- initial package, version 1.1.0
|