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 0000000000000000000000000000000000000000..28a7d5ac1d0da41d962a04e3017d6ab692316e75 --- /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 2.8.12...${CMAKE_VERSION}) + 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 index 1c89ab479aac18d3747d2d69710545546b2e125a..e7906838a7e99d6034df443881fdcb6715d1d696 100644 --- a/createrepo_c.spec +++ b/createrepo_c.spec @@ -33,10 +33,11 @@ Summary: Creates a common metadata repository Name: createrepo_c Version: 1.1.4 -Release: 3 +Release: 4 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 BuildRequires: gcc @@ -51,7 +52,6 @@ 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 @@ -101,7 +101,7 @@ Summary: Python 3 bindings for the createrepo_c library %{?python_provide:%python_provide python3-%{name}} BuildRequires: python3-devel BuildRequires: python3-sphinx -Requires: createrepo_c +Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description -n python3-%{name} @@ -113,7 +113,7 @@ Python 3 bindings for the createrepo_c library. %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} +%cmake %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_libmodulemd:-DWITH_LIBMODULEMD=OFF} -DENABLE_DRPM=%{with_drpm:ON}%{!?with_drpm:OFF} %cmake_build # Build C documentation %cmake_build --target doc-c @@ -170,6 +170,9 @@ ln -sr %{buildroot}%{_bindir}/modifyrepo_c %{buildroot}%{_bindir}/modifyrepo %endif %changelog +* Sun Mar 02 2025 Funda Wang - 1.1.4-4 +- try build with cmake 4.0 + * Thu Nov 21 2024 Funda Wang - 1.1.4-3 - adopt to new cmake macro