diff --git a/.packit.yaml b/.packit.yaml
index da251069d..eeb469e57 100644
--- a/.packit.yaml
+++ b/.packit.yaml
@@ -1,17 +1,37 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration/
-specfile_path: dnf5.spec
+packages:
+ dnf5:
+ specfile_path: dnf5.spec
-# add or remove files that should be synced
-files_to_sync:
- - dnf5.spec
- - .packit.yaml
+ # add or remove files that should be synced
+ files_to_sync:
+ - dnf5.spec
+ - .packit.yaml
-# name in upstream package repository or registry (e.g. in PyPI)
-upstream_package_name: dnf5
-# downstream (Fedora) RPM package name
-downstream_package_name: dnf5
+ # name in upstream package repository or registry (e.g. in PyPI)
+ upstream_package_name: dnf5
+ # downstream (Fedora) RPM package name
+ downstream_package_name: dnf5
+
+ # Test build with disabled modules.
+ # Use separate package configuration because Packit
+ # doesn't yet support dependencies between jobs so if we
+ # had multiple copr_builds it woudn't know which to use
+ # for tests jobs.
+ # https://github.com/packit/packit-service/issues/1720
+ dnf5-without-modules:
+ specfile_path: dnf5.spec
+
+ # add or remove files that should be synced
+ files_to_sync:
+ - dnf5.spec
+ - .packit.yaml
+
+ # name in upstream package repository or registry (e.g. in PyPI)
+ upstream_package_name: dnf5
+ downstream_package_name: dnf5
jobs:
- job: propose_downstream
@@ -19,14 +39,17 @@ jobs:
dist_git_branches:
- fedora-rawhide
copy_upstream_release_description: true
+ packages: [dnf5]
- job: koji_build
trigger: commit
dist_git_branches:
- fedora-all
+ packages: [dnf5]
- job: bodhi_update
trigger: commit
dist_git_branches:
- fedora-all
+ packages: [dnf5]
- job: copr_build
trigger: pull_request
targets:
@@ -35,6 +58,7 @@ jobs:
actions:
get-current-version:
- bash -c 'rpmspec -q --queryformat "%{VERSION}\n" dnf5.spec | head -n1'
+ packages: [dnf5]
- job: copr_build
trigger: pull_request
targets:
@@ -43,6 +67,7 @@ jobs:
actions:
get-current-version:
- bash -c 'rpmspec -q --queryformat "%{VERSION}\n" dnf5.spec | head -n1'
+ packages: [dnf5]
- job: tests
trigger: pull_request
identifier: "dnf5-tests"
@@ -51,6 +76,7 @@ jobs:
fmf_url: https://github.com/rpm-software-management/ci-dnf-stack.git
fmf_ref: main
tmt_plan: "^/plans/integration/behave-dnf5$"
+ packages: [dnf5]
- job: tests
trigger: pull_request
identifier: "createrepo_c-tests"
@@ -59,6 +85,7 @@ jobs:
fmf_url: https://github.com/rpm-software-management/ci-dnf-stack.git
fmf_ref: main
tmt_plan: "^/plans/integration/behave-createrepo_c$"
+ packages: [dnf5]
- job: tests
trigger: pull_request
identifier: "dnf-tests"
@@ -68,6 +95,7 @@ jobs:
fmf_url: https://github.com/rpm-software-management/ci-dnf-stack.git
fmf_ref: main
tmt_plan: "^/plans/integration/behave-dnf$"
+ packages: [dnf5]
- job: tests
trigger: pull_request
identifier: "dnf5daemon-tests"
@@ -76,3 +104,19 @@ jobs:
fmf_url: https://github.com/rpm-software-management/ci-dnf-stack.git
fmf_ref: main
tmt_plan: "^/plans/integration/behave-dnf5daemon$"
+ packages: [dnf5]
+ - job: copr_build
+ identifier: "WITH_MODULEMD=OFF"
+ trigger: pull_request
+ branch: 'main'
+ targets:
+ - fedora-rawhide-x86_64
+ actions:
+ fix-spec-file:
+ # disable modulemd in spec to verify the build is passing without it
+ - sed -i dnf5.spec -e "s/bcond_without modulemd/bcond_with modulemd/"
+ # fill in Release as if packit would have done it
+ - bash -c "sed -i -r \"s/Release:(\s*)\S+/Release:\1${PACKIT_RPMSPEC_RELEASE}%{?dist}/\" dnf5.spec"
+ get-current-version:
+ - bash -c 'rpmspec -q --queryformat "%{VERSION}\n" dnf5.spec | head -n1'
+ packages: [dnf5-without-modules]
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2267e3d65..b9d031f42 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
message("Running CMake on dnf5...")
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.6)
include(VERSION.cmake)
@@ -119,6 +119,10 @@ if(WITH_TRANSLATIONS)
add_custom_target(gettext-potfiles)
endif()
+# When modules are enabled add WITH_MODULEMD definition for all sub-directories (all components).
+if (WITH_MODULEMD)
+ add_definitions(-DWITH_MODULEMD)
+endif()
include_directories("${PROJECT_SOURCE_DIR}/include")
include_directories("${PROJECT_SOURCE_DIR}/common")
diff --git a/dnf5-plugins/automatic_plugin/automatic.cpp b/dnf5-plugins/automatic_plugin/automatic.cpp
index 751d1031d..3f4c4efac 100644
--- a/dnf5-plugins/automatic_plugin/automatic.cpp
+++ b/dnf5-plugins/automatic_plugin/automatic.cpp
@@ -28,6 +28,7 @@ along with libdnf. If not, see .
#include
#include
#include
+#include
#include
#include
#include
diff --git a/dnf5/CMakeLists.txt b/dnf5/CMakeLists.txt
index ca9d91302..a73706721 100644
--- a/dnf5/CMakeLists.txt
+++ b/dnf5/CMakeLists.txt
@@ -20,9 +20,15 @@ add_definitions(-DINSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
# set SYSCONFIG_DIR, used to find the directory containing the dnf5 configuration
add_definitions(-DSYSCONFIG_DIR=\"${CMAKE_INSTALL_FULL_SYSCONFDIR}\")
-# use any sources found under the current directory
+# use sources found under the current directory
file(GLOB_RECURSE DNF5_SOURCES *.cpp)
+# exclude module sources if WITH_MODULEMD not defined
+if (NOT WITH_MODULEMD)
+ file(GLOB_RECURSE DNF5_SOURCES_MODULES commands/module/*.cpp)
+ list(REMOVE_ITEM DNF5_SOURCES ${DNF5_SOURCES_MODULES})
+endif()
+
include_directories("${PROJECT_SOURCE_DIR}/dnf5/include/")
include_directories(.)
diff --git a/dnf5/main.cpp b/dnf5/main.cpp
index c8bdcf7dc..1dbc1a876 100644
--- a/dnf5/main.cpp
+++ b/dnf5/main.cpp
@@ -35,7 +35,9 @@ along with libdnf. If not, see .
#include "commands/list/list.hpp"
#include "commands/makecache/makecache.hpp"
#include "commands/mark/mark.hpp"
+#ifdef WITH_MODULEMD
#include "commands/module/module.hpp"
+#endif
#include "commands/offline/offline.hpp"
#include "commands/provides/provides.hpp"
#include "commands/reinstall/reinstall.hpp"
@@ -687,7 +689,9 @@ static void add_commands(Context & context) {
context.add_and_initialize_command(std::make_unique(context));
context.add_and_initialize_command(std::make_unique(context));
+#ifdef WITH_MODULEMD
context.add_and_initialize_command(std::make_unique(context));
+#endif
context.add_and_initialize_command(std::make_unique(context));
context.add_and_initialize_command(std::make_unique(context));
context.add_and_initialize_command(std::make_unique(context));
diff --git a/include/libdnf5-cli/CMakeLists.txt b/include/libdnf5-cli/CMakeLists.txt
index 45e310d89..c1dd6848e 100644
--- a/include/libdnf5-cli/CMakeLists.txt
+++ b/include/libdnf5-cli/CMakeLists.txt
@@ -5,6 +5,18 @@ endif()
file(GLOB_RECURSE LIBDNF5_CLI_HEADERS *.hpp)
+if (NOT WITH_MODULEMD)
+ file(GLOB_RECURSE LIBDNF5_CLI_HEADERS_MODULES
+ output/adapters/module.hpp
+ output/adapters/module_tmpl.hpp
+ output/interfaces/module.hpp
+ output/moduleinfo.hpp
+ output/modulelist.hpp)
+
+ list(REMOVE_ITEM LIBDNF5_CLI_HEADERS ${LIBDNF5_CLI_HEADERS_MODULES})
+endif()
+
+
# preserve relative paths of the header files
foreach(abspath ${LIBDNF5_CLI_HEADERS})
# relative path to the header file
diff --git a/include/libdnf5/CMakeLists.txt b/include/libdnf5/CMakeLists.txt
index 0299ba9d1..c153d6b0e 100644
--- a/include/libdnf5/CMakeLists.txt
+++ b/include/libdnf5/CMakeLists.txt
@@ -1,5 +1,15 @@
file(GLOB_RECURSE LIBDNF5_HEADERS *.hpp *.h)
+if (NOT WITH_MODULEMD)
+ file(GLOB_RECURSE LIBDNF5_HEADERS_MODULES module/*.hpp)
+
+ # module_sack_weak.hpp is needed for base.hpp API
+ # its not actually used and it doesn't include any other libdnf5 header
+ list(FILTER LIBDNF5_HEADERS_MODULES EXCLUDE REGEX .*module_sack_weak.hpp)
+
+ list(REMOVE_ITEM LIBDNF5_HEADERS ${LIBDNF5_HEADERS_MODULES})
+endif()
+
# preserve relative paths of the header files
foreach(abspath ${LIBDNF5_HEADERS})
# relative path to the header file
diff --git a/include/libdnf5/base/base.hpp b/include/libdnf5/base/base.hpp
index 435defd0c..257a7b480 100644
--- a/include/libdnf5/base/base.hpp
+++ b/include/libdnf5/base/base.hpp
@@ -28,22 +28,20 @@ along with libdnf. If not, see .
#include "libdnf5/conf/vars.hpp"
#include "libdnf5/defs.h"
#include "libdnf5/logger/log_router.hpp"
-#include "libdnf5/module/module_sack.hpp"
+#include "libdnf5/module/module_sack_weak.hpp"
#include "libdnf5/plugin/plugin_info.hpp"
#include "libdnf5/repo/download_callbacks.hpp"
#include "libdnf5/repo/repo_sack.hpp"
#include "libdnf5/rpm/package_sack.hpp"
#include "libdnf5/transaction/transaction_history.hpp"
-#include
-#include