File php5-igbinary.spec of Package php5-igbinary

#
# spec file for package php5-igbinary
#
# 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    igbinary
#
Name:           php5-%{pkg_name}
Version:        1.2.1
Release:        0
Summary:        Replacement for the Standard PHP Serializer
# need to ask authors to clarify. There's 'New BSD' in package description,
# PHP-3.01 in igbinary-1.2.1/apc_serializer.h and 'PHP Style License' in
# igbinary-1.2.1/igbinary.spec
License:        PHP
Group:          Productivity/Networking/Web/Servers
Url:            http://pecl.php.net/
Source:         https://pecl.php.net/get/%{pkg_name}-%{version}.tgz
BuildRequires:  php5-APCu-devel
BuildRequires:  php5-devel
Provides:       php-igbinary = %{version}
Obsoletes:      php-igbinary < %{version}
#
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

%description
Igbinary is a drop in replacement for the standard php serializer.

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

%build
%{_bindir}/phpize
pushd %{name}
CFLAGS="%{optflags}"
CXXFLAGS="%{optflags}"
export CFLAGS
export CXXFLAGS
../configure --with-libdir=%{_lib}
make %{?_smp_mflags}
popd

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags} -C %{name} INSTALL_ROOT=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/php5/conf.d
echo "; comment out next line to disable %{pkg_name} extension in php" > %{buildroot}%{_sysconfdir}/php5/conf.d/%{pkg_name}.ini
echo "extension = %{pkg_name}.so" >> %{buildroot}%{_sysconfdir}/php5/conf.d/%{pkg_name}.ini

%check
pushd %{name}
make %{?_smp_mflags} test
popd

%files
%defattr(644,root,root,755)
%{_libdir}/php5/extensions/%{pkg_name}.so
%config(noreplace) %{_sysconfdir}/php5/conf.d/%{pkg_name}.ini
%dir %{_includedir}/php5/ext/igbinary
%{_includedir}/php5/ext/igbinary/igbinary.h
%doc CREDITS

%changelog