core/openvpn/PKGBUILD
2014-12-03 04:44:40 +00:00

65 lines
2.1 KiB
Bash

#
# Core packages for Chakra, part of chakra-project.org
#
# maintainer <inkane@chakra-project.org>
# contributor <abveritas[at]chakra-project[dot]org>
pkgname=openvpn
pkgver=2.3.6
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' 'systemd')
makedepends=('systemd')
license=('custom')
backup=(usr/share/openvpn/easy-rsa/vars)
source=(http://swupdate.openvpn.net/community/releases/openvpn-${pkgver}.tar.gz{,.asc}
http://build.openvpn.net/downloads/releases/easy-rsa-2.2.0_master.tar.gz{,.asc}
'openvpn@.service')
sha256sums=('7baed2ff39c12e1a1a289ec0b46fcc49ff094ca58b8d8d5f29b36ac649ee5b26'
'SKIP'
'd23ddc3a764b40d03ada76f387c92ae4dcf4f5266da54c2bae130325b05eebe2'
'SKIP'
'4696aefe672b4a2e3e201d3c2c0211b08e87a3a1a039788013846629a79ec6fd')
build() {
cd "${srcdir}"/$pkgname-$pkgver
CFLAGS="$CFLAGS -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn\\\"" ./configure \
--prefix=/usr \
--enable-password-save \
--mandir=/usr/share/man \
--enable-iproute2 \
--enable-systemd
make
# Build easy-rsa
cd $srcdir/easy-rsa-2.2.0_master
./configure --prefix=/usr --with-easyrsadir=/usr/share/openvpn/easy-rsa
make
}
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/sample-config-files "${pkgdir}"/usr/share/openvpn/examples
# Install license
install -d -m755 "${pkgdir}"/usr/share/licenses/${pkgname}/
ln -sf /usr/share/doc/${pkgname}/{COPYING,COPYRIGHT.GPL} "${pkgdir}"/usr/share/licenses/${pkgname}/
# Install contrib
install -d -m755 "${pkgdir}"/usr/share/openvpn/contrib
cp -r contrib "${pkgdir}"/usr/share/openvpn
# Install systemd service
install -D -m644 "${srcdir}"/openvpn@.service "${pkgdir}"/usr/lib/systemd/system/openvpn@.service
# Install easy-rsa
cd $srcdir/easy-rsa-2.2.0_master
make install DESTDIR=$pkgdir
rm -f ${pkgdir}/usr/share/ope
}