1 |
%define modname memcached |
2 |
%define dirname %{modname} |
3 |
%define soname %{modname}.so |
4 |
%define inifile A91_%{modname}.ini |
5 |
|
6 |
Summary: A libmemcached library interface for PHP |
7 |
Name: php-%{modname} |
8 |
Version: 2.2.0 |
9 |
Release: %mkrel 0.0.RC1.1 |
10 |
Group: Development/PHP |
11 |
License: PHP License |
12 |
URL: http://pecl.php.net/package/memcached |
13 |
Source0: http://pecl.php.net/get/%{modname}-%{version}RC1.tgz |
14 |
Source1: %{modname}.ini |
15 |
BuildRequires: libmemcached-devel >= 1.0.0 |
16 |
BuildRequires: php-devel >= 3:5.2.1 |
17 |
BuildRequires: dos2unix |
18 |
|
19 |
%description |
20 |
This extension uses libmemcached library to provide API for communicating with |
21 |
memcached servers. |
22 |
|
23 |
%prep |
24 |
%setup -q -n %{modname}-%{version}RC1 |
25 |
[ "../package.xml" != "/" ] && mv ../package.xml . |
26 |
|
27 |
cp %{SOURCE1} %{inifile} |
28 |
|
29 |
find . -type d -exec chmod 755 {} \; |
30 |
find . -type f -exec chmod 644 {} \; |
31 |
|
32 |
# strip away annoying ^M |
33 |
find -type f | grep -v ".gif" | grep -v ".png" | grep -v ".jpg" | xargs dos2unix |
34 |
|
35 |
# Fix FTBFS with libmemcached >= 1.0.17 |
36 |
# https://github.com/php-memcached-dev/php-memcached/issues/69#issuecomment-17051990 |
37 |
echo 'typedef const struct memcached_server_st *memcached_server_instance_st;' \ |
38 |
>>php_libmemcached_compat.h |
39 |
|
40 |
%build |
41 |
%serverbuild |
42 |
|
43 |
phpize |
44 |
%configure2_5x --with-libdir=%{_lib} \ |
45 |
--enable-%{modname}=shared,%{_prefix} \ |
46 |
--with-zlib-dir=%{_prefix} |
47 |
|
48 |
%make |
49 |
mv modules/*.so . |
50 |
|
51 |
%install |
52 |
rm -rf %{buildroot} |
53 |
|
54 |
install -d %{buildroot}%{_libdir}/php/extensions |
55 |
install -d %{buildroot}%{_sysconfdir}/php.d |
56 |
|
57 |
install -m0755 %{soname} %{buildroot}%{_libdir}/php/extensions/ |
58 |
install -m0644 %{inifile} %{buildroot}%{_sysconfdir}/php.d/%{inifile} |
59 |
|
60 |
%clean |
61 |
rm -rf %{buildroot} |
62 |
|
63 |
%files |
64 |
%defattr(-,root,root) |
65 |
%doc CREDITS ChangeLog memcached-api.php package.xml |
66 |
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/php.d/%{inifile} |
67 |
%attr(0755,root,root) %{_libdir}/php/extensions/%{soname} |
68 |
|
69 |
|
70 |
|