# # Core packages for Chakra, part of chakra-project.org # # maintainer abveritas[at]chakra-project[dot]org> pkgname=openvpn pkgver=2.2.2 pkgrel=1 pkgdesc="An easy-to-use, robust, and highly configurable VPN (Virtual Private Network)" arch=('x86_64') url="http://openvpn.net/index.php/open-source.html" depends=('openssl' 'lzo2' 'iproute2') license=('custom') backup=(usr/share/openvpn/easy-rsa/vars usr/share/openvpn/easy-rsa/openssl.cnf etc/conf.d/openvpn-tapdev) source=("http://swupdate.openvpn.net/community/releases/openvpn-${pkgver}.tar.gz" 'openvpn@.service') md5sums=('c5181e27b7945fa6276d21873329c5c7' '44047df812a3fcd57a7e36a61732a9b9') build() { cd $srcdir/$pkgname-$pkgver # Build openvpn CFLAGS="$CFLAGS -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn\\\"" ./configure --prefix=/usr \ --enable-password-save \ --mandir=/usr/share/man \ --enable-iproute2 make # Build plugins for plug in auth-pam down-root; do cd $srcdir/$pkgname-$pkgver/plugin/$plug make done } package() { cd $srcdir/$pkgname-$pkgver # Install openvpn make DESTDIR=$pkgdir install install -d -m755 $pkgdir/etc/openvpn # Install examples install -d -m755 $pkgdir/usr/share/openvpn cp -r sample-config-files $pkgdir/usr/share/openvpn/examples find $pkgdir/usr/share/openvpn -type f -exec chmod 644 {} \; find $pkgdir/usr/share/openvpn -type d -exec chmod 755 {} \; # Install license install -D -m644 COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING # Install plugins for plug in auth-pam down-root; do cd $srcdir/$pkgname-$pkgver/plugin/$plug install -D -m755 openvpn-$plug.so $pkgdir/usr/lib/openvpn/openvpn-$plug.so done # Install easy-rsa cd $srcdir/$pkgname-$pkgver make -C easy-rsa/2.0 install DESTDIR=$pkgdir PREFIX=usr/share/openvpn/easy-rsa # install systemd units install -Dm644 "$srcdir/openvpn@.service" "$pkgdir/usr/lib/systemd/system/openvpn@.service" }