A new user interface for you! Read more...

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 http://bugs.opensuse.org/
#


%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
Url:            http://pecl.php.net/package/memcache
Source0:        http://pecl.php.net/get/%{pkg_name}-%{version}.tgz
Source1:        %{pkg_name}.ini
Source2:        connect.inc
Patch0:         %{pkg_name}-faulty-inline.diff
BuildRequires:  memcached
BuildRequires:  php53-devel
%if 0%{?suse_version} > 1110
BuildRequires:  sysvinit-tools
%endif
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

%description
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.

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

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

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

%check
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
make PHP_EXECUTABLE=%{__php} NO_INTERACTION=1 test
/sbin/killproc -v -TERM %{_sbindir}/memcached

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

%files
%defattr(-,root,root)
%doc CREDITS LICENSE README example.php memcache.php
%{ext_dir}/%{pkg_name}.so
%config(noreplace) %{conf_dir}/%{pkg_name}.ini

%changelog