#Notice:This spec file is from upstream community: #https://raw.githubusercontent.com/rpm-software-management/createrepo_c/2077ba104eae04bb819e9e0c906c8c835b62e7a6/createrepo_c.spec %global libmodulemd_version 2.3.0 # Bash completion (we need different approach for RHEL-6) %if 0%{?openEuler} == 0 && 0%{?rhel} == 6 %global bash_completion %config%{_sysconfdir}/bash_completion.d/createrepo_c.bash %else %global bash_completion %{_datadir}/bash-completion/completions/* %endif %if 0%{?openEuler} == 0 && 0%{?rhel} && 0%{?rhel} <= 7 %bcond_with python3 %bcond_with drpm %else %bcond_without python3 %bcond_without drpm %endif %if 0%{?openEuler} || 0%{?rhel} || 0%{?fedora} < 29 %bcond_with zchunk %else %bcond_without zchunk %endif %if 0%{?openEuler} || 0%{?rhel} || 0%{?fedora} < 29 %bcond_with libmodulemd %else %bcond_without libmodulemd %endif Summary: Creates a common metadata repository Name: createrepo_c Version: 1.0.1 Release: 2 License: GPLv2+ URL: https://github.com/rpm-software-management/createrepo_c Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Patch1: createrepo_c-Add-sw64-architecture.patch BuildRequires: cmake BuildRequires: gcc BuildRequires: bzip2-devel BuildRequires: doxygen BuildRequires: file-devel BuildRequires: glib2-devel >= 2.22.0 BuildRequires: libcurl-devel BuildRequires: libxml2-devel BuildRequires: openssl-devel BuildRequires: rpm-devel >= 4.8.0-28 BuildRequires: sqlite-devel BuildRequires: xz-devel BuildRequires: zlib-devel Requires: glib2 %if %{with zchunk} BuildRequires: pkgconfig(zck) >= 0.9.11 BuildRequires: zchunk %endif %if %{with libmodulemd} BuildRequires: pkgconfig(modulemd-2.0) >= %{libmodulemd_version} BuildRequires: libmodulemd Requires: libmodulemd%{?_isa} >= %{libmodulemd_version} %endif %if 0%{?openEuler} == 0 && 0%{?rhel} == 6 Requires: rpm >= 4.8.0-28 %else BuildRequires: bash-completion Requires: rpm >= 4.9.0 %endif %if %{with drpm} BuildRequires: drpm-devel >= 0.4.0 %endif BuildRequires: pkgconfig(libzstd) %if 0%{?openEuler} || 0%{?fedora} || 0%{?rhel} > 7 Obsoletes: createrepo < 0.11.0 Provides: createrepo = %{version}-%{release} %endif Provides: %{name}-libs = %{version}-%{release} %{name}-libs%{?_isa} = %{version}-%{release} Obsoletes: %{name}-libs < %{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 devel Summary: Library for repodata manipulation Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description devel This package contains the createrepo_c C library and header files. These development files are for easy manipulation with a repodata. %package_help %if %{with python3} %package -n python3-%{name} Summary: Python 3 bindings for the createrepo_c library %{?python_provide:%python_provide python3-%{name}} BuildRequires: python3-devel BuildRequires: python3-sphinx Requires: createrepo_c %description -n python3-%{name} Python 3 bindings for the createrepo_c library. %endif %prep %autosetup -p1 %build # Build createrepo_c with Pyhon 3 %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_libmodulemd:-DWITH_LIBMODULEMD=OFF} -DENABLE_DRPM=%{with_drpm:ON}%{!?with_drpm:OFF} make %{?_smp_mflags} RPM_OPT_FLAGS="%{optflags}" # Build C documentation make doc-c %check # Run Python 3 tests %if %{with python3} # Compile C tests make tests # Run Python 3 tests make ARGS="-V" test %endif %install # Install createrepo_c with Python 3 make install DESTDIR=%{buildroot} %if 0%{?openEuler} || 0%{?fedora} || 0%{?rhel} > 7 ln -sr %{buildroot}%{_bindir}/createrepo_c %{buildroot}%{_bindir}/createrepo ln -sr %{buildroot}%{_bindir}/mergerepo_c %{buildroot}%{_bindir}/mergerepo ln -sr %{buildroot}%{_bindir}/modifyrepo_c %{buildroot}%{_bindir}/modifyrepo %endif %if 0%{?openEuler} == 0 && 0%{?rhel} && 0%{?rhel} <= 7 %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %else %ldconfig_scriptlets %endif %files %doc README.md %license COPYING AUTHORS %{_bindir}/createrepo_c %{_bindir}/mergerepo_c %{_bindir}/modifyrepo_c %{_bindir}/sqliterepo_c %{_libdir}/lib%{name}.so.* %{bash_completion} %if 0%{?openEuler} || 0%{?fedora} || 0%{?rhel} > 7 %{_bindir}/createrepo %{_bindir}/mergerepo %{_bindir}/modifyrepo %endif %files devel %{_libdir}/lib%{name}.so %{_libdir}/pkgconfig/%{name}.pc %{_includedir}/%{name}/ %files help %doc doc/html %{_mandir}/man8/createrepo_c.8* %{_mandir}/man8/mergerepo_c.8* %{_mandir}/man8/modifyrepo_c.8* %{_mandir}/man8/sqliterepo_c.8* %if %{with python3} %files -n python3-%{name} %{python3_sitearch}/%{name}/ %{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info %endif %changelog * Tue Aug 13 2024 wangjiang - 1.0.1-2 - Add sw64 architecture * Thu Feb 1 2024 caixiaomeng - 1.0.1-1 - update version to 1.0.1 * Thu Jan 19 2023 Lv Ying - 0.20.1-1 - update version to 0.20.1 * Sat Oct 22 2022 yanglongkang - 0.17.6-2 - add the dynamic library file in the rpm package to the ldconfig management fix rpmbuild warning * Wed Dec 29 2021 yangzhuangzhuang - 0.17.6-1 - update version to 0.17.6 * Thu Jan 21 2021 yangzhuangzhuang - 0.16.2-1 - update 0.16.2 * Sat Jul 25 2020 Liquor - 0.16.0-2 - remove python2 * Sat Jul 25 2020 Liquor - 0.16.0-1 - update 0.16.0 * Wed Apr 8 2020 openEuler Buildteam - 0.15.0-5 - Type:bugfix - ID:NA - SUG:NA - DESC:Add judgement of openEuler * Sat Mar 14 2020 openEuler Buildteam - 0.15.0-4 - Add build requires of gdb * Mon Oct 21 2019 openEuler Buildteam - 0.15.0-3 - Package rebuild. * Wed Oct 09 2019 openEuler Buildteam - 0.15.0-2 - Add notice; Split and merge package with openeuler`s rules. * Sat Sep 21 2019 openEuler Buildteam - 0.15.0-1 - Package init.