]>
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} |
365972ab | 9 | Version: 2.0.0 |
81816149 | 10 | Release: 1 |
2d54e314 ER |
11 | License: BSD |
12 | Group: Libraries | |
2d54e314 | 13 | Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz |
365972ab | 14 | # Source0-md5: 89e1250807864d13df7b07710a187edf |
2d54e314 | 15 | Source2: %{modname}.ini |
c6dc38d7 | 16 | URL: http://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 | ||
35 | Instead of time and space consuming textual representation, igbinary | |
36 | stores PHP data structures in a compact binary form. Savings are | |
37 | significant when using memcached or similar memory based storages for | |
38 | serialized data. | |
39 | ||
40 | %package devel | |
41 | Summary: Igbinary developer files (header) | |
42 | Group: Development/Libraries | |
62d7a9b0 | 43 | Requires: %{php_name}-devel |
2d54e314 ER |
44 | # does not require base |
45 | ||
46 | %description devel | |
47 | These are the files needed to compile programs using Igbinary | |
48 | ||
49 | %prep | |
81816149 ER |
50 | %setup -qc |
51 | mv %{modname}-*/* . | |
6eaf967e | 52 | |
2d54e314 ER |
53 | %build |
54 | phpize | |
55 | %configure | |
56 | %{__make} | |
57 | ||
58 | %if %{with tests} | |
59 | # APC required for test 045 | |
60 | ||
61 | # simple module load test | |
57775e0e | 62 | # without APC to ensure that can run without |
766117d7 | 63 | %{__php} -n -q \ |
2d54e314 | 64 | -dextension_dir=modules \ |
a923f403 | 65 | -dextension=%{php_extensiondir}/pcre.so \ |
57775e0e | 66 | -dextension=%{php_extensiondir}/spl.so \ |
af7ad5de | 67 | -dextension=%{php_extensiondir}/simplexml.so \ |
2d54e314 ER |
68 | -dextension=%{php_extensiondir}/session.so \ |
69 | -dextension=%{modname}.so \ | |
70 | -m > modules.log | |
71 | grep %{modname} modules.log | |
72 | ||
73 | cat <<'EOF' > run-tests.sh | |
74 | #!/bin/sh | |
75 | %{__make} test \ | |
a0e64d78 | 76 | PHP_EXECUTABLE=%{__php} \ |
a923f403 | 77 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl simplexml session" \ |
2d54e314 ER |
78 | RUN_TESTS_SETTINGS="-q $*" |
79 | EOF | |
80 | ||
81 | chmod +x run-tests.sh | |
82 | ./run-tests.sh -w failed.log --show-out | |
83 | test -f failed.log -a ! -s failed.log | |
84 | %endif | |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}} | |
89 | %{__make} install \ | |
90 | EXTENSION_DIR=%{php_extensiondir} \ | |
91 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
92 | ||
d5bdc1da | 93 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini |
2d54e314 ER |
94 | |
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %files | |
99 | %defattr(644,root,root,755) | |
81816149 | 100 | %doc COPYING CREDITS NEWS README.md |
d5bdc1da | 101 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/*%{modname}.ini |
2d54e314 ER |
102 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |
103 | ||
104 | %files devel | |
105 | %defattr(644,root,root,755) | |
106 | %{_includedir}/php/ext/%{modname} |