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