File genfit.spec of Package GENFIT
#
# spec file for package genfit
#
# Copyright (c) 2025 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 upstream_version 02-00-05
%define libname libgenfit2-2_2
Name: genfit
Version: 2.0.5
Release: 0
Summary: Toolkit for track reconstruction in particle and nuclear physics
License: LGPL-3.0-or-later
Group: Development/Libraries/C and C++
Url: https://github.com/GenFit/GenFit
Source: https://github.com/GenFit/GenFit/archive/refs/tags/%{upstream_version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gtest
BuildRequires: root6-devel
# for documentation
BuildRequires: graphviz
BuildRequires: graphviz-gd
BuildRequires: doxygen
BuildRequires: fdupes
%description
GENFIT is an experiment-independent framework for track reconstruction
for particle and nuclear physics.
%package -n %{libname}
Summary: Toolkit for track reconstruction in particle and nuclear physics
Group: Development/Libraries/C and C++
%description -n %{libname}
GENFIT is an experiment-independent framework for track reconstruction for
particle and nuclear physics. It consists of three modular components:
* Track fitting algorithms
* Track representations
* Reconstruction hits
%package devel
Summary: Toolkit for track reconstruction in particle and nuclear physics
Group: Development/Libraries/C and C++
Requires: %{libname} = %{version}
%description devel
GENFIT is an experiment-independent framework for track reconstruction for
particle and nuclear physics.
This package provides the header files and libraries for development of
applications using GENFIT.
%package doc
Summary: Toolkit for track reconstruction for experiments in particle & nuclear physics
Group: Documentation/HTML
Requires: %{libname} = %{version}
BuildArch: noarch
%description doc
GENFIT is an experiment-independent framework for track reconstruction for
particle and nuclear physics.
This package provides the API documentation for developers.
%prep
%setup -q -n GenFit-%{upstream_version}
sed -i -e 's/HTML_TIMESTAMP.*/HTML_TIMESTAMP = NO/' doc/Doxyfile.in
%build
%cmake \
-DLIBRARY_OUTPUT_DIRECTORY=%{_libdir} \
%{nil}
%cmake_build
%cmake_build doc
%install
%cmake_install
# Remove unit test binary
rm %{buildroot}/%{_bindir}/gtests
mkdir -p %{buildroot}/%{_docdir}/%{name}
cp -pR doc/html/* %{buildroot}/%{_docdir}/%{name}
%fdupes %{buildroot}/%{_docdir}/%{name}
%check
%ifarch aarch64 ppc64 ppc64le
# https://github.com/GenFit/GenFit/issues/117
%define ctest_filter --exclude-regex '.*RKPropagate0?'
%endif
%ctest --show-only %ctest_filter
%ctest %ctest_filter
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files -n %{libname}
%{_libdir}/libgenfit2.so.*
%files devel
%{_includedir}/*
%{_libdir}/libgenfit2.so
%files doc
%doc README.md
%{_docdir}/%{name}
%changelog