A new user interface for you!

File php7-igbinary.spec of Package php7-igbinary

# spec file for package php7-igbinary
# Copyright (c) 2019 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 https://bugs.opensuse.org/

%define pkg_name igbinary
%define conf_dir %{_sysconfdir}/php7/conf.d
%define ext_dir  %(%{__php_config} --extension-dir)
%define inc_dir  %(%{__php_config} --include-dir)

%bcond_without apcu

Name:           php7-igbinary
Version:        3.0.1
Release:        0
Summary:        PHP igbinary extension
License:        BSD-3-Clause
Group:          Productivity/Networking/Web/Servers
URL:            https://pecl.php.net/package/igbinary
Source0:        https://pecl.php.net/get/%{pkg_name}-%{version}.tgz
BuildRequires:  php7-devel >= 7.0
BuildRequires:  php7-json
BuildRequires:  re2c
Requires:       php(api) = %{php_core_api}
Requires:       php(zend-abi) = %{php_zend_api}
Provides:       php-%{pkg_name} = %{version}
Obsoletes:      php-%{pkg_name} < %{version}
%if %{with apcu}
BuildRequires:  php7-APCu-devel
Recommends:     php7-APCu

Igbinary is a drop in replacement for the standard PHP serializer.
Instead of time and space consuming textual representation,
igbinary stores PHP data structures in a compact binary form.

%package devel
Summary:        Include Files and Libraries mandatory for Development
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.

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

export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"

%configure --enable-igbinary
make %{?_smp_mflags}

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

%if %{with apcu}
ln -s %{ext_dir}/apcu.so modules/
export TEST_PHP_ARGS="-d extension=%{ext_dir}/json.so -d error_reporting=0 -d session.save_path=/tmp"
make %{?_smp_mflags} PHP_EXECUTABLE=%{__php} NO_INTERACTION=1 test || :

%license COPYING
%doc CREDITS NEWS README.md igbinary.php
%config(noreplace) %{conf_dir}/%{pkg_name}.ini

%files devel