]>
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 |
cba71c6f | 24 | %{?with_igbinary:BuildRequires: %{php_name}-pecl-igbinary-devel} |
8a94fd63 | 25 | %{?with_sasl:BuildRequires: cyrus-sasl-devel} |
2ef5d149 | 26 | BuildRequires: fastlz-devel |
b791cdba | 27 | BuildRequires: libmemcached-devel >= 1.0.18 |
b39e72bc ER |
28 | BuildRequires: pkgconfig |
29 | BuildRequires: re2c | |
00a979fe | 30 | BuildRequires: rpmbuild(macros) >= 1.650 |
5f6946b2 | 31 | BuildRequires: zlib-devel |
f320a8b8 ER |
32 | %if %{with tests} |
33 | BuildRequires: %{php_name}-cli | |
cba71c6f | 34 | %{?with_igbinary:BuildRequires: %{php_name}-pecl-igbinary} |
f320a8b8 | 35 | %{?with_session:BuildRequires: %{php_name}-session} |
cba71c6f | 36 | BuildRequires: %{php_name}-spl |
f320a8b8 | 37 | %endif |
b44f7c50 | 38 | %{?requires_php_extension} |
28bdaf6a | 39 | Suggests: %{php_name}-pecl-igbinary |
cba71c6f | 40 | Suggests: %{php_name}-session |
28bdaf6a | 41 | Provides: php(%{modname}) = %{version} |
d30795a1 | 42 | Obsoletes: php-pecl-memcached < 2.2.0-1 |
b44f7c50 AG |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
44 | ||
45 | %description | |
46 | This extension uses libmemcached library to provide API for | |
47 | communicating with memcached servers. | |
48 | ||
b44f7c50 | 49 | %description -l pl.UTF-8 |
c869a57e | 50 | Rozszerzenie to wykorzystuje bibliotekę memcached w celu udostępnienia |
b44f7c50 AG |
51 | API do komunikacji z serwerami memcached. |
52 | ||
b44f7c50 | 53 | %prep |
32929cc6 ER |
54 | %setup -qc |
55 | mv php-memcached-*/{.??*,*} . | |
b44f7c50 | 56 | |
2ef5d149 ER |
57 | rm fastlz/fastlz.c |
58 | ||
b44f7c50 AG |
59 | %build |
60 | phpize | |
ecc1f4a0 | 61 | %configure \ |
8a94fd63 ER |
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} \ | |
67 | --with-system-fastlz | |
b44f7c50 AG |
68 | %{__make} |
69 | ||
f320a8b8 ER |
70 | %if %{with tests} |
71 | # simple module load test | |
72 | %{__php} -n -q \ | |
73 | -d extension_dir=modules \ | |
74 | -d extension=%{php_extensiondir}/spl.so \ | |
75 | %if %{with session} | |
76 | -d extension=%{php_extensiondir}/session.so \ | |
cba71c6f ER |
77 | %endif |
78 | %if %{with igbinary} | |
79 | -d extension=%{php_extensiondir}/igbinary.so \ | |
f320a8b8 ER |
80 | %endif |
81 | -d extension=%{modname}.so \ | |
82 | -m > modules.log | |
83 | grep %{modname} modules.log | |
84 | ||
85 | export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 | |
86 | %{__make} test \ | |
87 | PHP_EXECUTABLE=%{__php} \ | |
cba71c6f | 88 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl%{?with_session: session}%{?with_igbinary: igbinary}" |
f320a8b8 ER |
89 | %endif |
90 | ||
b44f7c50 AG |
91 | %install |
92 | rm -rf $RPM_BUILD_ROOT | |
b44f7c50 AG |
93 | %{__make} install \ |
94 | INSTALL_ROOT=$RPM_BUILD_ROOT \ | |
95 | EXTENSION_DIR=%{php_extensiondir} | |
87acf0f0 ER |
96 | |
97 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
1686b051 ER |
98 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini |
99 | ; Enable %{modname} extension module | |
100 | extension=%{modname}.so | |
ecc1f4a0 | 101 | |
b44f7c50 | 102 | EOF |
ecc1f4a0 | 103 | cat %{modname}.ini >> $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini |
b44f7c50 AG |
104 | |
105 | %clean | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %post | |
109 | %php_webserver_restart | |
110 | ||
111 | %postun | |
112 | if [ "$1" = 0 ]; then | |
113 | %php_webserver_restart | |
114 | fi | |
115 | ||
116 | %files | |
117 | %defattr(644,root,root,755) | |
1686b051 ER |
118 | %doc CREDITS |
119 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini | |
120 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |