%define modname memcached %define dirname %{modname} %define soname %{modname}.so %define inifile A91_%{modname}.ini Summary: A libmemcached library interface for PHP Name: php-%{modname} Version: 3.0.3 Release: %mkrel 1 Group: Development/PHP License: PHP License URL: http://pecl.php.net/package/memcached Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz Source1: %{modname}.ini Patch0: memcached-2.2.0-build.patch BuildRequires: pkgconfig(libmemcached) >= 1.0.17 BuildRequires: php-devel >= 3:5.2.1 BuildRequires: dos2unix %description This extension uses libmemcached library to provide API for communicating with memcached servers. %prep %setup -q -n %{modname}-%{version} [ "../package.xml" != "/" ] && mv ../package.xml . cp %{SOURCE1} %{inifile} find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; # strip away annoying ^M find -type f | grep -v ".gif" | grep -v ".png" | grep -v ".jpg" | xargs dos2unix # Fix FTBFS with libmemcached >= 1.0.17 # https://github.com/php-memcached-dev/php-memcached/issues/69#issuecomment-17051990 echo 'typedef const struct memcached_server_st *memcached_server_instance_st;' \ >>php_libmemcached_compat.h %build %serverbuild %autopatch -p1 phpize %configure2_5x --with-libdir=%{_lib} \ --enable-%{modname}=shared,%{_prefix} \ --with-zlib-dir=%{_prefix} %make_build mv modules/*.so . %install install -d %{buildroot}%{_libdir}/php/extensions install -d %{buildroot}%{_sysconfdir}/php.d install -m0755 %{soname} %{buildroot}%{_libdir}/php/extensions/ install -m0644 %{inifile} %{buildroot}%{_sysconfdir}/php.d/%{inifile} %files %doc CREDITS ChangeLog memcached-api.php package.xml %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/php.d/%{inifile} %attr(0755,root,root) %{_libdir}/php/extensions/%{soname}