3 %bcond_with igbinary # memcached igbinary serializer support
4 %bcond_without json # memcached json serializer support
5 %bcond_with 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
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 # PHP >= 7 only, for older PHP see 2.2.x branch
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_sasl:BuildRequires: cyrus-sasl-devel}
26 BuildRequires: fastlz-devel
27 BuildRequires: libmemcached-devel >= 1.0.18
28 BuildRequires: pkgconfig
30 BuildRequires: rpmbuild(macros) >= 1.650
31 BuildRequires: zlib-devel
33 BuildRequires: %{php_name}-cli
34 %{?with_igbinary:BuildRequires: %{php_name}-pecl-igbinary}
35 %{?with_session:BuildRequires: %{php_name}-session}
36 BuildRequires: %{php_name}-spl
38 %{?requires_php_extension}
39 Suggests: %{php_name}-pecl-igbinary
40 Suggests: %{php_name}-session
41 Provides: php(%{modname}) = %{version}
42 Obsoletes: php-pecl-memcached < 2.2.0-1
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 This extension uses libmemcached library to provide API for
47 communicating with memcached servers.
49 %description -l pl.UTF-8
50 Rozszerzenie to wykorzystuje bibliotekę memcached w celu udostępnienia
51 API do komunikacji z serwerami memcached.
55 mv php-memcached-*/{.??*,*} .
62 %{__enable_disable igbinary memcached-igbinary} \
63 %{__enable_disable json memcached-json} \
64 %{__enable_disable msgpack memcached-msgpack} \
65 %{__enable_disable sasl memcached-sasl} \
66 %{__enable_disable session memcached-session} \
71 # simple module load test
73 -d extension_dir=modules \
74 -d extension=%{php_extensiondir}/spl.so \
76 -d extension=%{php_extensiondir}/session.so \
79 -d extension=%{php_extensiondir}/igbinary.so \
81 -d extension=%{modname}.so \
83 grep %{modname} modules.log
85 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
87 PHP_EXECUTABLE=%{__php} \
88 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl%{?with_session: session}%{?with_igbinary: igbinary}"
92 rm -rf $RPM_BUILD_ROOT
94 INSTALL_ROOT=$RPM_BUILD_ROOT \
95 EXTENSION_DIR=%{php_extensiondir}
97 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
98 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
99 ; Enable %{modname} extension module
100 extension=%{modname}.so
103 cat %{modname}.ini >> $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
106 rm -rf $RPM_BUILD_ROOT
109 %php_webserver_restart
112 if [ "$1" = 0 ]; then
113 %php_webserver_restart
117 %defattr(644,root,root,755)
119 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
120 %attr(755,root,root) %{php_extensiondir}/%{modname}.so