3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
6 %define modname igbinary
7 Summary: Replacement for the standard PHP serializer
8 Name: %{php_name}-pecl-%{modname}
12 Group: Development/Languages/PHP
13 Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
14 # Source0-md5: fb3b2f7fa306ca582afd9f382c409a24
15 Source2: %{modname}.ini
16 URL: https://pecl.php.net/package/igbinary
17 %{?with_tests:BuildRequires: %{php_name}-cli}
18 BuildRequires: %{php_name}-devel >= 4:7.0
19 %{?with_tests:BuildRequires: %{php_name}-pcre}
20 %{?with_tests:BuildRequires: %{php_name}-session}
21 %{?with_tests:BuildRequires: %{php_name}-simplexml}
22 %{?with_tests:BuildRequires: %{php_name}-spl}
23 BuildRequires: rpmbuild(macros) >= 1.666
24 %{?requires_php_extension}
25 Requires: %{php_name}-session
26 Provides: php(%{modname}) = %{version}
27 Obsoletes: php-pecl-igbinary < 1.1.1-6
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 Igbinary is a drop in replacement for the standard PHP serializer.
33 Instead of time and space consuming textual representation, igbinary
34 stores php data structures in a compact binary form. Savings are
35 significant when using memcached or similar memory based storages for
39 Summary: Igbinary developer files (header)
40 Group: Development/Libraries
41 Requires: %{php_name}-devel
42 # does not require base
45 These are the files needed to compile programs using Igbinary
51 cat <<'EOF' > run-tests.sh
53 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
55 PHP_EXECUTABLE=%{__php} \
56 %if "%php_major_version.%php_minor_version" >= "7.4"
57 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="simplexml session" \
59 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl simplexml session" \
61 RUN_TESTS_SETTINGS="-q $*"
76 t=${line##*\[}; t=${t%\]}
79 Test serializing multiple reference groups to the same empty array [tests/igbinary_067.phpt]
87 # simple module load test
89 -dextension_dir=modules \
90 -dextension=%{php_extensiondir}/pcre.so \
91 -dextension=%{php_extensiondir}/spl.so \
92 -dextension=%{php_extensiondir}/simplexml.so \
93 -dextension=%{php_extensiondir}/session.so \
94 -dextension=%{modname}.so \
96 grep %{modname} modules.log
99 ./run-tests.sh --show-diff
103 rm -rf $RPM_BUILD_ROOT
104 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
106 EXTENSION_DIR=%{php_extensiondir} \
107 INSTALL_ROOT=$RPM_BUILD_ROOT
109 %if "%php_major_version.%php_minor_version" >= "7.4"
110 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/01_%{modname}.ini
112 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini
116 rm -rf $RPM_BUILD_ROOT
119 %defattr(644,root,root,755)
120 %doc COPYING CREDITS NEWS README.md
121 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/*_%{modname}.ini
122 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
125 %defattr(644,root,root,755)
127 %{_includedir}/php/ext/%{modname}