makedepends=(systemd lz4 python-docutils libcap-ng pam)

description="VPN client"
url="http://www.openvpn.net"

packager="Great-OS Team"
maintainer="Great-OS Team"

name=openvpn
version=2.7.0
release=1

PKGMK_KEEP_SOURCES="no"
source=(https://github.com/OpenVPN/openvpn/archive/v${version}.tar.gz)

build(){
  cd $name-$version

  # https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19302.html
  sed -i '/^CONFIGURE_DEFINES=/s/set/env/g' configure.ac

  autoreconf -fiv
  
  ./configure --prefix=/usr \
              --libdir=/usr/lib \
              --enable-iproute2 \
              --enable-plugins \
              --enable-systemd \
              --enable-x509-alt-username

  make

  touch doc/openvpn.8

  make DESTDIR=$PKG install

  find $PKG/usr/share -name openvpn.8 -print -delete
}
