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