File php-APCu.spec of Package php-APCu

# spec file for package php-APCu
# Copyright (c) 2022 SUSE LLC
# 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  APCu
%define pkg_sname apcu

%define flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "" || (0%{?suse_version} >= 1550 && "%{flavor}" == "php7")
%define php_name php
ExclusiveArch:  do-not-build
%define php_name %{flavor}
%if 0%{?suse_version} <= 1500
%define php_extdir  %(%{__php_config} --extension-dir)
%define php_cfgdir  %{_sysconfdir}/%{php_name}/conf.d

Name:           %{php_name}-%{pkg_name}
Version:        5.1.22
Release:        0
Summary:        APCu - APC User Cache
License:        PHP-3.01
Group:          Productivity/Networking/Web/Servers
URL:  {pkg_name}
Source1:        apcu.ini
Source2:        php-%{pkg_name}-rpmlintrc
BuildRequires:  %{php_name}-devel >= 7.0
Requires:       php(api) = %{php_core_api}
Requires:       php(zend-abi) = %{php_zend_api}
Provides:       php-%{pkg_name} = %{version}
Obsoletes:      php-%{pkg_name} < %{version}

APCu is userland caching: APC stripped of opcode caching in preparation
for the deployment of Zend Optimizer+ as the primary solution to opcode
caching in future versions of PHP.

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

export CFLAGS="%{optflags} -fvisibility=hidden"
%configure --enable-apcu

%make_build PHP_EXECUTABLE=%{__php} NO_INTERACTION=1 test

make install-modules INSTALL_ROOT=%{buildroot}
install -D -m 0644 %{SOURCE1} %{buildroot}%{php_cfgdir}/%{pkg_sname}.ini

%doc NOTICE TECHNOTES.txt apc.php
%license LICENSE
%config(noreplace) %{php_cfgdir}/%{pkg_sname}.ini

openSUSE Build Service is sponsored by