File php5-xcache.spec of Package php5-xcache

#
# spec file for package php5-xcache
#
# 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    xcache
%define extra_ver   %{nil}
#
Name:           php5-xcache
Version:        3.2.0
Release:        0
#
Summary:        A fast, stable php opcode cacher
License:        BSD-3-Clause
Group:          Productivity/Networking/Web/Servers
#
Url:            http://xcache.lighttpd.net/
Source:         http://xcache.lighttpd.net/pub/Releases/%{version}/xcache-%{version}.tar.bz2
# PATCH-MISSING-TAG -- See http://en.opensuse.org/Packaging/Patches
Patch0:         xcache-ini.patch
BuildRequires:  indent
BuildRequires:  php5-devel >= 5.1
Conflicts:      php5-APC
Conflicts:      php5-eaccelerator
Provides:       php-xcache = %{version}
Obsoletes:      php-xcache < %{version}
Provides:       php5_code_cache
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{?php_zend_api}0
Requires:       php(api) = %{php_core_api}
Requires:       php(zend-abi) = %{php_zend_api}
%else
%requires_eq    php5
%endif
%if 0%{?suse_version} > 1000
Enhances:       php5
%endif

%description
XCache is a fast, stable php opcode cacher that has been tested and now running
on production server under high load. It support and is tested on all lastest
php cvs branches, such as PHP_4_3 PHP_4_4 PHP_5_1 PHP_5_2 HEAD(6.x)

%prep
%setup -q -n %{pkg_name}-%{version}%{extra_ver}
%patch0
mkdir %{name}

%build
%{_bindir}/phpize
pushd %{name}

CFLAGS="%{optflags}"

export CFLAGS

../configure --with-pic \
    --enable-xcache \
    --enable-xcache-coverager
make %{?_smp_mflags}
popd

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags} -C %{name} INSTALL_ROOT=%{buildroot}
install -D  -m 0644 xcache.ini %{buildroot}%{_sysconfdir}/php5/conf.d/xcache.ini
install -Dd -m 0755 %{buildroot}%{_datadir}/php5/xcache/
cp -rv htdocs/* %{buildroot}%{_datadir}/php5/xcache/
sed -i -e "s|@extension_dir@|`php-config --extension-dir`|g" %{buildroot}%{_sysconfdir}/php5/conf.d/xcache.ini


%files
%defattr(644,root,root,755)
%{_libdir}/php5/extensions/xcache.so
%config(noreplace) %{_sysconfdir}/php5/conf.d/xcache.ini
%dir %{_datadir}/php5/xcache/
%{_datadir}/php5/xcache/*
%doc AUTHORS COPYING THANKS

%changelog
openSUSE Build Service is sponsored by