summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/dnf
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2016-12-30 19:01:40 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-14 14:42:16 +0000
commitb70f96a17fc13a74c04fd56e34cdc8f84dbf2f69 (patch)
tree4d9b30e8e63f39893d84b40e0f7f64e27c1adec6 /meta/recipes-devtools/dnf
parent374494e746e58d4efa308d0baf52a56ca5b72fb2 (diff)
downloadpoky-b70f96a17fc13a74c04fd56e34cdc8f84dbf2f69.tar.gz
dnf: add a recipe
This is replacing Smart package manager, which is unsupported upstream, and has a growing amount of issues (lack of python 3.x support in particular). We identified dnf as the only feasible replacement. (From OE-Core rev: 2da1f03ad5957fc130f9d4fac30f0048873e9d7c) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/dnf')
-rw-r--r--meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch21
-rw-r--r--meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch29
-rw-r--r--meta/recipes-devtools/dnf/dnf/0001-Do-not-prepend-installroot-to-logdir.patch31
-rw-r--r--meta/recipes-devtools/dnf/dnf/0028-Use-backports.lzma-not-lzma.patch30
-rw-r--r--meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch27
-rw-r--r--meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch48
-rw-r--r--meta/recipes-devtools/dnf/dnf_git.bb45
7 files changed, 231 insertions, 0 deletions
diff --git a/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch b/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch
new file mode 100644
index 0000000000..c9df458974
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch
@@ -0,0 +1,21 @@
1From 8ce181714640315d2dd37ee794acbb22063cd669 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 26 Jan 2017 16:36:20 +0200
4Subject: [PATCH] Corretly install tmpfiles.d configuration
5
6Upstream-Status: Inappropriate [oe-core specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 etc/tmpfiles.d/CMakeLists.txt | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/etc/tmpfiles.d/CMakeLists.txt b/etc/tmpfiles.d/CMakeLists.txt
13index f69c773e..3eb6d0e8 100644
14--- a/etc/tmpfiles.d/CMakeLists.txt
15+++ b/etc/tmpfiles.d/CMakeLists.txt
16@@ -1 +1 @@
17-INSTALL (FILES dnf.conf DESTINATION /usr/lib/tmpfiles.d/)
18+INSTALL (FILES dnf.conf DESTINATION ${SYSCONFDIR}/tmpfiles.d/)
19--
202.11.0
21
diff --git a/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch b/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch
new file mode 100644
index 0000000000..0f261e5c5d
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch
@@ -0,0 +1,29 @@
1From 4313ced1320594013795f11f6db00381e3f4cc45 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 26 Jan 2017 16:25:47 +0200
4Subject: [PATCH] Do not hardcode /etc and systemd unit directories
5
6Upstream-Status: Inappropriate [oe-core specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 CMakeLists.txt | 4 ++--
10 1 file changed, 2 insertions(+), 2 deletions(-)
11
12diff --git a/CMakeLists.txt b/CMakeLists.txt
13index 6a319935..db20ccd4 100644
14--- a/CMakeLists.txt
15+++ b/CMakeLists.txt
16@@ -7,8 +7,8 @@ if (NOT PYTHON_DESIRED)
17 set (PYTHON_DESIRED "2")
18 endif()
19
20-SET( SYSCONFDIR /etc)
21-SET( SYSTEMD_DIR /usr/lib/systemd/system)
22+SET( SYSCONFDIR ${CMAKE_INSTALL_SYSCONFDIR})
23+SET( SYSTEMD_DIR $ENV{systemd_system_unitdir})
24
25 if (${PYTHON_DESIRED} STREQUAL "2")
26 FIND_PACKAGE (PythonInterp REQUIRED)
27--
282.11.0
29
diff --git a/meta/recipes-devtools/dnf/dnf/0001-Do-not-prepend-installroot-to-logdir.patch b/meta/recipes-devtools/dnf/dnf/0001-Do-not-prepend-installroot-to-logdir.patch
new file mode 100644
index 0000000000..a90e77cbf1
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf/0001-Do-not-prepend-installroot-to-logdir.patch
@@ -0,0 +1,31 @@
1From 31653d324cf8c7b1f2f9e49d22676bd2ac546331 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Wed, 11 Jan 2017 15:10:13 +0200
4Subject: [PATCH] Do not prepend installroot to logdir.
5
6This would otherwise write the logs into rootfs/var/log
7(whereas we want them in $T),
8and will break installation of base-files rpm.
9
10Upstream-Status: Inappropriate [oe-core specific]
11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
12---
13 dnf/cli/cli.py | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
17index b764801a..893f4bda 100644
18--- a/dnf/cli/cli.py
19+++ b/dnf/cli/cli.py
20@@ -881,7 +881,7 @@ class Cli(object):
21 subst = conf.substitutions
22 subst.update_from_etc(conf.installroot)
23
24- for opt in ('cachedir', 'logdir', 'persistdir'):
25+ for opt in ('cachedir', 'persistdir'):
26 conf.prepend_installroot(opt)
27
28 self.base._logging._setup_from_dnf_conf(conf)
29--
302.11.0
31
diff --git a/meta/recipes-devtools/dnf/dnf/0028-Use-backports.lzma-not-lzma.patch b/meta/recipes-devtools/dnf/dnf/0028-Use-backports.lzma-not-lzma.patch
new file mode 100644
index 0000000000..57038a8c7d
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf/0028-Use-backports.lzma-not-lzma.patch
@@ -0,0 +1,30 @@
1From 89af5c84d4b920d22ae882fcc5ab71ba09443cea Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 30 Dec 2016 18:28:18 +0200
4Subject: [PATCH 28/30] Use backports.lzma, not lzma
5
6This is needed when using Python 2.x and should be dropped
7after moving to Python 3.x
8
9Upstream-Status: Inappropriate [oe-core specific]
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11---
12 dnf/yum/misc.py | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/dnf/yum/misc.py b/dnf/yum/misc.py
16index 441b0148..6b4aea0a 100644
17--- a/dnf/yum/misc.py
18+++ b/dnf/yum/misc.py
19@@ -37,7 +37,7 @@ import gpgme.editutil
20 import gzip
21 import hashlib
22 import io
23-import lzma
24+import backports.lzma
25 import os
26 import os.path
27 import pwd
28--
292.11.0
30
diff --git a/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
new file mode 100644
index 0000000000..8c59f9f670
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
@@ -0,0 +1,27 @@
1From 3ddaa930cda57a62a2174faebcc87aebc59591d1 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 30 Dec 2016 18:29:07 +0200
4Subject: [PATCH 29/30] Do not set PYTHON_INSTALL_DIR by running python
5
6Upstream-Status: Inappropriate [oe-core specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 CMakeLists.txt | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/CMakeLists.txt b/CMakeLists.txt
13index 6a319935..466ca1e6 100644
14--- a/CMakeLists.txt
15+++ b/CMakeLists.txt
16@@ -18,7 +18,7 @@ else()
17 FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
18 endif()
19
20-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
21+#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
22 EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write('%s.%s' % (sys.version_info.major, sys.version_info.minor))" OUTPUT_VARIABLE PYTHON_MAJOR_DOT_MINOR_VERSION)
23 MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}")
24
25--
262.11.0
27
diff --git a/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch b/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch
new file mode 100644
index 0000000000..7fc8afef53
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch
@@ -0,0 +1,48 @@
1From 9c8d545152b35d8943be72b9503414a53e1ebf7c Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 30 Dec 2016 18:29:37 +0200
4Subject: [PATCH 30/30] Run python scripts using env
5
6Otherwise the build tools hardcode the python path into them.
7
8Upstream-Status: Inappropriate [oe-core specific]
9Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
10---
11 bin/dnf-automatic.in | 2 +-
12 bin/dnf.in | 2 +-
13 bin/yum.in | 2 +-
14 3 files changed, 3 insertions(+), 3 deletions(-)
15
16diff --git a/bin/dnf-automatic.in b/bin/dnf-automatic.in
17index 5b06aa26..9f6f703e 100755
18--- a/bin/dnf-automatic.in
19+++ b/bin/dnf-automatic.in
20@@ -1,4 +1,4 @@
21-#!@PYTHON_EXECUTABLE@
22+#!/usr/bin/env python
23 # dnf-automatic executable.
24 #
25 # Copyright (C) 2014-2016 Red Hat, Inc.
26diff --git a/bin/dnf.in b/bin/dnf.in
27index 645d0f06..ab141abd 100755
28--- a/bin/dnf.in
29+++ b/bin/dnf.in
30@@ -1,4 +1,4 @@
31-#!@PYTHON_EXECUTABLE@
32+#!/usr/bin/env python
33 # The dnf executable script.
34 #
35 # Copyright (C) 2012-2016 Red Hat, Inc.
36diff --git a/bin/yum.in b/bin/yum.in
37index f1fee071..013dc8c5 100755
38--- a/bin/yum.in
39+++ b/bin/yum.in
40@@ -1,4 +1,4 @@
41-#!@PYTHON_EXECUTABLE@
42+#!/usr/bin/env python
43 # The dnf executable script.
44 #
45 # Copyright (C) 2016 Red Hat, Inc.
46--
472.11.0
48
diff --git a/meta/recipes-devtools/dnf/dnf_git.bb b/meta/recipes-devtools/dnf/dnf_git.bb
new file mode 100644
index 0000000000..ff22d6f5f0
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf_git.bb
@@ -0,0 +1,45 @@
1SUMMARY = "Package manager forked from Yum, using libsolv as a dependency resolver"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
4 file://PACKAGE-LICENSING;md5=bfc29916e11321be06924c4fb096fdcc \
5 "
6
7SRC_URI = "git://github.com/rpm-software-management/dnf.git \
8 file://0028-Use-backports.lzma-not-lzma.patch \
9 file://0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
10 file://0030-Run-python-scripts-using-env.patch \
11 file://0001-Do-not-prepend-installroot-to-logdir.patch \
12 file://0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch \
13 file://0001-Corretly-install-tmpfiles.d-configuration.patch \
14 "
15
16PV = "2.0.0+git${SRCPV}"
17SRCREV = "f0093d672d3069cfee8447973ae70ef615fd8886"
18
19S = "${WORKDIR}/git"
20
21inherit cmake gettext bash-completion distutils-base systemd
22
23DEPENDS += "libdnf librepo libcomps python-pygpgme python-iniparse"
24# python 2.x only, drop when moving to python 3.x
25DEPENDS += "python-backports-lzma"
26
27# manpages generation requires http://www.sphinx-doc.org/
28EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR}"
29
30BBCLASSEXTEND = "native nativesdk"
31
32RDEPENDS_${PN}_class-target += "python-core python-codecs python-netclient python-email python-threading python-distutils librepo python-shell python-subprocess libcomps libdnf python-sqlite3 python-compression python-pygpgme python-backports-lzma python-rpm python-iniparse python-json python-importlib python-curses python-argparse"
33
34# Direct dnf-native to read rpm configuration from our sysroot, not the one it was compiled in
35do_install_append_class-native() {
36 create_wrapper ${D}/${bindir}/dnf-2 \
37 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
38 RPM_NO_CHROOT_FOR_SCRIPTS=1
39}
40
41SYSTEMD_SERVICE_${PN} = "dnf-makecache.service dnf-makecache.timer \
42 dnf-automatic-download.service dnf-automatic-download.timer \
43 dnf-automatic-install.service dnf-automatic-install.timer \
44 dnf-automatic-notifyonly.service dnf-automatic-notifyonly.timer \
45"