File php-simpletest.spec of Package php-simpletest

#
# spec file for package php-simpletest
#
# 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        php_libdir         %{_datadir}/php%(echo %{php_version}|sed -e 's/[\.].*//')

Name:           php-simpletest
Version:        1.2.0
Release:        0
Summary:        Testing framework for PHP built around test cases
License:        LGPL-2.0+
Group:          Development/Libraries/Other
URL:            http://simpletest.org/
Source0:        https://api.github.com/repos/simpletest/simpletest/tarball/4fb6006517a1428785a0ea704fbedcc675421ec4#/simpletest-simpletest-4fb6006.tar.gz
Requires:       php >= 7.1
Requires:       php < 8
BuildRequires:  php-devel >= 7.1
BuildRequires:  php-devel < 8
BuildRequires:  php-dom
BuildRequires:  php-tidy
BuildRequires:  php-mbstring
BuildRequires:  fdupes
Provides:       php-composer(simpletest/simpletest) = 1.2.0

BuildArch:      noarch

%description
Unit testing, mock objects and web testing framework for PHP built around test cases.

%prep
%setup -q -n simpletest-simpletest-4fb6006

%build
# no building for packaging

%install
mkdir -p %{buildroot}%{php_libdir}/simpletest/simpletest
cp -a . %{buildroot}%{php_libdir}/simpletest/simpletest
%fdupes %{buildroot}

%check
# Run the tests whenever possible
cd test
php all_tests.php

%files
%doc README.md
%license LICENSE
%dir %{php_libdir}/simpletest
# Don't package tests but run them
%exclude %{php_libdir}/simpletest/simpletest/test
%exclude %{php_libdir}/simpletest/simpletest/README.md
%exclude %{php_libdir}/simpletest/simpletest/LICENSE
%exclude %{php_libdir}/simpletest/simpletest/.phan
%{php_libdir}/simpletest/simpletest

%changelog

openSUSE Build Service is sponsored by