]> git.pld-linux.org Git - packages/php-pecl-memcached.git/blob - php-pecl-memcached.spec
a353ca8ba6a7a823274be4f7ace7e8500b5e4ae4
[packages/php-pecl-memcached.git] / php-pecl-memcached.spec
1 #
2 # Conditional build:
3 %bcond_without  igbinary        # memcached igbinary serializer support
4 %bcond_without  json            # memcached json serializer support
5 %bcond_without  msgpack         # memcached msgpack serializer support
6 %bcond_without  sasl            # memcached sasl support
7 %bcond_without  session         # memcached session handler support
8 %bcond_without  tests           # build without tests
9
10 %define         php_name        php%{?php_suffix}
11 %define         modname memcached
12 Summary:        Interface to memcached via libmemcached library
13 Summary(pl.UTF-8):      Interfejs do memcached z użyciem biblioteki libmemcached
14 Name:           %{php_name}-pecl-%{modname}
15 # for PHP < 7 support see 2.2.x branch
16 Version:        3.0.0
17 Release:        0.4
18 License:        PHP 3.01
19 Group:          Development/Languages/PHP
20 Source0:        https://github.com/php-memcached-dev/php-memcached/archive/php7/%{modname}-%{version}.tar.gz
21 # Source0-md5:  df81b124ac101bd21922deb0ef2ad9b9
22 URL:            http://pecl.php.net/package/memcached/
23 BuildRequires:  %{php_name}-devel >= 4:7.0.0
24 %{?with_igbinary:BuildRequires: %{php_name}-pecl-igbinary-devel}
25 %{?with_msgpack:BuildRequires:  %{php_name}-pecl-msgpack-devel}
26 %{?with_sasl:BuildRequires:     cyrus-sasl-devel}
27 BuildRequires:  fastlz-devel
28 BuildRequires:  libmemcached-devel >= 1.0.18
29 BuildRequires:  pkgconfig
30 BuildRequires:  re2c
31 BuildRequires:  rpmbuild(macros) >= 1.650
32 BuildRequires:  zlib-devel
33 %if %{with tests}
34 BuildRequires:  %{php_name}-cli
35 %{?with_igbinary:BuildRequires: %{php_name}-pecl-igbinary}
36 %{?with_msgpack:BuildRequires:  %{php_name}-pecl-msgpack}
37 %{?with_session:BuildRequires:  %{php_name}-session}
38 BuildRequires:  %{php_name}-spl
39 %endif
40 %{?requires_php_extension}
41 Suggests:       %{php_name}-pecl-igbinary
42 Suggests:       %{php_name}-pecl-msgpack
43 Suggests:       %{php_name}-session
44 Provides:       php(%{modname}) = %{version}
45 Obsoletes:      php-pecl-memcached < 2.2.0-1
46 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48 %description
49 This extension uses libmemcached library to provide API for
50 communicating with memcached servers.
51
52 %description -l pl.UTF-8
53 Rozszerzenie to wykorzystuje bibliotekę memcached w celu udostępnienia
54 API do komunikacji z serwerami memcached.
55
56 %prep
57 %setup -qc
58 mv php-memcached-*/{.??*,*} .
59
60 rm fastlz/fastlz.c
61
62 # redirect tests fail (the actual tests they redirect work)
63 rm tests/experimental/serializer_igbinary.phpt
64 rm tests/experimental/serializer_json.phpt
65
66 %build
67 phpize
68 %configure \
69         %{__enable_disable igbinary memcached-igbinary} \
70         %{__enable_disable json memcached-json} \
71         %{__enable_disable msgpack memcached-msgpack} \
72         %{__enable_disable sasl memcached-sasl} \
73         %{__enable_disable session memcached-session} \
74         --with-system-fastlz
75 %{__make}
76
77 %if %{with tests}
78 # simple module load test
79 %{__php} -n -q \
80         -d extension_dir=modules \
81         -d extension=%{php_extensiondir}/spl.so \
82 %if %{with session}
83         -d extension=%{php_extensiondir}/session.so \
84 %endif
85 %if %{with igbinary}
86         -d extension=%{php_extensiondir}/igbinary.so \
87 %endif
88 %if %{with msgpack}
89         -d extension=%{php_extensiondir}/msgpack.so \
90 %endif
91         -d extension=%{modname}.so \
92         -m > modules.log
93 grep %{modname} modules.log
94
95 cat <<'EOF' > run-tests.sh
96 #!/bin/sh
97 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
98 exec %{__make} test \
99         PHP_EXECUTABLE=%{__php} \
100         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl%{?with_session: session}%{?with_igbinary: igbinary}%{?with_msgpack: msgpack}" \
101         RUN_TESTS_SETTINGS="-q $*"
102 EOF
103 chmod +x run-tests.sh
104
105 ./run-tests.sh
106 %endif
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110 %{__make} install \
111         INSTALL_ROOT=$RPM_BUILD_ROOT \
112         EXTENSION_DIR=%{php_extensiondir}
113
114 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
115 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
116 ; Enable %{modname} extension module
117 extension=%{modname}.so
118
119 EOF
120 cat %{modname}.ini >> $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 %post
126 %php_webserver_restart
127
128 %postun
129 if [ "$1" = 0 ]; then
130         %php_webserver_restart
131 fi
132
133 %files
134 %defattr(644,root,root,755)
135 %doc CREDITS
136 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
137 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.071479 seconds and 2 git commands to generate.