File criterion.spec of Package criterion

# spec file for package criterion
# Copyright (c) 2023 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 _lto_cflags %{nil}
%define sover 3

Name:           criterion
Version:        2.4.2
Release:        0
Summary:        A dead-simple, yet extensible, C and C++ unit testing framework
License:        MIT
Patch0:         fix-meson.patch
BuildRequires:  boxfort-devel
BuildRequires:  chrpath
BuildRequires:  cmake
BuildRequires:  debugbreak-devel
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  gettext
BuildRequires:  klib-devel
BuildRequires:  libprotobuf-nanopb0
BuildRequires:  meson
BuildRequires:  nanopb-devel
BuildRequires:  pkgconfig
BuildRequires:  python3-protobuf
BuildRequires:  python3-setuptools
BuildRequires:  pkgconfig(libffi)
BuildRequires:  pkgconfig(libgit2)
BuildRequires:  pkgconfig(nanomsg)
BuildRequires:  pkgconfig(protobuf)
BuildRequires:  pkgconfig(protobuf-lite)


Criterion follows the KISS principle, while keeping the control the user would have with other frameworks:
* C99 and C++11 compatible.
* Tests are automatically registered when declared.
* Implements a xUnit framework structure.
* A default entry point is provided, no need to declare a main unless you want to do special handling.
* Test are isolated in their own process, crashes and signals can be reported and tested.
* Unified interface between C and C++: include the criterion header and it just works.
* Supports parameterized tests and theories.
* Progress and statistics can be followed in real time with report hooks.
* TAP output format can be enabled with an option.
* Runs on Linux, FreeBSD, macOS, and Windows (Compiling with MinGW GCC and Visual Studio 2015+).

%package -n lib%{name}%{sover}
Summary:        Libraries needed to use Criterion
Requires:       lib%{name}%{sover}-devel = %{version}

%description -n lib%{name}%{sover}
This packages contains all the libraries needed to use Criterion.

%package -n lib%{name}-devel
Summary:        Devel files for Criterion
Requires:       lib%{name}%{sover} = %{version}
# devel package was wrongly named after the library, including version
Provides:       lib%{name}3-devel = 2.4.2
Obsoletes:      lib%{name}3-devel <= 2.4.2

%description -n lib%{name}-devel
Contains all needed devel files for Criterion.

%autosetup -n Criterion-%{version}

# we disable tests because they require Cram, a no longer upstream maintained tool that's also not in openSUSE.
%meson -Dtests=false

chrpath -d %{buildroot}%{_libdir}/lib%{name}.so.%{sover}*
%find_lang %{name}

%post -n lib%{name}%{sover} -p /sbin/ldconfig
%postun -n lib%{name}%{sover} -p /sbin/ldconfig

%license LICENSE
%doc AUTHORS ChangeLog

%files -n lib%{name}%{sover}

%files -n lib%{name}-devel
%dir %{_includedir}/criterion
%dir %{_includedir}/criterion/internal
%dir %{_includedir}/criterion/internal/assert
%dir %{_includedir}/criterion/new

%files lang -f %{name}.lang

openSUSE Build Service is sponsored by