]>
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} |
2d54e314 | 9 | Version: 1.1.1 |
f7c137f2 | 10 | Release: 4 |
2d54e314 ER |
11 | License: BSD |
12 | Group: Libraries | |
13 | URL: http://pecl.php.net/package/igbinary | |
14 | Source0: 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 | |
18 | Source1: https://github.com/igbinary/igbinary/tarball/1.1.1/tests#/%{modname}-tests.tgz | |
19 | # Source1-md5: b171ba8b230f6de3e7095500515fc6bb | |
20 | Source2: %{modname}.ini | |
21 | Patch0: apc-modname.patch | |
62d7a9b0 ER |
22 | %{?with_tests:BuildRequires: %{php_name}-cli} |
23 | BuildRequires: %{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 | 29 | Requires: %{php_name}-session |
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 | |
50 | %setup -qc -a1 | |
51 | mv %{modname}-%{version}/* . | |
52 | mv igbinary-igbinary-bef0aca/tests . | |
53 | %patch0 -p1 | |
54 | ||
55 | %build | |
56 | phpize | |
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 | |
71 | grep %{modname} modules.log | |
72 | ||
73 | cat <<'EOF' > run-tests.sh | |
74 | #!/bin/sh | |
75 | %{__make} test \ | |
76 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" \ | |
77 | RUN_TESTS_SETTINGS="-q $*" | |
78 | EOF | |
79 | ||
80 | chmod +x run-tests.sh | |
81 | ./run-tests.sh -w failed.log --show-out | |
82 | test -f failed.log -a ! -s failed.log | |
83 | %endif | |
84 | ||
85 | %install | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | install -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 | 92 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini |
2d54e314 ER |
93 | |
94 | %clean | |
95 | rm -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} |