summaryrefslogtreecommitdiffstats
path: root/php-pecl-runkit.spec
blob: ddb4ef6763aebfcfdf3c47b3f8939a721c3b1689 (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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# remirepo spec file for php-pecl-runkit
# with SCL compatibility from:

# Fedora spec file for php-pecl-runkit
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please, preserve the changelog entries
#
%if 0%{?scl:1}
%if "%{scl}" == "rh-php56"
%global sub_prefix more-php56-
%else
%global sub_prefix %{scl_prefix}
%endif
%endif

%{?scl:          %scl_package         php-pecl-runkit}

%global pecl_name   runkit
%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
%global channel     zenovich.github.io/pear

Summary:          Mangle with user defined functions and classes
Name:             %{?sub_prefix}php-pecl-%{pecl_name}
Version:          1.0.4
Release:          4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License:          PHP
Group:            Development/Libraries
# URL:            http://pecl.php.net/package/runkit/
# New upstream URL - https://bugs.php.net/bug.php?id=61189
URL:              https://github.com/zenovich/runkit

Source0:          http://pecl.php.net/get/%{pecl_name}-%{version}.tgz

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}  <= %{version}
Obsoletes:     php53u-pecl-%{pecl_name} <= %{version}
Obsoletes:     php54-pecl-%{pecl_name}  <= %{version}
Obsoletes:     php54w-pecl-%{pecl_name} <= %{version}
%if "%{php_version}" > "5.5"
Obsoletes:     php55u-pecl-%{pecl_name} <= %{version}
Obsoletes:     php55w-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "5.6"
Obsoletes:     php56u-pecl-%{pecl_name} <= %{version}
Obsoletes:     php56w-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "7.0"
Obsoletes:     php70u-pecl-%{pecl_name} <= %{version}
Obsoletes:     php70w-pecl-%{pecl_name} <= %{version}
%endif
%endif

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


%description
Replace, rename, and remove user defined functions and classes. Define
customized superglobal variables for general purpose use. Execute code
in restricted environment (sandboxing).

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 -q -c
mv runkit-%{version} NTS

# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
    %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
    -i package.xml

cd NTS
sed -e 's/-Werror//' -i config.m4

extver=$(sed -n '/#define PHP_RUNKIT_VERSION/{s/.*\t"//;s/".*$//;p}' php_runkit.h)
if test "x${extver}" != "x%{version}%{?prever}"; then
   : Error: Upstream version is ${extver}, expecting %{version}%{?prever}.
   exit 1
fi
cd ..

%if %{with_zts}
# duplicate for ZTS build
cp -pr NTS ZTS
%endif

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


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

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


%install
make install -C NTS install INSTALL_ROOT=%{buildroot}

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

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

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

# Documentation
cd NTS
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done


%check
# See https://github.com/zenovich/runkit/pull/93
rm ?TS/tests/runkit_fpm_internal_function_restore.phpt

# Minimal load test
%{__php} --no-php-ini \
    --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
    -m | grep %{pecl_name}

# Provided test suite
cd NTS
TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="-n -d extension_dir=%{buildroot}%{php_extdir} -d extension=%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{_bindir}/php -n run-tests.php --show-diff

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

cd ../ZTS
TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n -d extension_dir=%{buildroot}%{php_ztsextdir} -d extension=%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{_bindir}/php -n run-tests.php --show-diff
%endif


%if 0%{?fedora} < 24 && 0%{?rhel} < 8
# 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


%files
%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{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
* Mon Jan 21 2019 Remi Collet <remi@remirepo.net> - 1.0.4-4
- cleanup for EL-8

* Tue Mar  8 2016 Remi Collet <remi@fedoraproject.org> - 1.0.4-3
- adapt for F24
- fix license management

* Mon Oct 19 2015 Remi Collet <remi@fedoraproject.org> - 1.0.4-2
- switch to pecl sources

* Tue Oct 13 2015 Remi Collet <remi@fedoraproject.org> - 1.0.4-1
- update to 1.0.4
- drop runtime dependency on pear, new scriptlets
- don't install/register tests
- add virtual provides for php-zenovich-runkit and
  php-pecl(zenovich.github.io/pear/runkit)

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

* Mon Aug 25 2014 Remi Collet <rcollet@redhat.com> - 1.0.4-0.8.git5e179e9
- improve SCL build

* Wed Apr 16 2014 Remi Collet <remi@fedoraproject.org> - 1.0.4-0.7.git5e179e9
- add numerical prefix to extension configuration file (php 5.6)

* Wed Mar 19 2014 Remi Collet <rcollet@redhat.com> - 1.0.4-0.6.git5e179e9
- allow SCL build

* Tue Mar 18 2014 Remi Collet <remi@fedoraproject.org> - 1.0.4-0.5.git5e179e9
- cleanups
- install doc in pecl_docdir
- install tests in pecl_testdir
- make ZTS build optional

* Thu Jul 18 2013 Remi Collet <remi@fedoraproject.org> - 1.0.4-0.4.git5e179e9
- update to latest master snapshot
- fix Source0 URL

* Fri Dec  7 2012 Remi Collet <remi@fedoraproject.org> - 1.0.4-0.3.gitd069e23
- update to latest master snapshot
- also provides php-runkit
- run tests during build
- cleanups

* Wed Sep 12 2012 Remi Collet <remi@fedoraproject.org> - 1.0.4-0.2.gita079457
- standardize for remi repo, lot of cleanups
- add ZTS extension
- add %%check section: minimal load test
- update to latest master snapshot

* Mon Sep  3 2012 Pavel Alexeev <Pahan@Hubbitus.info> - 1.0.4-0.1.GIT8c73eaf
- New upstream url - https://bugs.php.net/bug.php?id=61189, continue developing, new version, switch to git SCM.
- Fix compilation error: https://github.com/zenovich/runkit/issues/26#issuecomment-8268795

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

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

* Tue Aug  2 2011 Pavel Alexeev <Pahan@Hubbitus.info> - 0.9-14.CVS20090215
- Fix FBFS on Fedora 16(17 rawhide) and rpm 4.9 - bz#715709

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

* Thu Jul 30 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.9-12.CVS20090215
- Apply patches only on PHP>=5.3.0. (Bug: https://bugzilla.redhat.com/show_bug.cgi?id=513096 )

* Sun Apr  5 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.9-11.CVS20090215
- By suggestion in the bug https://fedorahosted.org/fedora-infrastructure/ticket/1298 try remove version specifications in requires:
    Turn BuildRequires: php-pear >= 1.4.7, php-devel >= 5.0.0 to just BuildRequires: php-pear, php-devel
- Add more magick in Release tag: 11%%{?CVS:.CVS%%{CVS}}%%{?dist}

* Tue Mar 17 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.9-10.CVS20090215
- Remi Collet notes in Fedora review:
- Rename back %%{peclName}.xml to %%{name}.xml :)
- Set %%defattr(-,root,root,-) (was %%defattr(644,root,root,755))
- Make the %%post/%%postun scriptlets silent

* Mon Mar  9 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 0.9-9.CVS20090215
- In rename %%{name}.xml to %%{peclName}.xml
- Add BR php-pear >= 1.4.7

* Wed Feb 25 2009 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] spb [ dOt.] su> - 0.9-8.CVS20090215
- All changes inspired by Fedora package review by Remi Collet.
- From summary deleted name.
- Readmy path fixed(replaced %%{peclName}-%%{version}/README to %%{peclName}/README)
- Group changed to Development/Libraries (was: Development/Languages/PHP)
- Removed Obsoletes: php-pear-%%{peclName} it was unnecessary.

* Mon Feb 23 2009 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] spb [ dOt.] su> - 0.9-7.CVS20090215
- Again change version enumeration (https://bugzilla.redhat.com/show_bug.cgi?id=455226#c9).
- %%{pecl_xmldir}/%%{peclName}2.xml changed to %%{pecl_xmldir}/%%{name}.xml
- Recode pl summary and description text from iso8859-2 to UTF-8.

* Sun Feb 15 2009 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] spb [ dOt.] su> - 0.9-0.6.CVS20090215
- Step to CVS build 20090215.
- Replace $RPM_BUILD_ROOT to %%{buildroot} to consistence usage.
- Strip some old comments.
- Add translated Summary(ru) and description.
- Remove legacy macros %%{?requires_php_extension}.
- All macroses %%peclName replaced to %{peclName} usages.
- Add file: %%{pecl_xmldir}/%%{peclName}2.xml
- All followed changes inspired by Fedora review by Remi Collet ( https://bugzilla.redhat.com/show_bug.cgi?id=455226 ).
- Change version enumeration, delete Hu-part.
- Modify Source0 for CVS build. Add comment about get it source.
- Spec-file renamed to php-pecl-runkit.spec.
- File BUG to upstream - http://pecl.php.net/bugs/bug.php?id=15969 .
- %%Post and %%postun scripts to restart apache removed.
- Register extension.
- Add PHP ABI provides/requires and Pre/post requires pecl.
- Defile some macroses from guidelines: php_apiver, __pecl, php_extdir.
- Replace %%extensionsdir by %%php_extdir.

* Mon May 12 2008 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] spb [ dOt.] su> - 0.9-0.CVS20080512.Hu.5
- Add Patch3: php-pecl-runkit-0.9.Z_NEW_REFCOUNT.patch to reflect new zend API

* Mon May 12 2008 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] spb [ dOt.] su> - 0.9-0.CVS20080512.Hu.3
- New CVS20080512 (cvs -d :pserver:cvsread@cvs.php.net/repository checkout pecl/runkit)
- Rename %%{_modname} to peclName to unify SPECs.
- Correct %%if 0%%{?CVS} to %%if 0%%{?CVS:1} - it is not integer!
- Rename pethces to:
    Patch0:        php-pecl-runkit-0.9-ZVAL_REFCOUNT.patch
    Patch1:        php-pecl-runkit-0.9-ZVAL_ADDREF.patch

* Mon Mar 10 2008 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] spb [ dOt.] su> - 0.9-0.CVS20080310.Hu.2
- CVS20080310 build. (cvs -d :pserver:cvsread@cvs.php.net:/repository checkout pecl/runkit)
- 0.9 stable are incompatible with php 5.3.0, build from CVS. Disable self patch0
- Enable patch0. Rewritten and rename to fix ZVAL_REFCOUNT.patch
    Hu.1
- Add patch1. Fix wrong call ZVAL_ADDREF.patch
    Hu.2

* Sun Mar  9 2008 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] info> - 0.9-0.Hu.3
- Add patch (self written) zval_ref.patch. It is allow build.
- Agjust built dir:
    BuildRoot:    %%{tmpdir}/%%{name}-%%{version}-root-%%(id -u -n)
    to
    BuildRoot:    %%{_tmppath}/%%{name}-%%{version}-root-%%(id -u -n)
- Fix Release:        0%%{?dist}.Hu.2 -> Release:        0%%{?dist}.Hu.2
    Hu.2
- Remove %%define _status beta and all apearance of %%{_status}
- Remove %%define _sysconfdir /etc/php (it's already defined in system wide)
- Remove Requires: %%{_sysconfdir}/conf.d
- Change path %%{_sysconfdir}/conf.d to %%{_sysconfdir}/php.d:
    Replace:
        install -d $RPM_BUILD_ROOT{%%{_sysconfdir}/conf.d,%%{extensionsdir}}
        to
        install -d $RPM_BUILD_ROOT{%%{_sysconfdir}/php.d,%%{extensionsdir}}

        %%config(noreplace) %%verify(not md5 mtime size) %%{_sysconfdir}/conf.d/%%{_modname}.ini
        to
        %%config(noreplace) %%verify(not md5 mtime size) %%{_sysconfdir}/php.d/%%{_modname}.ini

        cat <<'EOF' > $RPM_BUILD_ROOT%%{_sysconfdir}/conf.d/%%{_modname}.ini
        to
        cat <<'EOF' > $RPM_BUILD_ROOT%%{_sysconfdir}/php.d/%%{_modname}.ini
- Hu.3

* Wed Feb 27 2008 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] info> - 0.9-0.Hu.0
- Import from ftp://ftp.pld-linux.org/dists/2.0/PLD/SRPMS/SRPMS/php-pecl-runkit-0.4-5.src.rpm
- Step to version 0.9
    Release:        0{?dist}.Hu.0 (Was: Release:    0)
- Remove defining %%date and:
    * %%{date} PLD Team <feedback@pld-linux.org>
    All persons listed below can be reached at <cvs_login>@pld-linux.org
 due to error: ошибка: %%changelog не в нисходящем хронологическом порядке
- Small reformat of header spec
- Change BuildRequires:    php-devel >= 3:5.0.0 to php-devel >= 5.0.0
-Remove BuildRequires:    rpmbuild(macros) >= 1.254