updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / openvpn-dev / PKGBUILD
blobe017d9ebee8a0253b3856b4df19bab580426842e
1 # Contributor: Thomas Bächler <thomas@archlinux.org>
2 # Maintainer: Clément DEMOULINS <clement@archivel.fr>
4 pkgname=openvpn-dev
5 _pkgname=openvpn
6 pkgver=2.2.2
7 _pkgver=${pkgver/_/-}
8 pkgrel=1
9 pkgdesc="An easy-to-use, robust, and highly configurable VPN (Virtual Private Network)"
10 arch=('i686' 'x86_64')
11 url="http://openvpn.net/"
12 license=('custom')
13 depends=('openssl' 'lzo2')
14 provides=('openvpn')
15 conflicts=('openvpn')
16 optdepends=('openresolv: scripts can use this tool to manage resolv.conf')
18 backup=('etc/conf.d/openvpn')
19 source=(http://swupdate.openvpn.net/community/releases/${_pkgname}-${_pkgver}.tar.xz
20         openvpn.rc openvpn.conf)
22 md5sums=('9943510739f417c6a309369d31fc1a9d'
23          'c9f7a8c0be2448877275d5115543afb3'
24          'b0938f65016c904dab336f019f81e126')
26 build() {
27     cd $srcdir/${_pkgname}-${_pkgver}
29     # Build and install openvpn
30     CFLAGS="$CFLAGS -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn\\\"" ./configure --prefix=/usr --enable-password-save --mandir=/usr/share/man
31     make
32     make DESTDIR=$pkgdir install
33     install -d -m755 $pkgdir/etc/openvpn
35     # Install examples (config-files and scripts)
36     install -d -m755 $pkgdir/usr/share/openvpn/examples
37     cp -r sample-config-files $pkgdir/usr/share/openvpn/examples/config-files
38     cp -r sample-scripts $pkgdir/usr/share/openvpn/examples/scripts
39     cp -r contrib $pkgdir/usr/share/openvpn/examples/scripts
40     find $pkgdir/usr/share/openvpn -type f -exec chmod 644 {} \;
41     find $pkgdir/usr/share/openvpn -type d -exec chmod 755 {} \;
43     # Install license
44     install -D -m644 COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
46     # Build and install plugins
47     for plug in auth-pam down-root; do
48         cd $srcdir/${_pkgname}-${_pkgver}/plugin/$plug
49         make 
50         install -D -m755 openvpn-$plug.so $pkgdir/usr/lib/openvpn/openvpn-$plug.so
51     done
53     # Install easy-rsa
54     cd $srcdir/${_pkgname}-${_pkgver}
55     make -C easy-rsa/2.0 install DESTDIR=$pkgdir PREFIX=usr/share/openvpn/easy-rsa
57     # Install rc scripts
58     install -m 755 -D $srcdir/openvpn.rc $pkgdir/etc/rc.d/openvpn
59     install -m 644 -D $srcdir/openvpn.conf $pkgdir/etc/conf.d/openvpn