# The naming scheme in non-Mandriva-based distros %if 0%{!?mklibname:1} %define mklibname(ds) lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel} %endif %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif %define major 1 %define libname %mklibname %{name} %{major} %define libname_devel %mklibname %{name} -d Name: createrepo_c Summary: Creates a common metadata repository Group: System/Packaging Version: 1.2.0 Release: %mkrel 1 License: GPLv2 URL: https://github.com/rpm-software-management/createrepo_c Source0: https://github.com/rpm-software-management/createrepo_c/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: doxygen BuildRequires: pkgconfig(libmagic) >= 5.40-5 BuildRequires: glib2-devel >= 2.22.0 BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(rpm) >= 4.9.0 BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(bash-completion) BuildRequires: pkgconfig(drpm) >= 0.4.1 BuildRequires: pkgconfig(modulemd-2.0) >= 2.3.0 BuildRequires: pkgconfig(zck) >= 0.9.11 BuildRequires: xz BuildRequires: zchunk BuildRequires: pkgconfig(python3) BuildRequires: python3dist(nose) BuildRequires: python3dist(sphinx) # prevent provides from nonstandard paths: %define __provides_exclude_from ^(%{python3_sitearch}/.*\\.so)$ # Replaces createrepo Obsoletes: createrepo < 0.11.0 Provides: createrepo = %{version}-%{release} %description C implementation of Createrepo. A set of utilities (createrepo_c, mergerepo_c, modifyrepo_c) for generating a common metadata repository from a directory of rpm packages and maintaining it. %package -n %{libname} Summary: Library for repodata manipulation Group: System/Libraries %description -n %{libname} Libraries for applications using the createrepo_c library for easy manipulation with a repodata. %package -n %{libname_devel} Summary: Library for repodata manipulation Group: Development/C Provides: %{name}-devel = %{version}-%{release} Requires: pkgconfig %description -n %{libname_devel} This package contains the createrepo_c C library and header files. These development files are for easy manipulation with a repodata. %package -n python3-%{name} Summary: Python 3 bindings for the createrepo_c library Group: Development/Python %{?python_provide:%python_provide python3-%{name}} Requires: %{libname}%{?_isa} = %{version}-%{release} %description -n python3-createrepo_c Python 3 bindings for the createrepo_c library. %prep %autosetup -p1 %build %cmake \ -DWITH_LEGACY_HASHES:BOOL=ON \ -DENABLE_DRPM:BOOL=ON %cmake_build %cmake_build --target doc-c %check pushd %{_vpath_builddir} make tests make ARGS="-V" test popd %install %cmake_install # To replace createrepo for binaries and manpages for i in createrepo mergerepo modifyrepo sqliterepo;do ln -s %{_bindir}/$i\_c %{buildroot}%{_bindir}/$i echo ".so man8/$i\_c.8" > %{buildroot}%{_mandir}/man8/$i\.8 done %files %doc README.md %license COPYING %{_mandir}/man8/createrepo_c.8* %{_mandir}/man8/mergerepo_c.8* %{_mandir}/man8/modifyrepo_c.8* %{_mandir}/man8/sqliterepo_c.8* %{_mandir}/man8/createrepo.8* %{_mandir}/man8/mergerepo.8* %{_mandir}/man8/modifyrepo.8* %{_mandir}/man8/sqliterepo.8* %{_datadir}/bash-completion/completions/ %{_bindir}/createrepo_c %{_bindir}/mergerepo_c %{_bindir}/modifyrepo_c %{_bindir}/sqliterepo_c %{_bindir}/createrepo %{_bindir}/mergerepo %{_bindir}/modifyrepo %{_bindir}/sqliterepo %files -n %{libname} %license COPYING %{_libdir}/libcreaterepo_c.so.%{major}{,.*} %files -n %{libname_devel} %license COPYING %doc build/doc/html %{_libdir}/libcreaterepo_c.so %{_libdir}/pkgconfig/createrepo_c.pc %{_includedir}/createrepo_c/ %files -n python3-createrepo_c %license COPYING %{python3_sitearch}/createrepo_c/ %{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info