summaryrefslogtreecommitdiffstats
path: root/php-pecl-parsekit.spec
blob: e0916fc038bc807247023b37e322a62cc8282daa (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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# remirepo spec file for php-pecl-parsekit
# with SCL compatibility, from Fedora:
#
# Fedora spec file for php-pecl-parsekit
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please, preserve the changelog entries
#

%{?scl:          %scl_package     php-pecl-parsekit}
%{!?__pecl:      %global __pecl   %{_bindir}/pecl}

%global pecl_name  parsekit
%global with_zts   0%{?__ztsphp:1}
%if "%{php_version}" < "5.6"
%global ini_name   %{pecl_name}.ini
%else
%global ini_name   40-%{pecl_name}.ini
%endif

Summary:       PHP Opcode Analyser
Name:          %{?scl_prefix}php-pecl-parsekit
Version:       1.3.0
Release:       8%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
# https://bugs.php.net/65937 - license file
License:       PHP
URL:           http://pecl.php.net/package/parsekit
Group:         Development/Libraries
Source0:       http://pecl.php.net/get/%{pecl_name}-%{version}.tgz

# https://bugs.php.net/bug.php?id=61187
Patch1:        php-pecl-parsekit-1.3-php-5.4.patch
# https://bugs.php.net/bug.php?id=67854
Patch2:        php-pecl-parsekit-1.3-php56-variadic-fix.patch

BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-devel

Requires:      %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires:      %{?scl_prefix}php(api) = %{php_core_api}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}

Provides:      %{?scl_prefix}php-%{pecl_name}               = %{version}
Provides:      %{?scl_prefix}php-%{pecl_name}%{?_isa}       = %{version}
Provides:      %{?scl_prefix}php-pecl(%{pecl_name})         = %{version}
Provides:      %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
Provides:      %{?scl_prefix}php-pecl-%{pecl_name}          = %{version}-%{release}
Provides:      %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa}  = %{version}-%{release}

%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
# Other third party repo stuff
Obsoletes:      php53-pecl-%{pecl_name}
Obsoletes:     php53u-pecl-%{pecl_name}
Obsoletes:     php53w-pecl-%{pecl_name}
Obsoletes:      php54-pecl-%{pecl_name}
Obsoletes:     php54w-pecl-%{pecl_name}
%if "%{php_version}" > "5.5"
Obsoletes:     php55u-pecl-%{pecl_name}
Obsoletes:     php55w-pecl-%{pecl_name}
%endif
%if "%{php_version}" > "5.4"
%endif
Obsoletes:     php56u-pecl-%{pecl_name}
Obsoletes:     php56w-pecl-%{pecl_name}
%endif

%if 0%{?fedora} < 20 && 0%{?rhel} < 7
# filter private shared
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
%{?filter_setup}
%endif


%description
Provides a userspace interpretation of the opcodes generated by the Zend engine
compiler built into PHP.

This extension is meant for development and debug purposes only and contains
some code which is potentially non-threadsafe.

Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.


%prep
%setup -qc

cd %{pecl_name}-%{version}
%patch1 -p2 -b .php54
%if "%{php_version}" > "5.6"
%patch2 -p2 -b .php56
%endif
cd ..

# Create configuration file
cat <<'EOF' > %{ini_name}
; Enable %{pecl_name} extension module
extension=%{pecl_name}.so
EOF

%if %{with_zts}
cp -r %{pecl_name}-%{version} %{pecl_name}-zts
%endif


%build
cd %{pecl_name}-%{version}
%{_bindir}/phpize
%configure \
    --with-%{pecl_name}\
    --with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}

%if %{with_zts}
cd ../%{pecl_name}-zts
%{_bindir}/zts-phpize
%configure \
    --with-%{pecl_name}\
    --with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags}
%endif


%install
rm -rf %{buildroot}

make install -C %{pecl_name}-%{version} install INSTALL_ROOT=%{buildroot}

# Drop in the bit of configuration
install -Dpm 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}

%if %{with_zts}
make install -C %{pecl_name}-zts        install INSTALL_ROOT=%{buildroot}
install -Dpm 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif

# Install XML package description
install -Dpm 0664 package2.xml %{buildroot}%{pecl_xmldir}/%{name}.xml


%check
# No test provided, just minimal load test
%{__php} --no-php-ini \
    --define extension_dir=%{buildroot}%{php_extdir} \
    --define extension=%{pecl_name}.so \
    -m | grep %{pecl_name}

%if %{with_zts}
%{__ztsphp} --no-php-ini \
    --define extension_dir=%{buildroot}%{php_ztsextdir} \
    --define extension=%{pecl_name}.so \
    -m | grep %{pecl_name}
%endif


%if 0%{?fedora} < 24
# when pear installed alone, after us
%triggerin -- %{?scl_prefix}php-pear
if [ -x %{__pecl} ] ; then
    %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
fi

# posttrans as pear can be installed after us
%posttrans
if [ -x %{__pecl} ] ; then
    %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
fi

%postun
if [ $1 -eq 0 -a -x %{__pecl} ] ; then
    %{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
%endif


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc %{pecl_name}-%{version}/examples
%doc %{pecl_name}-%{version}/README
%{pecl_xmldir}/%{name}.xml

%{php_extdir}/%{pecl_name}.so
%config(noreplace) %{php_inidir}/%{ini_name}

%if %{with_zts}
%{php_ztsextdir}/%{pecl_name}.so
%config(noreplace) %{php_ztsinidir}/%{ini_name}
%endif


%changelog
* Tue Mar  8 2016 Remi Collet <remi@fedoraproject.org> - 1.3.0-8
- adapt for F24
- drop runtime dependency on pear, new scriptlets

* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 1.3.0-7.1
- Fedora 21 SCL mass rebuild

* Mon Aug 25 2014 Remi Collet <rcollet@redhat.com> - 1.3.0-7
- allow SCL build

* Mon Aug 18 2014 Remi Collet <RPMS@famillecollet.com> - 1.3.0-6
- backport rawhide change (php 5.6 patch) for remi-repo
- add numerical prefix to extension configuration file

* Mon Aug 18 2014 Pavel Alexeev <Pahan@Hubbitus.info> - 1.3.0-6
- Fix FBFS bz#1111492 - ( https://bugs.php.net/bug.php?id=67854 )
  add Patch2: php-pecl-parsekit-1.3-php56-variadic-fix.patch
  Based on introduced incompatability from commit
  https://github.com/php/php-src/commit/0d7a6388663b76ebed6585ac92dfca5ef65fa7af

* Sat Jan  5 2013 Remi Collet <RPMS@famillecollet.com> - 1.3.0-2
- also provides php-parsekit

* Sun Oct  7 2012 Remi Collet <RPMS@famillecollet.com> - 1.3.0-1
- latest changes from rawhide (rebase on upstream 1.3.0)

* Sat Oct 6 2012 Pavel Alexeev <Pahan@Hubbitus.info> - 1.3.0-1
- Update to upstream release.
- Use pecl package.xml 2.0 version (bz#860331).

* Wed Sep 12 2012 Remi Collet <remi@fedoraproject.org> - 1.3-2.CVS20120226
- standardize for remi repo, lot of cleanups
- add ZTS extension
- add %%check section: minimal load test

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-2.CVS20120226
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sun Mar 4 2012 Pavel Alexeev <Pahan@Hubbitus.info> 1.3-1.CVS20120226
- Change release enumerate manner as 1.3 was already released (Thanks to Remi Collet).

* Sun Feb 26 2012 Pavel Alexeev <Pahan@Hubbitus.info> 1.3-0.1.CVS20120226
- Update to 1.3 branch, try fix FBFS on PHP 5.4.
- Urls by patch wrote:
   https://bugs.php.net/bug.php?id=61187
   http://fossies.org/unix/www/php-5.4.0RC8.tar.gz:a/php-5.4.0RC8/NEWS
   http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/Zend/zend_compile.h?r1=298202&r2=298203&
   http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/Zend/zend_compile.h?annotate=321634
   http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/Zend/zend_compile.h?r1=301081&r2=303381
- Add patch php-pecl-parsekit-1.3-php-5.4.patch

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-8.CVS20090309
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Sep 12 2011 Pavel Alexeev <Pahan@Hubbitus.info> - 1.2-7.CVS20090309
- Fix FBFS f16-17. Bz#716157

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-6.CVS20090309
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-5.CVS20090309
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jul 13 2009 Remi Collet <Fedora@FamilleCollet.com> - 1.2-4.CVS20090309
- rebuild for new PHP 5.3.0 ABI (20090626)

* Tue Jun 30 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 1.2-3.CVS20090309
- Most of changes inspired by continue Fedora review by Jason Tibbitts.
- Prefer %%global over %%define
- Source0 is not URL now for CVS build.
- "PECL" prefix removed from summary.
- Add %%release part into BuildRoot tag.
- Add more magic into Release define and fit it into one line.OD

* Mon Mar 9 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 1.2-2.CVS20090309
- php-pecl-parsekit.Hu.spec renamed to normal php-pecl-parsekit.spec
- In Version changhes: As it is post release enumereate it after 0. Remove Hu-part.
- New CVS checkout 20090309
- Add php_apiver and __pecl macroses define. Remove peardir.
- Remove define macros xmldir and replace it by common pecl_xmldir
- Add comment of command how to get source.
- Add patch Patch2: php-pecl-parsekit-1.2.APIstatic.patch to allow build on recent versions.
- Fix several inconsistent macros usages.
- Add standard Requires/provides of php-api, abi, zend abi, php-pecl(%%peclName) = %%{version}...
- Delete pathces, which is not needed anymore in ew checkout.
- Remove Obsoletes:   php-pear-%%peclName
- Add Requires(post):   %%{__pecl} and Requires(postun):   %%{__pecl}
- Rpmlint warnings:
   o Mixed spaces turned to tabs.
   o Descrioption line too long: splited.
   o License from "PHP License" changed to just PHP
   o script-without-shebang /usr/share/pear/.pkgxml/parsekit.xml: chmod to 0664

* Tue May 13 2008 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] spb [ dOt.] su> - 1.2-0.CVS20080513.Hu.0
- Initial spec (copy of php-pecl-imagick.Hu.spec)
- Add (import from runkit spec-file) CVS-build support
- Add patches:
   Patch0:      php-pecl-parsekit-php51.patch (http://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg28512.html)
   Patch1:      php-pecl-parsekit-1.2-PHP5.3.0.patch (self)
- Post and Pustun steps replaced by it is macroses-representated form (from php-pecl-phar)