summaryrefslogtreecommitdiffstats
path: root/php-phpunit-phploc.spec
blob: dc675802e4f8c17e8b42a375883cdfe17d1a2555 (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
%global gh_commit    d177c22e2a08e448f7bdfa762045f7bd086834d7
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner     sebastianbergmann
%global gh_project   phploc
%global php_home     %{_datadir}/php/SebastianBergmann
%global pear_name    phploc
%global pear_channel pear.phpunit.de
%global with_tests   %{?_without_tests:0}%{!?_without_tests:1}

Name:           php-phpunit-phploc
Version:        2.0.5
Release:        2%{?dist}
Summary:        A tool for quickly measuring the size of a PHP project

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

# Autoload template
Source1:        autoload.php.in

# Fix for RPM, use autoload
Patch0:         %{gh_project}-rpm.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  php(language) >= 5.3.3
BuildRequires:  %{_bindir}/phpab
%if %{with_tests}
BuildRequires:  %{_bindir}/phpunit
BuildRequires:  php-phpunit-FinderFacade >= 1.1.0
BuildRequires:  php-phpunit-git >= 1.0.0
BuildRequires:  php-phpunit-Version >= 1.0.3
BuildRequires:  php-symfony-console >= 2.2.0
%endif

# From composer.json
Requires:       php(language) >= 5.3.3
Requires:       php-phpunit-FinderFacade >= 1.1.0
Requires:       php-phpunit-git >= 1.0.0
Requires:       php-phpunit-Version >= 1.0.3
Requires:       php-symfony-console >= 2.2.0
# From phpcompatinfo report for version 2.0.5
Requires:       php-dom
Requires:       php-spl
Requires:       php-tokenizer

# For compat
Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
Provides:       phploc = %{version}


%description
phploc is a tool for quickly measuring the size of a PHP project.

The goal of phploc is not not to replace more sophisticated tools such as phpcs,
pdepend, or phpmd, but rather to provide an alternative to them when you just
need to get a quick understanding of a project's size.


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

%patch0 -p1 -b .rpm


%build
phpab \
  --output   src/autoload.php \
  --template %{SOURCE1} \
  src


%install
rm -rf     %{buildroot}
mkdir -p   %{buildroot}%{php_home}
cp -pr src %{buildroot}%{php_home}/PHPLOC

install -D -p -m 755 phploc %{buildroot}%{_bindir}/phploc


%if %{with_tests}
%check
phpunit \
   --bootstrap src/autoload.php \
   -d date.timezone=UTC \
   tests
%endif


%clean
rm -rf %{buildroot}


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


%files
%defattr(-,root,root,-)
%doc LICENSE README.md composer.json
%{php_home}/PHPLOC
%{_bindir}/phploc


%changelog
* Sat May  3 2014 Remi Collet <remi@fedoraproject.org> - 2.0.5-2
- fix scriptlet

* Sat May  3 2014 Remi Collet <remi@fedoraproject.org> - 2.0.5-1
- update to 2.0.5
- sources from github
- run test suite during build

* Wed Dec 18 2013 Remi Collet <remi@fedoraproject.org> - 2.0.4-1
- Update to 2.0.4

* Tue Nov 05 2013 Remi Collet <remi@fedoraproject.org> - 2.0.3-1
- Update to 2.0.3

* Sun Sep 08 2013 Remi Collet <remi@fedoraproject.org> - 2.0.2-1
- Update to 2.0.2

* Wed Aug 28 2013 Remi Collet <remi@fedoraproject.org> - 2.0.0-1
- Update to 2.0.0
- add requires symfony2/Console, phpunit/Git and phpunit/Version
- drop requires ezc/Console

* Mon Nov 12 2012 Remi Collet <remi@fedoraproject.org> - 1.7.4-1
- Version 1.7.4 (stable) - API 1.7.0 (stable)

* Fri Nov  9 2012 Remi Collet <remi@fedoraproject.org> - 1.7.3-1
- Version 1.7.3 (stable) - API 1.7.0 (stable)

* Thu Oct 18 2012 Remi Collet <remi@fedoraproject.org> - 1.7.2-1
- Version 1.7.2 (stable) - API 1.7.0 (stable)

* Thu Oct 11 2012 Remi Collet <remi@fedoraproject.org> - 1.7.1-1
- Version 1.7.1 (stable) - API 1.7.0 (stable)
- use FinderFacade instead of File_Iterator
- raise dependecies: php >= 5.3.3

* Tue Nov 22 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.6.4-1
- upstream 1.6.4, rebuild for remi repository

* Sun Nov 20 2011 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.6.4-1
- upstream 1.6.4

* Thu Nov 03 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.6.2-1
- upstream 1.6.2, rebuild for remi repository

* Tue Nov  1 2011 Christof Damian <christof@damian.net> - 1.6.2-1
- upstream 1.6.2

* Sat Feb 12 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.6.1-1
- rebuild for remi repository

* Sat Feb 12 2011 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.6.1-1
- upstream 1.6.1

* Fri Feb 12 2010 Remi Collet <RPMS@FamilleCollet.com> - 1.5.1-1
- rebuild for remi repository

* Wed Feb 10 2010 Christof Damian <christof@damian.net> 1.5.1-1
- upstream 1.5.1
- changed requirements
- replaced define macros with global

* Sat Jan 16 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.5.0-2
- rebuild for remi repository

* Thu Jan 14 2010 Christof Damian <christof@damian.net> - 1.5.0-2
- add php 5.2.0 dependency
- remove hack to lower pear requirement

* Sun Jan  3 2010 Christof Damian <christof@damian.net> - 1.5.0-1
- upstream 1.5.0

* Fri Dec 18 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.4.0-2
- /usr/share/pear/PHPLOC wasn't owned

* Fri Dec 18 2009 Remi Collet <Fedora@FamilleCollet.com> - 1.4.0-1
- rebuild for remi repository

* Sat Dec 12 2009 Christof Damian <christof@damian.net> - 1.4.0-1
- upstream 1.4.0

* Wed Nov 11 2009 Remi Collet <Fedora@FamilleCollet.com> - 1.2.0-2
- rebuild for remi repository

* Sat Nov  7 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.2.0-2
- F-(10|11) compatibility

* Tue Oct 13 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.2.0-1
- Initial packaging