1SUMMARY = "Package manager forked from Yum, using libsolv as a dependency resolver"
2DESCRIPTION = "Software package manager that installs, updates, and removes \
3packages on RPM-based Linux distributions. It automatically computes \
4dependencies and determines the actions required to install packages."
5HOMEPAGE = "https://github.com/rpm-software-management/dnf"
6LICENSE = "GPL-2.0-only"
7LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
8                    file://PACKAGE-LICENSING;md5=4a0548e303dbc77f067335b4d688e745 \
9                    "
10
11SRC_URI = "git://github.com/rpm-software-management/dnf.git;branch=master;protocol=https \
12           file://0001-Corretly-install-tmpfiles.d-configuration.patch \
13           file://0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch \
14           file://0005-Do-not-prepend-installroot-to-logdir.patch \
15           file://0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
16           file://0030-Run-python-scripts-using-env.patch \
17           file://0001-set-python-path-for-completion_helper.patch \
18           file://0001-lock.py-fix-Exception-handling.patch \
19           "
20
21SRC_URI:append:class-native = "file://0001-dnf-write-the-log-lock-to-root.patch"
22
23SRCREV = "9b2b2e8ddab99caba4bc8059cab4263163172e81"
24UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
25
26S = "${WORKDIR}/git"
27
28inherit cmake gettext bash-completion setuptools3-base systemd
29
30DEPENDS += "libdnf librepo libcomps python3-iniparse"
31
32# manpages generation requires http://www.sphinx-doc.org/
33EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
34
35BBCLASSEXTEND = "native nativesdk"
36
37RDEPENDS:${PN} += " \
38  python3-core \
39  python3-codecs \
40  python3-netclient \
41  python3-email \
42  python3-threading \
43  python3-logging \
44  python3-fcntl \
45  librepo \
46  python3-shell \
47  libcomps \
48  libdnf \
49  python3-sqlite3 \
50  python3-compression \
51  python3-rpm \
52  python3-iniparse \
53  python3-json \
54  python3-curses \
55  python3-misc \
56  "
57
58RDEPENDS:${PN}:class-native = ""
59
60RRECOMMENDS:${PN}:class-target += "gnupg"
61
62# Create a symlink called 'dnf' as 'make install' does not do it, but
63# .spec file in dnf source tree does (and then Fedora and dnf documentation
64# says that dnf binary is plain 'dnf').
65do_install:append() {
66        ln -rs ${D}/${bindir}/dnf-3 ${D}/${bindir}/dnf
67        ln -rs ${D}/${bindir}/dnf-automatic-3 ${D}/${bindir}/dnf-automatic
68}
69
70# Direct dnf-native to read rpm configuration from our sysroot, not the one it was compiled in
71do_install:append:class-native() {
72        create_wrapper ${D}/${bindir}/dnf \
73                RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
74                RPM_NO_CHROOT_FOR_SCRIPTS=1
75}
76
77do_install:append:class-nativesdk() {
78        create_wrapper ${D}/${bindir}/dnf \
79                RPM_CONFIGDIR=${SDKPATHNATIVE}${libdir_nativesdk}/rpm \
80                RPM_NO_CHROOT_FOR_SCRIPTS=1
81}
82
83SYSTEMD_SERVICE:${PN} = "dnf-makecache.service dnf-makecache.timer \
84                         dnf-automatic.service dnf-automatic.timer \
85                         dnf-automatic-download.service dnf-automatic-download.timer \
86                         dnf-automatic-install.service dnf-automatic-install.timer \
87                         dnf-automatic-notifyonly.service dnf-automatic-notifyonly.timer \
88"
89SYSTEMD_AUTO_ENABLE ?= "disable"
90
91SKIP_RECIPE[dnf] ?= "${@bb.utils.contains('PACKAGE_CLASSES', 'package_rpm', '', 'does not build without package_rpm in PACKAGE_CLASSES due disabled rpm support in libsolv', d)}"
92
93# Packages for testing purposes
94PACKAGES += "${PN}-test-main ${PN}-test-dep"
95ALLOW_EMPTY:${PN}-test-main = "1"
96ALLOW_EMPTY:${PN}-test-dep = "1"
97RRECOMMENDS:${PN}-test-main = "${PN}-test-dep"
98