]> git.pld-linux.org Git - packages/php-pecl-igbinary.git/blob - php-pecl-igbinary.spec
1568890dfc57fa25467ac1f10174f6f3327eabe7
[packages/php-pecl-igbinary.git] / php-pecl-igbinary.spec
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
9 Release:        4
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
23 %{?with_tests:BuildRequires:    php-pcre}
24 %{?with_tests:BuildRequires:    php-pecl-APC}
25 #BuildRequires: php-pecl-apc-devel >= 3.1.7
26 %{?with_tests:BuildRequires:    php-session}
27 Requires:       php-session
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
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.
37
38 %package devel
39 Summary:        Igbinary developer files (header)
40 Group:          Development/Libraries
41 Requires:       php-devel
42 # does not require base
43
44 %description devel
45 These are the files needed to compile programs using Igbinary
46
47 %prep
48 %setup -qc -a1
49 mv %{modname}-%{version}/* .
50 mv igbinary-igbinary-bef0aca/tests .
51 %patch0 -p1
52
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
62 # without APC to ensure than can run without
63 %{__php} -n \
64         -dextension_dir=modules \
65         -dextension=%{php_extensiondir}/spl.so \
66         -dextension=%{php_extensiondir}/session.so \
67         -dextension=%{modname}.so \
68         -m > modules.log
69 grep %{modname} modules.log
70
71 cat <<'EOF' > run-tests.sh
72 #!/bin/sh
73 %{__make} test \
74         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" \
75         RUN_TESTS_SETTINGS="-q $*"
76 EOF
77
78 chmod +x run-tests.sh
79 ./run-tests.sh -w failed.log --show-out
80 test -f failed.log -a ! -s failed.log
81 %endif
82
83 %install
84 rm -rf $RPM_BUILD_ROOT
85 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
86 %{__make} install \
87         EXTENSION_DIR=%{php_extensiondir} \
88         INSTALL_ROOT=$RPM_BUILD_ROOT
89
90 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini
91
92 %clean
93 rm -rf $RPM_BUILD_ROOT
94
95 %files
96 %defattr(644,root,root,755)
97 %doc COPYING CREDITS NEWS README
98 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/*%{modname}.ini
99 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
100
101 %files devel
102 %defattr(644,root,root,755)
103 %{_includedir}/php/ext/%{modname}
This page took 0.116255 seconds and 2 git commands to generate.