]> git.pld-linux.org Git - packages/php-pecl-igbinary.git/blame - php-pecl-igbinary.spec
support building for multiple php versions
[packages/php-pecl-igbinary.git] / php-pecl-igbinary.spec
CommitLineData
2d54e314
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
62d7a9b0 5%define php_name php%{?php_suffix}
2d54e314
ER
6%define modname igbinary
7Summary: Replacement for the standard PHP serializer
62d7a9b0 8Name: %{php_name}-pecl-%{modname}
2d54e314 9Version: 1.1.1
f7c137f2 10Release: 4
2d54e314
ER
11License: BSD
12Group: Libraries
13URL: http://pecl.php.net/package/igbinary
14Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
15# Source0-md5: 4ad53115ed7d1d452cbe50b45dcecdf2
16# http://pecl.php.net/bugs/22598
17# https://github.com/igbinary/igbinary/tree/1.1.1/tests
18Source1: https://github.com/igbinary/igbinary/tarball/1.1.1/tests#/%{modname}-tests.tgz
19# Source1-md5: b171ba8b230f6de3e7095500515fc6bb
20Source2: %{modname}.ini
21Patch0: apc-modname.patch
62d7a9b0
ER
22%{?with_tests:BuildRequires: %{php_name}-cli}
23BuildRequires: %{php_name}-devel >= 4:5.2.0
24%{?with_tests:BuildRequires: %{php_name}-pcre}
25#%{?with_tests:BuildRequires: %{php_name}-pecl-APC}
26%{?with_tests:BuildRequires: %{php_name}-session}
27%{?with_tests:BuildRequires: %{php_name}-spl}
2d54e314 28#BuildRequires: php-pecl-apc-devel >= 3.1.7
62d7a9b0 29Requires: %{php_name}-session
2d54e314
ER
30BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32%description
33Igbinary is a drop in replacement for the standard PHP serializer.
34
35Instead of time and space consuming textual representation, igbinary
36stores PHP data structures in a compact binary form. Savings are
37significant when using memcached or similar memory based storages for
38serialized data.
39
40%package devel
41Summary: Igbinary developer files (header)
42Group: Development/Libraries
62d7a9b0 43Requires: %{php_name}-devel
2d54e314
ER
44# does not require base
45
46%description devel
47These are the files needed to compile programs using Igbinary
48
49%prep
50%setup -qc -a1
51mv %{modname}-%{version}/* .
52mv igbinary-igbinary-bef0aca/tests .
53%patch0 -p1
54
55%build
56phpize
57%configure
58%{__make}
59
60%if %{with tests}
61# APC required for test 045
62
63# simple module load test
64# without APC to ensure than can run without
62d7a9b0 65%{__php}%{?php_suffix} -n \
2d54e314
ER
66 -dextension_dir=modules \
67 -dextension=%{php_extensiondir}/spl.so \
68 -dextension=%{php_extensiondir}/session.so \
69 -dextension=%{modname}.so \
70 -m > modules.log
71grep %{modname} modules.log
72
73cat <<'EOF' > run-tests.sh
74#!/bin/sh
75%{__make} test \
76 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" \
77 RUN_TESTS_SETTINGS="-q $*"
78EOF
79
80chmod +x run-tests.sh
81./run-tests.sh -w failed.log --show-out
82test -f failed.log -a ! -s failed.log
83%endif
84
85%install
86rm -rf $RPM_BUILD_ROOT
87install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
88%{__make} install \
89 EXTENSION_DIR=%{php_extensiondir} \
90 INSTALL_ROOT=$RPM_BUILD_ROOT
91
d5bdc1da 92cp -p %{SOURCE2} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini
2d54e314
ER
93
94%clean
95rm -rf $RPM_BUILD_ROOT
96
97%files
98%defattr(644,root,root,755)
99%doc COPYING CREDITS NEWS README
d5bdc1da 100%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/*%{modname}.ini
2d54e314
ER
101%attr(755,root,root) %{php_extensiondir}/%{modname}.so
102
103%files devel
104%defattr(644,root,root,755)
105%{_includedir}/php/ext/%{modname}
This page took 0.378206 seconds and 4 git commands to generate.