%global commit f0c11f7ca17311fc488933a6cc253953c1b54273 %global date 20230315 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: cnkalman Version: 0.1^%{date}git%{shortcommit} Release: %autorelease Summary: Low level implementation of a kalman filter License: MIT URL: https://github.com/cntools/cnkalman ExcludeArch: %{ix86} Source0: %{url}/archive/%{commit}.tar.gz#/%{name}-%{shortcommit}.tar.gz Patch0: cnkalman-shared.patch BuildRequires: cmake BuildRequires: cnmatrix-devel BuildRequires: gcc-c++ BuildRequires: git-core BuildRequires: python3-devel BuildRequires: python3-pybind11 BuildRequires: python3-rpm-macros BuildRequires: python3-symengine BuildRequires: sciplot0.2-devel %description Low level implementation of a kalman filter; with support for extended and iterative extended kalman filters. The goals of the project are to provide a numerically stable, robust EKF implementation which is both fast and portable. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package -n python3-%{name} Summary: %{summary} %description -n python3-%{name} Implements a Kalman filter using %{name}. %prep %autosetup -p1 -n %{name}-%{commit} %generate_buildrequires %pyproject_buildrequires -t %build %cmake -DENABLE_TESTS=ON %cmake_build %pyproject_wheel %install # CMake installation: # - Library in library directory # - Python filter in library directory # - File for pkgconfig # Python installation: # - Library in %%python3_sitearch # - Python filter in %%python3_sitearch # - Python module in %%python3_sitearch # Run both intallation methods and then remove the overlapping files installed # in %%python3_sitearch and the library directory. # %%pyproject_save_files can't be used as it would require editing the files # generated that overlap with the CMake installation. %cmake_install %pyproject_install rm -frv %{buildroot}%{_prefix}/lib/ find %{buildroot}%{python3_sitearch}/ -name "lib%{name}.so*" -print -delete %check %ctest %files %license LICENSE %doc README.md %{_libdir}/lib%{name}.so.0{,.*} %files devel %{_includedir}/%{name}/ %{_libdir}/lib%{name}.so %{_libdir}/pkgconfig/%{name}.pc %files -n python3-%{name} %{python3_sitearch}/%{name} %{python3_sitearch}/%{name}-*.dist-info %{python3_sitearch}/filter.cpython-*.so %changelog %autochangelog