%define major 0 %define libname %{?_lib}repo%major %define libname_devel %{?_lib}repo-devel %global libcurl_version 7.52.0 %if 0%{?rhel} %bcond_with zchunk %else %bcond_without zchunk %endif %if 0%{?fedora} >= 39 %bcond_with use_gpgme %bcond_with use_selinux %elif 0%{?mageia} %bcond_without use_gpgme %bcond_with use_selinux %else %bcond_without use_gpgme %bcond_without use_selinux %endif # Needs to match how gnupg2 is compiled %bcond_with run_gnupg_user_socket %if %{with use_gpgme} && %{with use_selinux} %bcond_without selinux %else %bcond_with selinux %endif Name: librepo Version: 1.18.0 Release: 1%{?dist} Summary: Repodata downloading library Group: System/Libraries License: LGPL-2.1-or-later URL: https://github.com/rpm-software-management/librepo Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: gcc BuildRequires: check-devel BuildRequires: doxygen BuildRequires: pkgconfig(glib-2.0) >= 2.66 %if %{with use_gpgme} BuildRequires: gpgme-devel %else BuildRequires: pkgconfig(rpm) >= 4.18.0 %endif BuildRequires: libattr-devel BuildRequires: libcurl-devel >= %{libcurl_version} BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libcrypto) %if %{with selinux} BuildRequires: pkgconfig(libselinux) %endif BuildRequires: pkgconfig(openssl) %if %{with zchunk} BuildRequires: pkgconfig(zck) >= 0.9.11 %endif %description A library providing C and Python (libcURL like) API to downloading repository metadata. %package -n %{libname} Summary: Libraries for %{name} Group: System/Libraries Provides: %{name} = %{version}-%{release} Provides: %{name}%{?_isa} = %{version}-%{release} %description -n %{libname} Libraries for %{name}. %package -n %{libname_devel} Summary: Repodata downloading library Group: Development/C Provides: %{name}-devel = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release} %description -n %{libname_devel} Development files for %{name}. %package -n python3-%{name} Summary: Python 3 bindings for the librepo library Group: Development/Python %{?python_provide:%python_provide python3-%{name}} BuildRequires: python3-devel BuildRequires: python3-gpg BuildRequires: python3-pyxattr BuildRequires: python3-requests BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme Requires: %{name}%{?_isa} = %{version}-%{release} %description -n python3-%{name} Python 3 bindings for the librepo library. %prep %autosetup -p1 %build %cmake \ -DWITH_ZCHUNK=%{?with_zchunk:ON}%{!?with_zchunk:OFF} \ -DUSE_GPGME=%{?with_use_gpgme:ON}%{!?with_use_gpgme:OFF} \ -DUSE_RUN_GNUPG_USER_SOCKET=%{?with_run_gnupg_user_socket:ON}%{!?with_run_gnupg_user_socket:OFF} \ -DENABLE_SELINUX=%{?with_selinux:ON}%{!?with_selinux:OFF} %cmake_build %check %ctest %install %cmake_install %files -n %{libname} %license COPYING %doc README.md %{_libdir}/%{name}.so.%{major} %files -n %{libname_devel} %{_libdir}/%{name}.so %{_libdir}/pkgconfig/%{name}.pc %{_includedir}/%{name}/ %files -n python3-%{name} %{python3_sitearch}/%{name}/