blob: 5546f300b3d7a4f059fd4b61f93bb3a408868e0c [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 Geisslerbffdb3e2020-08-21 16:13:29 -050014SRCREV = "85134d13eb1ee5a1a7d139cd74ffa10933d73677"
Andrew Geisslerd221e032020-07-10 16:13:21 -050015PV = "0.99+git${SRCPV}"
Brad Bishope42b3e32020-01-15 22:08:42 -050016
17SRC_URI = " \
18 git://github.com/CanonicalLtd/netplan.git \
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050019 file://0001-dbus-Remove-unused-variabes.patch \
20 file://0002-Makefile-Use-first-prerquisite-only-for-target-rule.patch \
21 file://0001-src-parse.c-Initialize-key-to-NULL.patch \
Brad Bishope42b3e32020-01-15 22:08:42 -050022"
23
Andrew Geissler2ee498a2020-05-29 15:52:06 -050024DEPENDS = "glib-2.0 libyaml ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
25
Andrew Geisslerd221e032020-07-10 16:13:21 -050026RDEPENDS_${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 -050027
28inherit pkgconfig systemd
29
30TARGET_CC_ARCH += "${LDFLAGS}"
31
Andrew Geisslerd221e032020-07-10 16:13:21 -050032EXTRA_OEMAKE = "generate netplan/_features.py"
Brad Bishope42b3e32020-01-15 22:08:42 -050033EXTRA_OEMAKE =+ "${@bb.utils.contains('DISTRO_FEATURES','systemd','netplan-dbus dbus/io.netplan.Netplan.service','',d)}"
34
35do_install() {
Andrew Geisslerd221e032020-07-10 16:13:21 -050036 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 -050037 install -m 755 ${S}/generate ${D}${base_libdir}/netplan/
38 install -m 644 ${S}/netplan/*.py ${D}${datadir}/netplan/netplan
39 install -m 644 ${S}/netplan/cli/*.py ${D}${datadir}/netplan/netplan/cli
40 install -m 644 ${S}/netplan/cli/commands/*.py ${D}${datadir}/netplan/netplan/cli/commands
41 install -m 755 ${S}/src/netplan.script ${D}${datadir}/netplan/
42 ln -srf ${D}${datadir}/netplan/netplan.script ${D}${sbindir}/netplan
43
44 install -d ${D}/${systemd_unitdir}/system ${D}${systemd_unitdir}/system-generators
Brad Bishope42b3e32020-01-15 22:08:42 -050045 ln -srf ${D}/${base_libdir}/netplan/generate ${D}${systemd_unitdir}/system-generators
46
47 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
48 install -d ${D}${datadir}/dbus-1/system.d ${D}${datadir}/dbus-1/system-services
49 install -m 755 ${S}/netplan-dbus ${D}${base_libdir}/netplan
50 install -m 644 ${S}/dbus/io.netplan.Netplan.conf ${D}${datadir}/dbus-1/system.d
51 install -m 644 ${S}/dbus/io.netplan.Netplan.service ${D}${datadir}/dbus-1/system-services
52 fi
Andrew Geisslerd221e032020-07-10 16:13:21 -050053
54 install -m 755 ${S}/libnetplan.so.0.0 ${D}${libdir}
55 ln -rfs ${D}${libdir}/libnetplan.so.0.0 ${D}${libdir}/libnetplan.so
Brad Bishope42b3e32020-01-15 22:08:42 -050056}
57
Andrew Geisslerd221e032020-07-10 16:13:21 -050058PACKAGES += "${PN}-dbus libnetplan"
Brad Bishope42b3e32020-01-15 22:08:42 -050059
Andrew Geisslerd221e032020-07-10 16:13:21 -050060FILES_libnetplan = "${libdir}/libnetplan.so.0.0"
Brad Bishope42b3e32020-01-15 22:08:42 -050061FILES_${PN} = "${sbindir} ${base_libdir}/netplan/generate ${datadir}/netplan ${sysconfdir}/netplan ${systemd_unitdir}"
62FILES_${PN}-dbus = "${base_libdir}/netplan/netplan-dbus ${datadir}/dbus-1"