Logoj0ke.net Open Build Service > Projects > internetx:php7:EL7:7.0.24:extensions > php-pecl-igbinary > 1
Sign Up | Log In

File 1 of Package php-pecl-igbinary

x
 
1
# remirepo spec file for php-pecl-igbinary
2
# with SCL compatibility, from:
3
#
4
# Fedora spec file for php-pecl-igbinary
5
#
6
# Copyright (c) 2010-2016 Remi Collet
7
# License: CC-BY-SA
8
# http://creativecommons.org/licenses/by-sa/4.0/
9
#
10
# Please, preserve the changelog entries
11
#
12
%if 0%{?scl:1}
13
%if "%{scl}" == "rh-php56"
14
%global sub_prefix more-php56-
15
%else
16
%global sub_prefix %{scl_prefix}
17
%endif
18
%scl_package        php-pecl-igbinary
19
%endif
20
21
%global extname    igbinary
22
%global with_zts   0%{!?_without_zts:%{?__ztsphp:1}}
23
%global gh_commit  332a3d7ca899531f063dab38608e69e0e18f62a2
24
%global gh_short   %(c=%{gh_commit}; echo ${c:0:7})
25
##lobal gh_date    20160724
26
##global prever    -dev
27
%if "%{php_version}" < "5.6"
28
%global ini_name  %{extname}.ini
29
%else
30
%global ini_name  40-%{extname}.ini
31
%endif
32
33
Summary:        Replacement for the standard PHP serializer
34
Name:           %{?sub_prefix}php-pecl-igbinary
35
Version:        2.0.0
36
%if 0%{?gh_date}
37
Release:        0.4.%{gh_date}git%{gh_short}%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
38
Source0:        https://github.com/%{extname}/%{extname}7/archive/%{gh_commit}/%{extname}-%{version}-%{gh_short}.tar.gz
39
%else
40
Release:        2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
41
Source0:        http://pecl.php.net/get/%{extname}-%{version}.tgz
42
%endif
43
License:        BSD
44
Group:          System Environment/Libraries
45
46
URL:            http://pecl.php.net/package/igbinary
47
48
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
49
BuildRequires:  %{?scl_prefix}php-pear
50
BuildRequires:  %{?scl_prefix}php-devel >= 5.2.0
51
BuildRequires:  %{?sub_prefix}php-pecl-apcu-devel >= 5.1.6
52
BuildRequires:  %{?sub_prefix}php-pecl-apcu-bc
53
54
Requires:       %{?scl_prefix}php(zend-abi) = %{php_zend_api}
55
Requires:       %{?scl_prefix}php(api) = %{php_core_api}
56
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
57
58
Obsoletes:      %{?scl_prefix}php-%{extname}                <= 1.1.1
59
Provides:       %{?scl_prefix}php-%{extname}                = %{version}
60
Provides:       %{?scl_prefix}php-%{extname}%{?_isa}        = %{version}
61
Provides:       %{?scl_prefix}php-pecl(%{extname})          = %{version}
62
Provides:       %{?scl_prefix}php-pecl(%{extname})%{?_isa}  = %{version}
63
%if "%{?scl_prefix}" != "%{?sub_prefix}"
64
Provides:       %{?scl_prefix}php-pecl-%{pecl_name}         = %{version}-%{release}
65
Provides:       %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
66
%endif
67
68
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1}
69
# Other third party repo stuff
70
Obsoletes:     php53-pecl-%{extname}
71
Obsoletes:     php53u-pecl-%{extname}
72
Obsoletes:     php54-pecl-%{extname}
73
Obsoletes:     php54w-pecl-%{extname}
74
%if "%{php_version}" > "5.5"
75
Obsoletes:     php55u-pecl-%{extname}
76
Obsoletes:     php55w-pecl-%{extname}
77
%endif
78
%if "%{php_version}" > "5.6"
79
Obsoletes:     php56u-pecl-%{extname}
80
Obsoletes:     php56w-pecl-%{extname}
81
%endif
82
%if "%{php_version}" > "7.0"
83
Obsoletes:     php70u-pecl-%{extname}
84
Obsoletes:     php70w-pecl-%{extname}
85
%endif
86
%if "%{php_version}" > "7.1"
87
Obsoletes:     php71u-pecl-%{extname}
88
Obsoletes:     php71w-pecl-%{extname}
89
%endif
90
%endif
91
92
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
93
# Filter shared private
94
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
95
%{?filter_setup}
96
%endif
97
98
99
%description
100
Igbinary is a drop in replacement for the standard PHP serializer.
101
102
Instead of time and space consuming textual representation, 
103
igbinary stores PHP data structures in a compact binary form. 
104
Savings are significant when using memcached or similar memory
105
based storages for serialized data.
106
107
108
%package devel
109
Summary:       Igbinary developer files (header)
110
Group:         Development/Libraries
111
Requires:      %{name}%{?_isa} = %{version}-%{release}
112
Requires:      %{?scl_prefix}php-devel%{?_isa}
113
114
Obsoletes:     %{?scl_prefix}php-%{extname}-devel         <= 1.1.1
115
Provides:      %{?scl_prefix}php-%{extname}-devel         = %{version}-%{release}
116
Provides:      %{?scl_prefix}php-%{extname}-devel%{?_isa} = %{version}-%{release}
117
118
%description devel
119
These are the files needed to compile programs using Igbinary
120
121
Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.
122
123
124
%prep
125
%setup -q -c
126
127
%if 0%{?gh_date}
128
mv igbinary7-%{gh_commit} NTS
129
%{__php} -r '
130
  $pkg = simplexml_load_file("NTS/package.xml");
131
  $pkg->date = substr("%{gh_date}",0,4)."-".substr("%{gh_date}",4,2)."-".substr("%{gh_date}",6,2);
132
  $pkg->version->release = "%{version}dev";
133
  $pkg->stability->release = "devel";
134
  $pkg->asXML("package.xml");
135
'
136
%else
137
mv %{extname}-%{version} NTS
138
%endif
139
140
%{?_licensedir:sed -e '/COPYING/s/role="doc"/role="src"/' -i package.xml}
141
142
cd NTS
143
144
# Check version
145
extver=$(sed -n '/#define PHP_IGBINARY_VERSION/{s/.* "//;s/".*$//;p}' src/php7/igbinary.h)
146
if test "x${extver}" != "x%{version}%{?prever}"; then
147
   : Error: Upstream version is ${extver}, expecting %{version}%{?prever}.
148
   exit 1
149
fi
150
cd ..
151
152
%if %{with_zts}
153
cp -r NTS ZTS
154
%endif
155
156
cat <<EOF | tee %{ini_name}
157
; Enable %{extname} extension module
158
extension=%{extname}.so
159
160
; Enable or disable compacting of duplicate strings
161
; The default is On.
162
;igbinary.compact_strings=On
163
164
; Use igbinary as session serializer
165
;session.serialize_handler=igbinary
166
167
; Use igbinary as APC serializer
168
;apc.serializer=igbinary
169
EOF
170
171
172
%build
173
cd NTS
174
%{_bindir}/phpize
175
%configure --with-php-config=%{_bindir}/php-config
176
make %{?_smp_mflags}
177
178
%if %{with_zts}
179
cd ../ZTS
180
%{_bindir}/zts-phpize
181
%configure --with-php-config=%{_bindir}/zts-php-config
182
make %{?_smp_mflags}
183
%endif
184
185
186
%install
187
rm -rf %{buildroot}
188
189
make install -C NTS INSTALL_ROOT=%{buildroot}
190
191
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
192
193
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
194
195
# Install the ZTS stuff
196
%if %{with_zts}
197
make install -C ZTS INSTALL_ROOT=%{buildroot}
198
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
199
%endif
200
201
# Test & Documentation
202
cd NTS
203
for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
204
do [ -f $i       ] && install -Dpm 644 $i       %{buildroot}%{pecl_testdir}/%{extname}/$i
205
   [ -f tests/$i ] && install -Dpm 644 tests/$i %{buildroot}%{pecl_testdir}/%{extname}/tests/$i
206
done
207
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
208
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{extname}/$i
209
done
210
211
212
%check
213
MOD=""
214
%if "%{php_version}" > "7.0"
215
# See https://github.com/igbinary/igbinary7/issues/24
216
rm */tests/igbinary_040.phpt
217
%endif
218
219
# APC required for test 045
220
if [ -f %{php_extdir}/apcu.so ]; then
221
  MOD="-d extension=apcu.so -d extension=apc.so"
222
fi
223
if [ -f %{php_extdir}/apc.so ]; then
224
  MOD="$MOD -d extension=apc.so"
225
fi
226
227
: simple NTS module load test, without APC, as optional
228
%{_bindir}/php --no-php-ini \
229
    --define extension=%{buildroot}%{php_extdir}/%{extname}.so \
230
    --modules | grep %{extname}
231
232
: upstream test suite
233
cd NTS
234
TEST_PHP_EXECUTABLE=%{_bindir}/php \
235
TEST_PHP_ARGS="-n $MOD -d extension=$PWD/modules/%{extname}.so" \
236
NO_INTERACTION=1 \
237
REPORT_EXIT_STATUS=1 \
238
%{_bindir}/php -n run-tests.php --show-diff
239
240
%if %{with_zts}
241
: simple ZTS module load test, without APC, as optional
242
%{__ztsphp} --no-php-ini \
243
    --define extension=%{buildroot}%{php_ztsextdir}/%{extname}.so \
244
    --modules | grep %{extname}
245
246
: upstream test suite
247
cd ../ZTS
248
TEST_PHP_EXECUTABLE=%{__ztsphp} \
249
TEST_PHP_ARGS="-n $MOD -d extension=$PWD/modules/%{extname}.so" \
250
NO_INTERACTION=1 \
251
REPORT_EXIT_STATUS=1 \
252
%{__ztsphp} -n run-tests.php --show-diff
253
%endif
254
255
256
%clean
257
rm -rf %{buildroot}
258
259
260
%if 0%{?fedora} < 24
261
# when pear installed alone, after us
262
%triggerin -- %{?scl_prefix}php-pear
263
if [ -x %{__pecl} ] ; then
264
    %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
265
fi
266
267
# posttrans as pear can be installed after us
268
%posttrans
269
if [ -x %{__pecl} ] ; then
270
    %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
271
fi
272
273
%postun
274
if [ $1 -eq 0 -a -x %{__pecl} ] ; then
275
    %{pecl_uninstall} %{extname} >/dev/null || :
276
fi
277
%endif
278
279
280
%files
281
%defattr(-,root,root,-)
282
%{?_licensedir:%license NTS/COPYING}
283
%doc %{pecl_docdir}/%{extname}
284
%config(noreplace) %{php_inidir}/%{ini_name}
285
286
%{php_extdir}/%{extname}.so
287
%{pecl_xmldir}/%{name}.xml
288
289
%if %{with_zts}
290
%config(noreplace) %{php_ztsinidir}/%{ini_name}
291
%{php_ztsextdir}/%{extname}.so
292
%endif
293
294
295
%files devel
296
%defattr(-,root,root,-)
297
%doc %{pecl_testdir}/%{extname}
298
%{php_incldir}/ext/%{extname}
299
300
%if %{with_zts}
301
%{php_ztsincldir}/ext/%{extname}
302
%endif
303
304
305
%changelog
306
* Mon Jul 25 2016 Remi Collet <remi@fedoraproject.org> - 1.2.2-0.4.20160724git332a3d7
307
- refresh
308
309
* Sat Jul 23 2016 Remi Collet <remi@fedoraproject.org> - 1.2.2-0.3.20160715gita87a993
310
- ignore 1 test with 7.1
311
312
* Mon Jul 18 2016 Remi Collet <remi@fedoraproject.org> - 1.2.2-0.2.20160715gita87a993
313
- refresh, newer snapshot
314
315
* Wed Mar  2 2016 Remi Collet <remi@fedoraproject.org> - 1.2.2-0.1.20151217git2b7c703
316
- update to 1.2.2dev for PHP 7
317
- ignore test results, 4 failed tests: igbinary_009.phpt, igbinary_014.phpt
318
  igbinary_026.phpt and igbinary_unserialize_v1_compatible.phpt
319
- session support not yet available
320
321
* Fri Jun 19 2015 Remi Collet <remi@fedoraproject.org> - 1.2.1-2
322
- allow build against rh-php56 (as more-php56)
323
- drop runtime dependency on pear, new scriptlets
324
325
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 1.2.1-1.1
326
- Fedora 21 SCL mass rebuild
327
328
* Fri Aug 29 2014 Remi Collet <remi@fedoraproject.org> - 1.2.1-1
329
- Update to 1.2.1
330
331
* Thu Aug 28 2014 Remi Collet <remi@fedoraproject.org> - 1.2.0-1
332
- update to 1.2.0
333
- open https://github.com/igbinary/igbinary/pull/36
334
335
* Sun Aug 24 2014 Remi Collet <remi@fedoraproject.org> - 1.1.2-0.11.git3b8ab7e
336
- improve SCL stuff
337
338
* Wed Apr  9 2014 Remi Collet <remi@fedoraproject.org> - 1.1.2-0.10.git3b8ab7e
339
- add numerical prefix to extension configuration file
340
341
* Wed Mar 19 2014 Remi Collet <rcollet@redhat.com> - 1.1.2-0.9.git3b8ab7e
342
- fix SCL dependencies
343
344
* Fri Feb 28 2014 Remi Collet <remi@fedoraproject.org> - 1.1.2-0.8.git3b8ab7e
345
- cleanups
346
- move doc in pecl_docdir
347
- move tests in pecl_testdir (devel)
348
349
* Sat Jul 27 2013 Remi Collet <remi@fedoraproject.org> - 1.1.2-0.6.git3b8ab7e
350
- latest snapshot
351
- fix build with APCu
352
353
* Fri Nov 30 2012 Remi Collet <remi@fedoraproject.org> - 1.1.2-0.3.git3b8ab7e
354
- cleanups
355
356
* Sat Mar 03 2012 Remi Collet <remi@fedoraproject.org> - 1.1.2-0.2.git3b8ab7e
357
- macro usage for latest PHP
358
359
* Mon Nov 14 2011 Remi Collet <remi@fedoraproject.org> - 1.1.2-0.1.git3b8ab7e
360
- latest git against php 5.4
361
- partial patch for https://bugs.php.net/60298
362
- ignore test result because of above bug
363
364
* Sat Sep 17 2011 Remi Collet <rpms@famillecollet.com> 1.1.1-2
365
- use latest macro
366
- build zts extension
367
368
* Mon Mar 14 2011 Remi Collet <rpms@famillecollet.com> 1.1.1-1
369
- version 1.1.1 published on pecl.php.net
370
- rename to php-pecl-igbinary
371
372
* Mon Jan 17 2011 Remi Collet <rpms@famillecollet.com> 1.1.1-2
373
- allow relocation using phpname macro
374
375
* Mon Jan 17 2011 Remi Collet <rpms@famillecollet.com> 1.1.1-1
376
- update to 1.1.1
377
378
* Fri Dec 31 2010 Remi Collet <rpms@famillecollet.com> 1.0.2-3
379
- updated tests from Git.
380
381
* Sat Oct 23 2010 Remi Collet <rpms@famillecollet.com> 1.0.2-2
382
- filter provides to avoid igbinary.so
383
- add missing %%dist
384
385
* Wed Sep 29 2010 Remi Collet <rpms@famillecollet.com> 1.0.2-1
386
- initital RPM
387
388