File php7-psr.spec of Package php7-psr

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


%define _name           php-psr
%define _module_name    psr
%define _php            php7
%define _architecture   %([[ %{_arch} == "i586" ]] && echo "32bits" || echo "64bits")

Name:           %{_php}-psr
Version:        1.0.0
Release:        0
Summary:        PHP7 Extension Module
License:        BSD-2-Clause
Group:          Development/Libraries/PHP
URL:             https://github.com/jbboehr/php-psr
Source0:        https://github.com/jbboehr/%{_name}/archive/v%{version}.tar.gz#/%{_name}-%{version}.tar.gz
BuildRequires:  %{_php}-ctype
BuildRequires:  %{_php}-devel
BuildRequires:  %{_php}-json
BuildRequires:  %{_php}-pdo
BuildRequires:  gcc
BuildRequires:  make
BuildRequires:  automake
BuildRequires:  autoconf

%description
This extension provides the accepted PSR interfaces, so they can be used in an extension.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries/PHP
Requires:       %{name} = %{version}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%setup -q -n %{_name}-%{version}

%build
%{_bindir}/phpize
phpize
%configure --enable-%{_name}
make VERBOSE=1 %{?_smp_mflags}

%check
make %{?_smp_mflags} PHP_EXECUTABLE=%{__php} NO_INTERACTION=1 test


%install
mkdir -p %{buildroot}%{_libdir}/%{_php}/extensions
mkdir -p %{buildroot}%{_sysconfdir}/%{_php}/conf.d
make INSTALL_ROOT=%{buildroot} install-modules

echo "; comment out next line to disable %{_name} extension in php" > %{buildroot}/%{_sysconfdir}/%{_php}/conf.d/%{_name}.ini
echo "extension=%{_module_name}.so" >> %{buildroot}/%{_sysconfdir}/%{_php}/conf.d/%{_name}.ini

%files
%defattr(644,root,root,755)
%doc CHANGELOG.md README.md
%{_libdir}/%{_php}/extensions/%{_module_name}.so
%config(noreplace) %{_sysconfdir}/%{_php}/conf.d/%{_name}.ini

%changelog
openSUSE Build Service is sponsored by