]>
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} |
02866f1f | 9 | Version: 3.1.2 |
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 | |
02866f1f | 14 | # Source0-md5: 34280e1609ef8e23f67fe3e690405787 |
2d54e314 | 15 | Source2: %{modname}.ini |
5fe6f2c2 | 16 | URL: https://pecl.php.net/package/igbinary |
62d7a9b0 | 17 | %{?with_tests:BuildRequires: %{php_name}-cli} |
355bc6fb | 18 | BuildRequires: %{php_name}-devel >= 4:7.0 |
62d7a9b0 | 19 | %{?with_tests:BuildRequires: %{php_name}-pcre} |
62d7a9b0 | 20 | %{?with_tests:BuildRequires: %{php_name}-session} |
af7ad5de | 21 | %{?with_tests:BuildRequires: %{php_name}-simplexml} |
62d7a9b0 | 22 | %{?with_tests:BuildRequires: %{php_name}-spl} |
766117d7 | 23 | BuildRequires: rpmbuild(macros) >= 1.666 |
665b76be | 24 | %{?requires_php_extension} |
62d7a9b0 | 25 | Requires: %{php_name}-session |
eac0cc73 | 26 | Provides: php(%{modname}) = %{version} |
a6c404bb | 27 | Obsoletes: php-pecl-igbinary < 1.1.1-6 |
2d54e314 ER |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
30 | %description | |
31 | Igbinary is a drop in replacement for the standard PHP serializer. | |
32 | ||
355bc6fb ER |
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 | |
36 | serialized data. | |
2d54e314 ER |
37 | |
38 | %package devel | |
39 | Summary: Igbinary developer files (header) | |
40 | Group: Development/Libraries | |
62d7a9b0 | 41 | Requires: %{php_name}-devel |
2d54e314 ER |
42 | # does not require base |
43 | ||
44 | %description devel | |
45 | These are the files needed to compile programs using Igbinary | |
46 | ||
47 | %prep | |
81816149 ER |
48 | %setup -qc |
49 | mv %{modname}-*/* . | |
6eaf967e | 50 | |
5fe6f2c2 ER |
51 | cat <<'EOF' > run-tests.sh |
52 | #!/bin/sh | |
53 | export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 | |
54 | exec %{__make} test \ | |
55 | PHP_EXECUTABLE=%{__php} \ | |
355bc6fb ER |
56 | %if "%php_major_version.%php_minor_version" >= "7.4" |
57 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="simplexml session" \ | |
58 | %else | |
5fe6f2c2 | 59 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl simplexml session" \ |
355bc6fb | 60 | %endif |
5fe6f2c2 ER |
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 |
766117d7 | 88 | %{__php} -n -q \ |
2d54e314 | 89 | -dextension_dir=modules \ |
a923f403 | 90 | -dextension=%{php_extensiondir}/pcre.so \ |
57775e0e | 91 | -dextension=%{php_extensiondir}/spl.so \ |
af7ad5de | 92 | -dextension=%{php_extensiondir}/simplexml.so \ |
2d54e314 ER |
93 | -dextension=%{php_extensiondir}/session.so \ |
94 | -dextension=%{modname}.so \ | |
95 | -m > modules.log | |
96 | grep %{modname} modules.log | |
97 | ||
5fe6f2c2 | 98 | %if %{with tests} |
5fe6f2c2 | 99 | ./run-tests.sh --show-diff |
2d54e314 ER |
100 | %endif |
101 | ||
102 | %install | |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}} | |
105 | %{__make} install \ | |
106 | EXTENSION_DIR=%{php_extensiondir} \ | |
107 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
108 | ||
e378a1ed ER |
109 | %if "%php_major_version.%php_minor_version" >= "7.4" |
110 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/01_%{modname}.ini | |
111 | %else | |
d5bdc1da | 112 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini |
e378a1ed | 113 | %endif |
2d54e314 ER |
114 | |
115 | %clean | |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
118 | %files | |
119 | %defattr(644,root,root,755) | |
81816149 | 120 | %doc COPYING CREDITS NEWS README.md |
e378a1ed | 121 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/*_%{modname}.ini |
2d54e314 ER |
122 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |
123 | ||
124 | %files devel | |
125 | %defattr(644,root,root,755) | |
fa99aff0 | 126 | %doc igbinary.php |
2d54e314 | 127 | %{_includedir}/php/ext/%{modname} |