File php5-memcache.spec of Package php53-memcache

# spec file for package php53-memcache
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%define pkg_name memcache
%define conf_dir %{_sysconfdir}/php5/conf.d
%define ext_dir  %(%{__php_config} --extension-dir)
Name:           php53-memcache
Version:        3.0.8
Release:        0
Summary:        PHP Memcache client Extension
License:        PHP-3.01
Group:          Productivity/Networking/Web/Servers
Source1:        %{pkg_name}.ini
Patch0:         %{pkg_name}-faulty-inline.diff
BuildRequires:  memcached
BuildRequires:  php53-devel
%if 0%{?suse_version} > 1110
BuildRequires:  sysvinit-tools
BuildRequires:  zlib-devel
Requires:       php(api) = %{php_core_api}
Requires:       php(zend-abi) = %{php_zend_api}
Provides:       php-memcache = %{version}
Obsoletes:      php-memcache < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Memcached is a caching daemon designed especially for dynamic web applications
to decrease database load by storing objects in memory.  This extension allows
you to work with memcached through handy OO and procedural interfaces.

%setup -q -n %{pkg_name}-%{version}
%patch0 -p1

CFLAGS="%{optflags} -fno-strict-aliasing"
CXXFLAGS="%{optflags} -fno-strict-aliasing"
export CFLAGS

%configure --enable-memcache --with-pic
make %{?_smp_mflags}

cp %{SOURCE2} tests/
install -d -m 0755 %{_localstatedir}/tmp/memcached/
%{_sbindir}/memcached -vv -p 11211 -U 11211 -d
%{_sbindir}/memcached -vv -p 11212 -U 11212 -d
%{_sbindir}/memcached -vv -s %{_localstatedir}/tmp/memcached/memcached.sock -a 777 -d
sleep 5
/sbin/killproc -v -TERM %{_sbindir}/memcached

make INSTALL_ROOT=%{buildroot} install
install -D -m 0644 %{SOURCE1} %{buildroot}%{conf_dir}/%{pkg_name}.ini

%doc CREDITS LICENSE README example.php memcache.php
%config(noreplace) %{conf_dir}/%{pkg_name}.ini