From 0019f4149571e474589fcff400f991fb51d32ecf Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Sep 14 2019 16:27:44 +0000 Subject: [PATCH 1/3] Add WITH_ZCHUNK flag so LRO_SUPPORTS_CACHEDIR is set in librepo Signed-off-by: Jonathan Dieter --- diff --git a/libdnf-0.35-fix-zchunk.patch b/libdnf-0.35-fix-zchunk.patch new file mode 100644 index 0000000..bfc904d --- /dev/null +++ b/libdnf-0.35-fix-zchunk.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 16b63308..c69026d1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -30,6 +30,7 @@ option(WITH_BINDINGS "Enables python/SWIG bindings" ON) + option(WITH_GTKDOC "Enables libdnf GTK-Doc HTML documentation" ON) + option(WITH_HTML "Enables hawkey HTML generation" ON) + option(WITH_MAN "Enables hawkey man page generation" ON) ++option(WITH_ZCHUNK "Build with zchunk support" ON) + option(ENABLE_RHSM_SUPPORT "Build with Red Hat Subscription Manager support?" OFF) + option(ENABLE_SOLV_URPMREORDER "Build with support for URPM-like solution reordering?" OFF) + +@@ -66,6 +67,12 @@ pkg_check_modules(SQLite3 REQUIRED sqlite3) + # always enable linking with libdnf utils + include_directories(${CMAKE_SOURCE_DIR} libdnf/utils/) + ++if (WITH_ZCHUNK) ++ pkg_check_modules(ZCHUNKLIB zck>=0.9.11 REQUIRED) ++ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_ZCHUNK") ++ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DWITH_ZCHUNK") ++endif () ++ + if(ENABLE_RHSM_SUPPORT) + pkg_check_modules(RHSM REQUIRED librhsm>=0.0.3) + include_directories(${RHSM_INCLUDE_DIRS}) diff --git a/libdnf.spec b/libdnf.spec index 215803b..4328cc4 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -32,13 +32,19 @@ %bcond_with rhsm %endif +%if 0%{?rhel} +%bcond_with zchunk +%else +%bcond_without zchunk +%endif + %global _cmake_opts \\\ -DENABLE_RHSM_SUPPORT=%{?with_rhsm:ON}%{!?with_rhsm:OFF} \\\ %{nil} Name: libdnf Version: 0.35.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library providing simplified C and Python API to libsolv License: LGPLv2+ URL: https://github.com/rpm-software-management/libdnf @@ -54,7 +60,9 @@ Patch0003: 0003-Revert-consequences-of-Fail-Safe-mechanism.patch Patch0004: 0004-hy_detect_arch-detect-crypto-only-on-arm-version--8.patch Patch0005: 0004-Mark-job-goalupgrade-with-sltr-as-targeted.patch Patch0006: 0005-Apply-targeted-upgrade-only-for-selector-with-packages.patch - +# Temporary until patch is upstreamed +# https://bugzilla.redhat.com/show_bug.cgi?id=1739867 +Patch0007: libdnf-0.35-fix-zchunk.patch BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ @@ -70,6 +78,9 @@ BuildRequires: rpm-devel >= %{rpm_version} %if %{with rhsm} BuildRequires: pkgconfig(librhsm) >= 0.0.3 %endif +%if %{with zchunk} +BuildRequires: zchunk-devel >= 0.9.11 +%endif BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(json-c) BuildRequires: pkgconfig(cppunit) @@ -186,14 +197,14 @@ mkdir build-py3 %build %if %{with python2} pushd build-py2 - %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} + %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{?with_zchunk:-DWITH_ZCHUNK=ON} %{_cmake_opts} %make_build popd %endif # with python2 %if %{with python3} pushd build-py3 - %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} + %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{?with_zchunk:-DWITH_ZCHUNK=ON} %{_cmake_opts} %make_build popd %endif @@ -276,6 +287,9 @@ popd %endif %changelog +* Sat Sep 14 2019 Jonathan Dieter - 0.35.2-4 +- Rebuild for zchunk enabled librepo + * Wed Sep 11 2019 Jaroslav Mracek - 0.35.2-3 - Backport patch to fix reinstalling packages with a different buildtime - part II From f5fc72d44c0ba137962930272be5a5eb826ee843 Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Sep 14 2019 16:27:44 +0000 Subject: [PATCH 2/3] Default for WITH_ZCHUNK is ON Signed-off-by: Jonathan Dieter --- diff --git a/libdnf.spec b/libdnf.spec index 4328cc4..d601e0c 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -197,14 +197,14 @@ mkdir build-py3 %build %if %{with python2} pushd build-py2 - %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{?with_zchunk:-DWITH_ZCHUNK=ON} %{_cmake_opts} + %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{_cmake_opts} %make_build popd %endif # with python2 %if %{with python3} pushd build-py3 - %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{?with_zchunk:-DWITH_ZCHUNK=ON} %{_cmake_opts} + %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{_cmake_opts} %make_build popd %endif From 4179b5a36418769f87319d1da16fe1b3d69d1b24 Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Sep 14 2019 20:41:24 +0000 Subject: [PATCH 3/3] Update to final patch as was merged into libdnf Signed-off-by: Jonathan Dieter --- diff --git a/libdnf-0.35-fix-zchunk.patch b/libdnf-0.35-fix-zchunk.patch index bfc904d..f98acc4 100644 --- a/libdnf-0.35-fix-zchunk.patch +++ b/libdnf-0.35-fix-zchunk.patch @@ -23,3 +23,47 @@ index 16b63308..c69026d1 100644 if(ENABLE_RHSM_SUPPORT) pkg_check_modules(RHSM REQUIRED librhsm>=0.0.3) include_directories(${RHSM_INCLUDE_DIRS}) +diff --git a/libdnf.spec b/libdnf.spec +index 60091ccf..2e1f958c 100644 +--- a/libdnf.spec ++++ b/libdnf.spec +@@ -32,6 +32,12 @@ + %bcond_with rhsm + %endif + ++%if 0%{?rhel} ++%bcond_with zchunk ++%else ++%bcond_without zchunk ++%endif ++ + %global _cmake_opts \\\ + -DENABLE_RHSM_SUPPORT=%{?with_rhsm:ON}%{!?with_rhsm:OFF} \\\ + %{nil} +@@ -59,6 +65,9 @@ BuildRequires: rpm-devel >= %{rpm_version} + %if %{with rhsm} + BuildRequires: pkgconfig(librhsm) >= 0.0.3 + %endif ++%if %{with zchunk} ++BuildRequires: pkgconfig(zck) >= 0.9.11 ++%endif + BuildRequires: pkgconfig(sqlite3) + BuildRequires: pkgconfig(json-c) + BuildRequires: pkgconfig(cppunit) +@@ -175,14 +184,14 @@ mkdir build-py3 + %build + %if %{with python2} + pushd build-py2 +- %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} ++ %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} + %make_build + popd + %endif # with python2 + + %if %{with python3} + pushd build-py3 +- %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} ++ %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} + %make_build + popd + %endif diff --git a/libdnf.spec b/libdnf.spec index d601e0c..2f498e6 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -63,6 +63,7 @@ Patch0006: 0005-Apply-targeted-upgrade-only-for-selector-with-packages.patc # Temporary until patch is upstreamed # https://bugzilla.redhat.com/show_bug.cgi?id=1739867 Patch0007: libdnf-0.35-fix-zchunk.patch + BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ @@ -79,7 +80,7 @@ BuildRequires: rpm-devel >= %{rpm_version} BuildRequires: pkgconfig(librhsm) >= 0.0.3 %endif %if %{with zchunk} -BuildRequires: zchunk-devel >= 0.9.11 +BuildRequires: pkgconfig(zck) >= 0.9.11 %endif BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(json-c)