### this file is sourced not run
PKGVER=2.4.4
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=openvpn-$PKGVER.tar.xz
MD5SUM=7a2002aad1671b24457bc9432a0c5c52
SRC_URL=https://swupdate.openvpn.org/community/releases/$TARBALL
BUNDLE=

SLACKREQ='openssl iproute2' # liblzo2 build-time dependency
SLACKDESC="openvpn: openvpn $PKGVER (SSL VPN server and client)  
openvpn:  
openvpn: OpenVPN is a full-featured open source SSL VPN solution that 
openvpn: accommodates a wide range of configurations, including remote access, 
openvpn: site-to-site VPNs, Wi-Fi security, and enterprise-scale remote access 
openvpn: solutions with load balancing, failover, and fine-grained 
openvpn: access-controls. Starting with the fundamental premise that 
openvpn: complexity is the enemy of security, OpenVPN offers a cost-effective, 
openvpn: lightweight alternative to other VPN technologies that is 
openvpn: well-targeted for the SME and enterprise markets.  
openvpn:
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	CONFFLAGS="$CONFFLAGS --disable-static --enable-x509-alt-username \
	--enable-password-save  --disable-plugin-auth-pam --enable-iproute2 --with-crypto-library=openssl \
	ac_cv_path_IPROUTE=/sbin/ip"
	# ac_cv_path_ROUTE=/sbin/route ac_cv_path_IFCONFIG=/sbin/ifconfig " - if we don't use iproute2
	## route and ifconfig don't exist in build tree, so override with the correct future location
	
	pkg_build_autoconf &&
	pkg_build_slackdesc &&
	cp -a sample/* /usr/share/doc/openvpn &&
	rm /usr/share/doc/openvpn/Makefile* &&
	
	## initscripts
	install -d m755 /etc/init.d &&
	install -m 644 ../pkg/99-openvpn /etc/init.d
}
