blob: e3aed642ac5abcef41cfdef45e34e7f20a594fc6 [file] [log] [blame]
#
# Copyright 2020 Google LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
EAPI=7
inherit cros-debug toolchain-funcs
DESCRIPTION="Backend-agnostic network configuration in YAML"
HOMEPAGE="https://netplan.io/"
SRC_URI="https://github.com/CanonicalLtd/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="*"
IUSE="systemd"
REQUIRED_USE="systemd"
DEPEND=">=dev-libs/glib-2.58.3-r5
>=dev-libs/libyaml-0.2.2
"
RDEPEND=">=dev-python/netifaces-0.10.9
>=dev-libs/libyaml-0.2.2
>=dev-python/pyyaml-3.13[libyaml(+)]"
src_prepare() {
sed -i -e "s:\$(DOCDIR)/netplan:\$(DOCDIR)/${PF}:" Makefile || die
# baselayout-1 compat
if has_version ">=sys-apps/baselayout-2.0.0"; then
sed -i -e 's:sbin/wpa_supplicant:usr/sbin/wpa_supplicant:' src/networkd.c || die
fi
eapply_user
}
src_compile() {
emake clean
emake DESTDIR="${D}" LIBDIR="\${PREFIX}/$(get_libdir)" CC="$(tc-getCC)"
}
src_install() {
if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]] ; then
emake DESTDIR="${D}" LIBDIR="\${PREFIX}/$(get_libdir)" CC="$(tc-getCC)" install
fi
einstalldocs
}