Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | SUMMARY = "The network configuration abstraction renderer" |
| 2 | DESCRIPTION = "Netplan is a utility for easily configuring networking on a \ |
| 3 | linux system. You simply create a YAML description of the required network \ |
| 4 | interfaces and what each should be configured to do. From this description \ |
| 5 | Netplan will generate all the necessary configuration for your chosen renderer \ |
| 6 | tool." |
| 7 | HOMEPAGE = "https://netplan.io" |
| 8 | SECTION = "net/misc" |
| 9 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 10 | LICENSE = "GPL-3.0-only" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 11 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" |
| 12 | |
| 13 | S = "${WORKDIR}/git" |
| 14 | SRCREV = "3e522b7255310bdecca6c781137741dfc4abc021" |
| 15 | PV = "0.104" |
| 16 | |
| 17 | SRC_URI = "git://github.com/CanonicalLtd/netplan.git;branch=main;protocol=https \ |
| 18 | file://0001-Makefile-do-not-use-Werror.patch \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 19 | file://0001-Makefile-fix-parallel-build-failure.patch \ |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 20 | " |
| 21 | |
| 22 | SRC_URI:append:libc-musl = " file://0001-don-t-fail-if-GLOB_BRACE-is-not-defined.patch" |
| 23 | |
| 24 | DEPENDS = "glib-2.0 libyaml ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" |
| 25 | |
| 26 | PACKAGECONFIG ?= "" |
| 27 | |
| 28 | PACKAGECONFIG[tests] = ",,,python3-nose python3-coverage python3-netifaces python3-pycodestyle python3-pyflakes python3-pyyaml" |
| 29 | |
| 30 | RDEPENDS:${PN} = "python3 python3-core python3-netifaces python3-pyyaml util-linux-libuuid libnetplan" |
| 31 | |
| 32 | inherit pkgconfig systemd |
| 33 | |
| 34 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 35 | |
| 36 | EXTRA_OEMAKE = "generate netplan/_features.py" |
| 37 | EXTRA_OEMAKE =+ "${@bb.utils.contains('DISTRO_FEATURES','systemd','netplan-dbus dbus/io.netplan.Netplan.service','',d)}" |
| 38 | |
| 39 | do_install() { |
| 40 | install -d ${D}${sbindir} ${D}${libdir} ${D}${base_libdir}/netplan ${D}${datadir}/netplan/netplan/cli/commands ${D}${sysconfdir}/netplan |
| 41 | install -m 755 ${S}/generate ${D}${base_libdir}/netplan/ |
| 42 | install -m 644 ${S}/netplan/*.py ${D}${datadir}/netplan/netplan |
| 43 | install -m 644 ${S}/netplan/cli/*.py ${D}${datadir}/netplan/netplan/cli |
| 44 | install -m 644 ${S}/netplan/cli/commands/*.py ${D}${datadir}/netplan/netplan/cli/commands |
| 45 | install -m 755 ${S}/src/netplan.script ${D}${datadir}/netplan/ |
| 46 | ln -srf ${D}${datadir}/netplan/netplan.script ${D}${sbindir}/netplan |
| 47 | sed -i -e "s#/lib/netplan/generate#${base_libdir}/netplan/generate#" ${D}${datadir}/netplan/netplan/cli/utils.py |
| 48 | |
| 49 | install -d ${D}/${systemd_unitdir}/system ${D}${systemd_unitdir}/system-generators |
| 50 | ln -srf ${D}/${base_libdir}/netplan/generate ${D}${systemd_unitdir}/system-generators |
| 51 | |
| 52 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 53 | install -d ${D}${datadir}/dbus-1/system.d ${D}${datadir}/dbus-1/system-services |
| 54 | install -m 755 ${S}/netplan-dbus ${D}${base_libdir}/netplan |
| 55 | install -m 644 ${S}/dbus/io.netplan.Netplan.conf ${D}${datadir}/dbus-1/system.d |
| 56 | install -m 644 ${S}/dbus/io.netplan.Netplan.service ${D}${datadir}/dbus-1/system-services |
| 57 | sed -i -e "s#^Exec=/lib/#Exec=${base_libdir}/#" ${D}${datadir}/dbus-1/system-services/io.netplan.Netplan.service |
| 58 | fi |
| 59 | |
| 60 | install -m 755 ${S}/libnetplan.so.0.0 ${D}${libdir} |
| 61 | ln -rfs ${D}${libdir}/libnetplan.so.0.0 ${D}${libdir}/libnetplan.so |
| 62 | } |
| 63 | |
| 64 | PACKAGES += "${PN}-dbus libnetplan" |
| 65 | |
| 66 | FILES:libnetplan = "${libdir}/libnetplan.so.0.0" |
| 67 | FILES:${PN} = "${sbindir} ${base_libdir}/netplan/generate ${datadir}/netplan ${sysconfdir}/netplan ${systemd_unitdir}" |
| 68 | FILES:${PN}-dbus = "${base_libdir}/netplan/netplan-dbus ${datadir}/dbus-1" |