Version: 2.0.2 %global forgeurl https://github.com/dmlc/xgboost %forgemeta Name: xgboost Release: 1%{?dist} Summary: Scalable and flexible gradient boosting License: Apache-2.0 URL: https://xgboost.readthedocs.io/en/stable/ Source0: %{forgesource} Source1: %{name}.1 Patch1: %{name}-soversion.patch BuildRequires: cmake gcc gcc-c++ python3-devel BuildRequires: dmlc-core dmlc-core-devel Requires: dmlc-core %{name}-libs = %{version}-%{release} %description XGBoost is an optimized distributed gradient boosting library designed to be highly efficient, flexible and portable. It implements machine learning algorithms under the Gradient Boosting framework. XGBoost provides parallel tree boosting (also known as GBDT, GBM) that solves many data science problems in a fast and accurate way. %package libs Summary: Run-time libraries for %{name} %description libs This package contains run-time libraries for %{name}. %package devel Summary: Development files for %{name} Requires: %{name}-libs = %{version}-%{release} %description devel This package contains development files for %{name}. %package -n python3-%{name} Summary: Python module for scalable and flexible gradient boosting %description -n python3-%{name} Python module for the eXtreme Gradient Boosting library, XGBoost. %prep %autosetup -p1 -n %{name}-%{version} rm -fr dmlc-core %build %cmake -DBUILD_SHARED_LIBS=no . %cmake_build pushd python-package #export XGBOOST_LIBPATH=%{_builddir}/%{name}-%{version} #%%pyproject_wheel -C use_system_libxgboost=True echo "import setuptools; setuptools.setup(packages=['xgboost'])" > setup.py %{__python3} setup.py build popd %install %cmake_install # install the man page install -Dpm644 %{SOURCE1} %{buildroot}/%{_mandir}/man1/%{name}.1 # fix cmake generation of lib[64] path in .pc file sed -i -e 's,/lib$,/%{_lib},g' %{buildroot}/usr/lib*/pkgconfig/%{name}.pc # install python module components pushd python-package #%%pyproject_install #%%pyproject_save_files xgboost %{__python3} setup.py install --root %{buildroot} --install-lib=%{python3_sitearch} echo %{version} > %{buildroot}%{python3_sitearch}/%{name}/VERSION popd %check %ctest %files %license LICENSE %doc README.md %doc CONTRIBUTORS.md %{_mandir}/man1/%{name}* %{_bindir}/* %files libs %{_libdir}/lib*.so.* %files devel %{_includedir}/* %{_libdir}/lib*.so %{_libdir}/cmake/* %{_libdir}/pkgconfig/* #%files -n python3-%%{name} -f %%{pyproject_files} #%doc README.md %files -n python3-%{name} %{python3_sitearch}/* %changelog * Wed Nov 29 2023 Nathan Scott - 2.0.2-1 - Initial version for Fedora.