# Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
# Contributor:  Conrad Hoffmann <ch@bitfehler.net>

pkgname=netplan
pkgver=0.102
pkgrel=1
pkgdesc="Network configuration abstraction renderer"
arch=('x86_64')
url="https://github.com/CanonicalLtd/netplan"
license=('GPL3')
depends=(
  'glib2'
  'python-yaml'
  'python-netifaces'
  'iproute2'
  'systemd'
)
makedepends=(
  'python'
  'pkgconf'
  'pandoc'
)
source=(
  "https://github.com/CanonicalLtd/${pkgname}/archive/${pkgver}.tar.gz"
)
sha256sums=('2fd9de110066c40f661cbec8273b4a883e7c0f077a4dd969a75bb56b4a42b597')

build() {
  cd "${pkgname}-${pkgver}"

  # Drop -Werror to avoid the following error:
  # /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'ip_str' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  sed -e "s/-Werror//g" -i Makefile

  env
  make
}

package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" ROOTPREFIX=/usr SBINDIR=/usr/bin install
}
