%global __python3 /usr/bin/python3.11 %global python3_pkgversion 3.11 %global libsolv_version 0.7.21 %global libmodulemd_version 2.13.0 %global librepo_version 1.13.1 %global dnf_conflict 4.10.0-4 %global swig_version 3.0.12 %global libdnf_major_version 0 %global libdnf_minor_version 69 %global libdnf_micro_version 0 %define __cmake_in_source_build 1 %bcond_with valgrind %if 0%{?rhel} && ! 0%{?centos} %bcond_without rhsm %else %bcond_with rhsm %endif %bcond_without selinux %if 0%{?rhel} %bcond_with zchunk %else %bcond_without zchunk %endif %bcond_with sanitizers %global _cmake_opts \\\ -DENABLE_RHSM_SUPPORT=%{?with_rhsm:ON}%{!?with_rhsm:OFF} \\\ %{nil} Name: python%{python3_pkgversion}-libdnf Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} Release: 8%{?dist} Summary: Python %{python3_pkgversion} bindings for the libdnf library. License: LGPLv2+ URL: https://github.com/rpm-software-management/libdnf Source0: %{url}/archive/%{version}/libdnf-%{version}.tar.gz Patch1: 0001-Allow-change-of-arch-during-security-updates-with-no.patch Patch2: 0002-Add-repoid-to-solver-error-messages.patch Patch3: 0003-Update-translations-RHEL-9-2.patch Patch4: 0004-Update-translations-RHEL-9.3.patch Patch5: 0005-filterAdvisory-installed_solvables-sort-RhBug2212838.patch Patch6: 0006-hawkeysubject-get_best_selectors-only-obsol-oflatest.patch Patch7: 0007-Avoid-reinstal-installonly-packages-marked-for-ERASE.patch Patch8: 0008-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d.patch BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: libsolv-devel >= %{libsolv_version} BuildRequires: pkgconfig(librepo) >= %{librepo_version} BuildRequires: pkgconfig(check) %if %{with valgrind} BuildRequires: valgrind %endif BuildRequires: pkgconfig(gio-unix-2.0) >= 2.46.0 BuildRequires: pkgconfig(gtk-doc) BuildRequires: rpm-devel >= 4.15.0 %if %{with rhsm} BuildRequires: pkgconfig(librhsm) >= 0.0.3 %endif %if %{with zchunk} BuildRequires: pkgconfig(zck) >= 0.9.11 %endif BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(json-c) BuildRequires: pkgconfig(cppunit) %if %{with selinux} BuildRequires: pkgconfig(libselinux) %endif BuildRequires: pkgconfig(modulemd-2.0) >= %{libmodulemd_version} BuildRequires: pkgconfig(smartcols) BuildRequires: gettext BuildRequires: gpgme-devel %if %{with sanitizers} BuildRequires: libasan BuildRequires: liblsan BuildRequires: libubsan %endif Requires: libmodulemd%{?_isa} >= %{libmodulemd_version} Requires: libsolv%{?_isa} >= %{libsolv_version} Requires: librepo%{?_isa} >= %{librepo_version} Requires: libdnf%{?_isa} = %{version}-%{release} BuildRequires: git-core BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python3-sphinx BuildRequires: swig >= %{swig_version} %description Python %{python3_pkgversion} bindings for the libdnf library. %package -n python%{python3_pkgversion}-hawkey Summary: Python %{python3_pkgversion} bindings for the hawkey library BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools Requires: libdnf%{?_isa} = %{version}-%{release} Requires: python%{python3_pkgversion}-libdnf = %{version}-%{release} %description -n python%{python3_pkgversion}-hawkey Python %{python3_pkgversion} bindings for the hawkey library. %prep %autosetup -p1 -n libdnf-%{version} mkdir build-py3 %build pushd build-py3 %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} -DLIBDNF_MAJOR_VERSION=%{libdnf_major_version} -DLIBDNF_MINOR_VERSION=%{libdnf_minor_version} -DLIBDNF_MICRO_VERSION=%{libdnf_micro_version} \ -DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} \ -DENABLE_SELINUX=%{?with_selinux:ON}%{!?with_selinux:OFF} %make_build popd %check pushd build-py3 make ARGS="-V" test popd %install pushd build-py3 %make_install popd # remove non-python files rm -r %{buildroot}%{_libdir}/libdnf* rm -f %{buildroot}%{_sysconfdir}/profile.d/dnf-sanitizers.sh rm %{buildroot}/%{_libdir}/pkgconfig/libdnf.pc rm -r %{buildroot}/%{_includedir}/libdnf/ rm -r %{buildroot}/%{_datadir}/gtk-doc/html/libdnf/ rm %{buildroot}/usr/share/locale/*/LC_MESSAGES/libdnf.mo %files %license COPYING %doc README.md AUTHORS %{python3_sitearch}/libdnf/ %files -n python%{python3_pkgversion}-hawkey %{python3_sitearch}/hawkey/ %changelog * Fri May 17 2024 Ken Dreyer - 0.69.0-8 - Update for RHEL 9.4 - Thanks original package contributors: Petr Pisar Jaroslav Rohel Marek Blaha Nicola Sella * Wed Oct 25 2023 Ken Dreyer - 0.69.0-3 - Initial package for Python 3.11 - Thanks original package contributors: Ales Matej Daniel Mach Igor Gnatenko Jaroslav Mracek Lukas Hrazky Lumír Balhar Marek Blaha Martin Hatina Miro Hrončok Nicola Sella Pavla Kratochvilova Peter Robinson Stratakis Charalampos