diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | createrepo_c-1.1.4-port-to-newer-cmake.patch | 67 | ||||
-rw-r--r-- | createrepo_c.spec | 206 | ||||
-rw-r--r-- | sources | 1 |
4 files changed, 275 insertions, 0 deletions
@@ -0,0 +1 @@ +/createrepo_c-1.2.1.tar.gz diff --git a/createrepo_c-1.1.4-port-to-newer-cmake.patch b/createrepo_c-1.1.4-port-to-newer-cmake.patch new file mode 100644 index 0000000..5a07d3e --- /dev/null +++ b/createrepo_c-1.1.4-port-to-newer-cmake.patch @@ -0,0 +1,67 @@ +--- a/CMakeLists.txt 2025-03-02 01:18:14.318624400 +0800 ++++ b/CMakeLists.txt 2025-03-02 01:18:27.362966500 +0800 +@@ -1,4 +1,4 @@ +-CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12) ++CMAKE_MINIMUM_REQUIRED (VERSION 3.12) + PROJECT (createrepo_c C) + + include(GNUInstallDirs) +--- a/src/python/CMakeLists.txt 2025-03-02 01:25:16.347289500 +0800 ++++ b/src/python/CMakeLists.txt 2025-03-02 01:30:53.575112200 +0800 +@@ -1,3 +1,4 @@ ++CMAKE_MINIMUM_REQUIRED (VERSION 3.12) + MACRO(PYTHON_UNSET) + unset(PYTHON_LIBRARY) + unset(PYTHON_INCLUDE_DIR) +@@ -10,14 +11,12 @@ + if (NOT SKBUILD) + PYTHON_UNSET() + SET(Python_ADDITIONAL_VERSIONS 3.0 CACHE INTERNAL "") +- FIND_PACKAGE(PythonInterp 3 REQUIRED) +- FIND_PACKAGE(PythonLibs 3 REQUIRED) ++ FIND_PACKAGE(Python3 COMPONENTS Interpreter Development REQUIRED) + endif (NOT SKBUILD) + +-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from sysconfig import get_path; stdout.write(get_path('platlib'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) +-INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH}) ++INCLUDE_DIRECTORIES (${Python3_INCLUDE_DIRS}) + +-MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}") ++MESSAGE(STATUS "Python install dir is ${Python3_SITEARCH}") + + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing") + set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-strict-aliasing") +@@ -61,7 +60,7 @@ + find_package(PythonExtensions REQUIRED) + python_extension_module(_createrepo_c) + ELSE () +- TARGET_LINK_LIBRARIES(_createrepo_c ${PYTHON_LIBRARY}) ++ TARGET_LINK_LIBRARIES(_createrepo_c ${Python3_LIBRARIES}) + ENDIF () + + IF (NOT SKBUILD) +@@ -72,9 +71,9 @@ + INSTALL(FILES createrepo_c/__init__.py DESTINATION src/python/createrepo_c) + INSTALL(TARGETS _createrepo_c LIBRARY DESTINATION src/python/createrepo_c) + ELSE () +- INSTALL(FILES createrepo_c/__init__.py DESTINATION ${PYTHON_INSTALL_DIR}/createrepo_c) +- INSTALL(TARGETS _createrepo_c LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}/createrepo_c) ++ INSTALL(FILES createrepo_c/__init__.py DESTINATION ${Python3_SITEARCH}/createrepo_c) ++ INSTALL(TARGETS _createrepo_c LIBRARY DESTINATION ${Python3_SITEARCH}/createrepo_c) + + # Version has to be passed as last argument. +- INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/utils/setup_for_python_metadata.py install_egg_info --install-dir \$ENV{DESTDIR}/${PYTHON_INSTALL_DIR} ${VERSION})") ++ INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/utils/setup_for_python_metadata.py install_egg_info --install-dir \$ENV{DESTDIR}/${Python3_SITEARCH} ${VERSION})") + ENDIF () +--- a/tests/python/tests/run_unittests.sh.in 2025-03-02 01:50:04.391277100 +0800 ++++ b/tests/python/tests/run_unittests.sh.in 2025-03-02 01:50:13.784612400 +0800 +@@ -1 +1 @@ +-LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src/: PYTHONPATH=${CMAKE_BINARY_DIR}/src/python/ WITH_LIBMODULEMD=${WITH_LIBMODULEMD} ${PYTHON_EXECUTABLE} -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR}/../ ++LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src/: PYTHONPATH=${CMAKE_BINARY_DIR}/src/python/ WITH_LIBMODULEMD=${WITH_LIBMODULEMD} ${Python3_EXECUTABLE} -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR}/../ +--- a/tests/python/tests/CMakeLists.txt 2025-03-02 01:49:53.007878700 +0800 ++++ b/tests/python/tests/CMakeLists.txt 2025-03-02 02:15:53.271724600 +0800 +@@ -1,2 +1,4 @@ ++CMAKE_MINIMUM_REQUIRED(VERSION 3.12) ++FIND_PACKAGE(Python3) + CONFIGURE_FILE("run_unittests.sh.in" "${CMAKE_BINARY_DIR}/tests/python/tests/run_unittests.sh") + ADD_TEST(test_python run_unittests.sh -s ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/createrepo_c.spec b/createrepo_c.spec new file mode 100644 index 0000000..b718abf --- /dev/null +++ b/createrepo_c.spec @@ -0,0 +1,206 @@ +#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 + +%bcond_without python3 +%bcond_without drpm + +%bcond_with zchunk +%bcond_with libmodulemd + +Summary: Creates a common metadata repository +Name: createrepo_c +Version: 1.2.1 +Release: 1 +License: GPL-2.0-or-later +URL: https://github.com/rpm-software-management/createrepo_c +Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +Patch0: createrepo_c-1.1.4-port-to-newer-cmake.patch + +BuildRequires: cmake >= 3.12 +BuildRequires: pkgconfig(bash-completion) +BuildRequires: pkgconfig(gio-2.0) +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(gthread-2.0) +BuildRequires: pkgconfig(liblzma) +BuildRequires: pkgconfig(libzstd) +BuildRequires: pkgconfig(rpm) +BuildRequires: pkgconfig(sqlite3) >= 3.6.18 +BuildRequires: bzip2-devel +BuildRequires: libcurl-devel +BuildRequires: libxml2-devel +BuildRequires: openssl-devel +BuildRequires: zlib-devel +BuildRequires: doxygen +%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 %{with drpm} +BuildRequires: pkgconfig(drpm) >= 0.4.0 +%endif +Requires: rpm >= 4.9.0 + +Obsoletes: createrepo < 0.11.0 +Provides: createrepo = %{version}-%{release} +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} +Requires: bzip2-devel pkgconfig(lzma) + +%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: %{name}-libs%{?_isa} = %{version}-%{release} + + +%description -n python3-%{name} +Python 3 bindings for the createrepo_c library. +%endif + +%prep +%autosetup -p1 + +%build +# Build createrepo_c with Pyhon 3 +%cmake \ + %{!?with_zchunk:-DWITH_ZCHUNK=OFF} \ + %{!?with_libmodulemd:-DWITH_LIBMODULEMD=OFF} \ + -DENABLE_DRPM=%{?with_drpm:ON}%{!?with_drpm:OFF} \ + -DENABLE_PYTHON=%{?with_python3:ON}%{!?with_python3:OFF} +%cmake_build +# Build C documentation +%cmake_build --target doc-c + +%check +# Run Python 3 tests +%if %{with python3} +# Run Python 3 tests +%ctest +%endif + +%install +# Install createrepo_c with Python 3 +%cmake_install + +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 + +%files +%doc README.md +%license COPYING AUTHORS +%{_bindir}/createrepo_c +%{_bindir}/mergerepo_c +%{_bindir}/modifyrepo_c +%{_bindir}/sqliterepo_c +%{_libdir}/lib%{name}.so.* +%{bash_completions_dir}/* + +%{_bindir}/createrepo +%{_bindir}/mergerepo +%{_bindir}/modifyrepo + +%files devel +%{_libdir}/lib%{name}.so +%{_libdir}/pkgconfig/%{name}.pc +%{_includedir}/%{name}/ + +%files help +%doc %{__cmake_builddir}/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 +* Mon Mar 17 2025 Funda Wang <fundawang@yeah.net> - 1.2.1-1 +- update to 1.2.1 + +* Sun Mar 02 2025 Funda Wang <fundawang@yeah.net> - 1.1.4-4 +- try build with cmake 4.0 + +* Thu Nov 21 2024 Funda Wang <fundawang@yeah.net> - 1.1.4-3 +- adopt to new cmake macro + +* Fri Nov 08 2024 Funda Wang <fundawang@yeah.net> - 1.1.4-2 +- adopt to new cmake macro + +* Mon Aug 19 2024 yangxiaodong <yangxiaodong@kylinos.cn> - 1.1.4-1 +- Type:update +- CVE:NA +- SUG:NA +- DESC:update version to 1.1.4 + +* Mon Jul 15 2024 dillon chen <dillon.chen@gmail.com> - 1.1.3-1 +- update version to 1.1.3 + +* Thu Feb 1 2024 caixiaomeng <caixiaomeng2@huawei.com> - 1.0.1-1 +- update version to 1.0.1 + +* Thu Jan 19 2023 Lv Ying <lvying6@huawei.com> - 0.20.1-1 +- update version to 0.20.1 + +* Sat Oct 22 2022 yanglongkang <yanglongkang@h-partners.com> - 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 <yangzhuangzhuang1@Huawei.com> - 0.17.6-1 +- update version to 0.17.6 + +* Thu Jan 21 2021 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 0.16.2-1 +- update 0.16.2 + +* Sat Jul 25 2020 Liquor <lirui130@huawei.com> - 0.16.0-2 +- remove python2 + +* Sat Jul 25 2020 Liquor <lirui130@huawei.com> - 0.16.0-1 +- update 0.16.0 + +* Wed Apr 8 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.15.0-5 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:Add judgement of openEuler + +* Sat Mar 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.15.0-4 +- Add build requires of gdb + +* Mon Oct 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.15.0-3 +- Package rebuild. + +* Wed Oct 09 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.15.0-2 +- Add notice; Split and merge package with openeuler`s rules. + +* Sat Sep 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.15.0-1 +- Package init. @@ -0,0 +1 @@ +bf9dda4ff181c68b8bd6d063d5945edf createrepo_c-1.2.1.tar.gz |