]> git.pld-linux.org Git - packages/php-pecl-igbinary.git/blob - php-pecl-igbinary.spec
500b15a75f1974a3529256a58e55744b3e3932f1
[packages/php-pecl-igbinary.git] / php-pecl-igbinary.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname igbinary
7 Summary:        Replacement for the standard PHP serializer
8 Name:           %{php_name}-pecl-%{modname}
9 Version:        1.2.0
10 Release:        1
11 License:        BSD
12 Group:          Libraries
13 Source0:        http://pecl.php.net/get/%{modname}-%{version}.tgz
14 # Source0-md5:  3755f17c73e7ef1fa022efd3b49d0573
15 Source2:        %{modname}.ini
16 URL:            http://pecl.php.net/package/igbinary
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}
22 %{?with_tests:BuildRequires:    %{php_name}-simplexml}
23 %{?with_tests:BuildRequires:    %{php_name}-spl}
24 #BuildRequires: php-pecl-apc-devel >= 3.1.7
25 BuildRequires:  rpmbuild(macros) >= 1.666
26 %{?requires_php_extension}
27 Requires:       %{php_name}-session
28 Provides:       php(%{modname}) = %{version}
29 Obsoletes:      php-pecl-igbinary < 1.1.1-6
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
43 Requires:       %{php_name}-devel
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
51 mv %{modname}-*/* .
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 that can run without
63 %{__php} -n -q \
64         -dextension_dir=modules \
65         -dextension=%{php_extensiondir}/pcre.so \
66         -dextension=%{php_extensiondir}/spl.so \
67         -dextension=%{php_extensiondir}/simplexml.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_EXECUTABLE=%{__php} \
77         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl simplexml session" \
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
93 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %files
99 %defattr(644,root,root,755)
100 %doc COPYING CREDITS NEWS README.md
101 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/*%{modname}.ini
102 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
103
104 %files devel
105 %defattr(644,root,root,755)
106 %{_includedir}/php/ext/%{modname}
This page took 0.063248 seconds and 2 git commands to generate.