blob: 682a6b611d3a4c5337c4c5d2e50edb663797f3fb [file] [log] [blame]
Brad Bishope42b3e32020-01-15 22:08:42 -05001SUMMARY = "The network configuration abstraction renderer"
2DESCRIPTION = "Netplan is a utility for easily configuring networking on a \
3linux system. You simply create a YAML description of the required network \
4interfaces and what each should be configured to do. From this description \
5Netplan will generate all the necessary configuration for your chosen renderer \
6tool."
7HOMEPAGE = "https://netplan.io"
8SECTION = "net/misc"
9
10LICENSE = "GPLv3"
11LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
12
13S = "${WORKDIR}/git"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050014SRCREV = "51c872d856db80281ea810ebc02e05c09d5310fa"
15PV = "0.103"
Brad Bishope42b3e32020-01-15 22:08:42 -050016
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050017SRC_URI = "git://github.com/CanonicalLtd/netplan.git;branch=main \
18 file://0001-parse-nm-fix-32bit-format-string.patch"
19
Patrick Williams213cb262021-08-07 19:21:33 -050020SRC_URI:append:libc-musl = " file://0001-don-t-fail-if-GLOB_BRACE-is-not-defined.patch"
Brad Bishope42b3e32020-01-15 22:08:42 -050021
Andrew Geissler2ee498a2020-05-29 15:52:06 -050022DEPENDS = "glib-2.0 libyaml ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
23
Patrick Williams213cb262021-08-07 19:21:33 -050024RDEPENDS:${PN} = "python3 python3-core python3-pyyaml python3-netifaces python3-nose python3-coverage python3-pycodestyle python3-pyflakes util-linux-libuuid libnetplan"
Brad Bishope42b3e32020-01-15 22:08:42 -050025
26inherit pkgconfig systemd
27
28TARGET_CC_ARCH += "${LDFLAGS}"
29
Andrew Geisslerd221e032020-07-10 16:13:21 -050030EXTRA_OEMAKE = "generate netplan/_features.py"
Brad Bishope42b3e32020-01-15 22:08:42 -050031EXTRA_OEMAKE =+ "${@bb.utils.contains('DISTRO_FEATURES','systemd','netplan-dbus dbus/io.netplan.Netplan.service','',d)}"
32
33do_install() {
Andrew Geisslerd221e032020-07-10 16:13:21 -050034 install -d ${D}${sbindir} ${D}${libdir} ${D}${base_libdir}/netplan ${D}${datadir}/netplan/netplan/cli/commands ${D}${sysconfdir}/netplan
Brad Bishope42b3e32020-01-15 22:08:42 -050035 install -m 755 ${S}/generate ${D}${base_libdir}/netplan/
36 install -m 644 ${S}/netplan/*.py ${D}${datadir}/netplan/netplan
37 install -m 644 ${S}/netplan/cli/*.py ${D}${datadir}/netplan/netplan/cli
38 install -m 644 ${S}/netplan/cli/commands/*.py ${D}${datadir}/netplan/netplan/cli/commands
39 install -m 755 ${S}/src/netplan.script ${D}${datadir}/netplan/
40 ln -srf ${D}${datadir}/netplan/netplan.script ${D}${sbindir}/netplan
41
42 install -d ${D}/${systemd_unitdir}/system ${D}${systemd_unitdir}/system-generators
Brad Bishope42b3e32020-01-15 22:08:42 -050043 ln -srf ${D}/${base_libdir}/netplan/generate ${D}${systemd_unitdir}/system-generators
44
45 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
46 install -d ${D}${datadir}/dbus-1/system.d ${D}${datadir}/dbus-1/system-services
47 install -m 755 ${S}/netplan-dbus ${D}${base_libdir}/netplan
48 install -m 644 ${S}/dbus/io.netplan.Netplan.conf ${D}${datadir}/dbus-1/system.d
49 install -m 644 ${S}/dbus/io.netplan.Netplan.service ${D}${datadir}/dbus-1/system-services
50 fi
Andrew Geisslerd221e032020-07-10 16:13:21 -050051
52 install -m 755 ${S}/libnetplan.so.0.0 ${D}${libdir}
53 ln -rfs ${D}${libdir}/libnetplan.so.0.0 ${D}${libdir}/libnetplan.so
Brad Bishope42b3e32020-01-15 22:08:42 -050054}
55
Andrew Geisslerd221e032020-07-10 16:13:21 -050056PACKAGES += "${PN}-dbus libnetplan"
Brad Bishope42b3e32020-01-15 22:08:42 -050057
Patrick Williams213cb262021-08-07 19:21:33 -050058FILES:libnetplan = "${libdir}/libnetplan.so.0.0"
59FILES:${PN} = "${sbindir} ${base_libdir}/netplan/generate ${datadir}/netplan ${sysconfdir}/netplan ${systemd_unitdir}"
60FILES:${PN}-dbus = "${base_libdir}/netplan/netplan-dbus ${datadir}/dbus-1"