# Maintainer: Jouke Witteveen <j.witteveen@gmail.com>

pkgname=netctl
pkgver=1.26
pkgrel=1
pkgdesc='Profile based systemd network management'
url='https://gitlab.archlinux.org/archlinux/netctl'
license=('GPL')
depends=('coreutils' 'iproute2' 'resolvconf' 'systemd>=233')
# The source tarball includes pre-built (using asciidoc) documentation.
makedepends=('pkg-config')
optdepends=('dialog: for the menu based wifi assistant'
            'dhclient: for DHCP support (or dhcpcd)'
            'dhcpcd: for DHCP support (or dhclient)'
            'wpa_supplicant: for wireless networking support'
            'ifplugd: for automatic wired connections through netctl-ifplugd'
            'ppp: for PPP connections'
            'openvswitch: for Open vSwitch connections'
            'wireguard-tools: for WireGuard connections'
           )
install=netctl.install
source=(https://sources.archlinux.org/other/packages/netctl/netctl-${pkgver}.tar.xz{,.sig})
arch=('any')
md5sums=('16a586ae8f175fd7879b3be940f12161'
         'dac86ccc823ed89bef97da92867bc5a0')
validpgpkeys=('CFA6AF15E5C74149FC1D8C086D1655C14CE1C13E')  # Florian Pritz

package() {
  cd "$srcdir/netctl-${pkgver}"
  make DESTDIR="$pkgdir" install

  # Shell Completion
  install -D -m644 contrib/bash-completion "$pkgdir/usr/share/bash-completion/completions/netctl"
  ln -s netctl "$pkgdir/usr/share/bash-completion/completions/netctl-auto"
  ln -s netctl "$pkgdir/usr/share/bash-completion/completions/wifi-menu"
  install -D -m644 contrib/zsh-completion "$pkgdir/usr/share/zsh/site-functions/_netctl"
}

