]>
Commit | Line | Data |
---|---|---|
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 |
7 | Summary: Replacement for the standard PHP serializer | |
62d7a9b0 | 8 | Name: %{php_name}-pecl-%{modname} |
5fe6f2c2 | 9 | Version: 2.0.8 |
81816149 | 10 | Release: 1 |
2d54e314 | 11 | License: BSD |
5fe6f2c2 ER |
12 | Group: Development/Languages/PHP |
13 | Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz | |
14 | # Source0-md5: d3cbbfe6224923fecdad266569b57535 | |
2d54e314 | 15 | Source2: %{modname}.ini |
5fe6f2c2 | 16 | URL: https://pecl.php.net/package/igbinary |
62d7a9b0 ER |
17 | %{?with_tests:BuildRequires: %{php_name}-cli} |
18 | BuildRequires: %{php_name}-devel >= 4:5.2.0 | |
19 | %{?with_tests:BuildRequires: %{php_name}-pcre} | |
20 | #%{?with_tests:BuildRequires: %{php_name}-pecl-APC} | |
21 | %{?with_tests:BuildRequires: %{php_name}-session} | |
af7ad5de | 22 | %{?with_tests:BuildRequires: %{php_name}-simplexml} |
62d7a9b0 | 23 | %{?with_tests:BuildRequires: %{php_name}-spl} |
2d54e314 | 24 | #BuildRequires: php-pecl-apc-devel >= 3.1.7 |
766117d7 | 25 | BuildRequires: rpmbuild(macros) >= 1.666 |
665b76be | 26 | %{?requires_php_extension} |
62d7a9b0 | 27 | Requires: %{php_name}-session |
eac0cc73 | 28 | Provides: php(%{modname}) = %{version} |
a6c404bb | 29 | Obsoletes: php-pecl-igbinary < 1.1.1-6 |
2d54e314 ER |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %description | |
33 | Igbinary is a drop in replacement for the standard PHP serializer. | |
34 | ||
5fe6f2c2 ER |
35 | Instead of the time and space consuming textual representation used by |
36 | PHP's serialize, igbinary stores php data structures in a compact | |
37 | binary form. Memory savings are significant when using memcached, | |
38 | APCu, or similar memory based storages for serialized data. The | |
39 | typical reduction in storage requirements are around 50%. The exact | |
40 | percentage depends on your data. | |
2d54e314 ER |
41 | |
42 | %package devel | |
43 | Summary: Igbinary developer files (header) | |
44 | Group: Development/Libraries | |
62d7a9b0 | 45 | Requires: %{php_name}-devel |
2d54e314 ER |
46 | # does not require base |
47 | ||
48 | %description devel | |
49 | These are the files needed to compile programs using Igbinary | |
50 | ||
51 | %prep | |
81816149 ER |
52 | %setup -qc |
53 | mv %{modname}-*/* . | |
6eaf967e | 54 | |
5fe6f2c2 ER |
55 | cat <<'EOF' > run-tests.sh |
56 | #!/bin/sh | |
57 | export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 | |
58 | exec %{__make} test \ | |
59 | PHP_EXECUTABLE=%{__php} \ | |
60 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl simplexml session" \ | |
61 | RUN_TESTS_SETTINGS="-q $*" | |
62 | EOF | |
63 | chmod +x run-tests.sh | |
64 | ||
65 | xfail() { | |
66 | local t=$1 | |
67 | test -f $t | |
68 | cat >> $t <<-EOF | |
69 | ||
70 | --XFAIL-- | |
71 | Skip | |
72 | EOF | |
73 | } | |
74 | ||
75 | while read line; do | |
76 | t=${line##*\[}; t=${t%\]} | |
77 | xfail $t | |
78 | done << 'EOF' | |
79 | Test serializing multiple reference groups to the same empty array [tests/igbinary_067.phpt] | |
80 | EOF | |
81 | ||
2d54e314 ER |
82 | %build |
83 | phpize | |
84 | %configure | |
85 | %{__make} | |
86 | ||
2d54e314 | 87 | # simple module load test |
57775e0e | 88 | # without APC to ensure that can run without |
766117d7 | 89 | %{__php} -n -q \ |
2d54e314 | 90 | -dextension_dir=modules \ |
a923f403 | 91 | -dextension=%{php_extensiondir}/pcre.so \ |
57775e0e | 92 | -dextension=%{php_extensiondir}/spl.so \ |
af7ad5de | 93 | -dextension=%{php_extensiondir}/simplexml.so \ |
2d54e314 ER |
94 | -dextension=%{php_extensiondir}/session.so \ |
95 | -dextension=%{modname}.so \ | |
96 | -m > modules.log | |
97 | grep %{modname} modules.log | |
98 | ||
5fe6f2c2 ER |
99 | %if %{with tests} |
100 | # APC required for test 045 | |
101 | ./run-tests.sh --show-diff | |
2d54e314 ER |
102 | %endif |
103 | ||
104 | %install | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}} | |
107 | %{__make} install \ | |
108 | EXTENSION_DIR=%{php_extensiondir} \ | |
109 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
110 | ||
d5bdc1da | 111 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini |
2d54e314 ER |
112 | |
113 | %clean | |
114 | rm -rf $RPM_BUILD_ROOT | |
115 | ||
116 | %files | |
117 | %defattr(644,root,root,755) | |
81816149 | 118 | %doc COPYING CREDITS NEWS README.md |
d5bdc1da | 119 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/*%{modname}.ini |
2d54e314 ER |
120 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |
121 | ||
122 | %files devel | |
123 | %defattr(644,root,root,755) | |
124 | %{_includedir}/php/ext/%{modname} |