]>
Commit | Line | Data |
---|---|---|
8a94fd63 ER |
1 | # |
2 | # Conditional build: | |
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 | |
f320a8b8 | 8 | %bcond_without tests # build without tests |
8a94fd63 | 9 | |
00a979fe | 10 | %define php_name php%{?php_suffix} |
1686b051 | 11 | %define modname memcached |
3ad40754 ŁK |
12 | Summary: Interface to memcached via libmemcached library |
13 | Summary(pl.UTF-8): Interfejs do memcached z użyciem biblioteki libmemcached | |
00a979fe | 14 | Name: %{php_name}-pecl-%{modname} |
8a94fd63 | 15 | # PHP >= 7 only, for older PHP see 2.2.x branch |
32929cc6 | 16 | Version: 3.0.0 |
f320a8b8 | 17 | Release: 0.3 |
ecc1f4a0 | 18 | License: PHP 3.01 |
b44f7c50 | 19 | Group: Development/Languages/PHP |
32929cc6 ER |
20 | Source0: https://github.com/php-memcached-dev/php-memcached/archive/php7/%{modname}-%{version}.tar.gz |
21 | # Source0-md5: df81b124ac101bd21922deb0ef2ad9b9 | |
b44f7c50 | 22 | URL: http://pecl.php.net/package/memcached/ |
c3fa9f03 | 23 | BuildRequires: %{php_name}-devel >= 4:7.0.0 |
8a94fd63 | 24 | %{?with_sasl:BuildRequires: cyrus-sasl-devel} |
2ef5d149 | 25 | BuildRequires: fastlz-devel |
b791cdba | 26 | BuildRequires: libmemcached-devel >= 1.0.18 |
b39e72bc ER |
27 | BuildRequires: pkgconfig |
28 | BuildRequires: re2c | |
00a979fe | 29 | BuildRequires: rpmbuild(macros) >= 1.650 |
5f6946b2 | 30 | BuildRequires: zlib-devel |
f320a8b8 ER |
31 | %if %{with tests} |
32 | BuildRequires: %{php_name}-cli | |
33 | BuildRequires: %{php_name}-spl | |
34 | %{?with_session:BuildRequires: %{php_name}-session} | |
35 | %endif | |
b44f7c50 | 36 | %{?requires_php_extension} |
28bdaf6a ER |
37 | Suggests: %{php_name}-pecl-igbinary |
38 | Provides: php(%{modname}) = %{version} | |
d30795a1 | 39 | Obsoletes: php-pecl-memcached < 2.2.0-1 |
b44f7c50 AG |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
41 | ||
42 | %description | |
43 | This extension uses libmemcached library to provide API for | |
44 | communicating with memcached servers. | |
45 | ||
b44f7c50 | 46 | %description -l pl.UTF-8 |
c869a57e | 47 | Rozszerzenie to wykorzystuje bibliotekę memcached w celu udostępnienia |
b44f7c50 AG |
48 | API do komunikacji z serwerami memcached. |
49 | ||
b44f7c50 | 50 | %prep |
32929cc6 ER |
51 | %setup -qc |
52 | mv php-memcached-*/{.??*,*} . | |
b44f7c50 | 53 | |
2ef5d149 ER |
54 | rm fastlz/fastlz.c |
55 | ||
b44f7c50 AG |
56 | %build |
57 | phpize | |
ecc1f4a0 | 58 | %configure \ |
8a94fd63 ER |
59 | %{__enable_disable igbinary memcached-igbinary} \ |
60 | %{__enable_disable json memcached-json} \ | |
61 | %{__enable_disable msgpack memcached-msgpack} \ | |
62 | %{__enable_disable sasl memcached-sasl} \ | |
63 | %{__enable_disable session memcached-session} \ | |
64 | --with-system-fastlz | |
b44f7c50 AG |
65 | %{__make} |
66 | ||
f320a8b8 ER |
67 | %if %{with tests} |
68 | # simple module load test | |
69 | %{__php} -n -q \ | |
70 | -d extension_dir=modules \ | |
71 | -d extension=%{php_extensiondir}/spl.so \ | |
72 | %if %{with session} | |
73 | -d extension=%{php_extensiondir}/session.so \ | |
74 | %endif | |
75 | -d extension=%{modname}.so \ | |
76 | -m > modules.log | |
77 | grep %{modname} modules.log | |
78 | ||
79 | export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 | |
80 | %{__make} test \ | |
81 | PHP_EXECUTABLE=%{__php} \ | |
82 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl%{?with_session: session}" | |
83 | ||
84 | %endif | |
85 | ||
b44f7c50 AG |
86 | %install |
87 | rm -rf $RPM_BUILD_ROOT | |
b44f7c50 AG |
88 | %{__make} install \ |
89 | INSTALL_ROOT=$RPM_BUILD_ROOT \ | |
90 | EXTENSION_DIR=%{php_extensiondir} | |
87acf0f0 ER |
91 | |
92 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
1686b051 ER |
93 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini |
94 | ; Enable %{modname} extension module | |
95 | extension=%{modname}.so | |
ecc1f4a0 | 96 | |
b44f7c50 | 97 | EOF |
ecc1f4a0 | 98 | cat %{modname}.ini >> $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini |
b44f7c50 AG |
99 | |
100 | %clean | |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
103 | %post | |
104 | %php_webserver_restart | |
105 | ||
106 | %postun | |
107 | if [ "$1" = 0 ]; then | |
108 | %php_webserver_restart | |
109 | fi | |
110 | ||
111 | %files | |
112 | %defattr(644,root,root,755) | |
1686b051 ER |
113 | %doc CREDITS |
114 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini | |
115 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |