summaryrefslogtreecommitdiff
path: root/core/openvpn/PKGBUILD
blob: 40fe8cad9c8a75de53e49b7410d48b4054fa1e42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# $Id: PKGBUILD 177954 2013-02-12 12:13:51Z thomas $
# Maintainer: Thomas Bächler <thomas@archlinux.org>

pkgname=openvpn
pkgver=2.3.0
pkgrel=2
pkgdesc="An easy-to-use, robust, and highly configurable VPN (Virtual Private Network)"
arch=(i686 x86_64)
url="http://openvpn.net/index.php/open-source.html"
depends=('openssl' 'lzo2' 'iproute2')
makedepends=('systemd')
license=('custom')
backup=(usr/share/openvpn/easy-rsa/vars
        usr/share/openvpn/easy-rsa/openssl-1.0.0.cnf)
source=(http://swupdate.openvpn.net/community/releases/openvpn-${pkgver}.tar.gz
        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
        http://build.openvpn.net/downloads/releases/easy-rsa-2.2.0_master.tar.gz.asc
        openvpn@.service
        openvpn-2.3.0-fix-systemd-ask-password-path.patch)
md5sums=('56cffde5d5320e0b1ec364d3e486aca9'
         '3f67e2fa605800a964dbbcfca644d283'
         'fbf818b6e1f212e77b9ce0e6d92584a1'
         '46df49b85f9850fec287e311279bdbef'
         '0846aa59d0b123d61030890f9a4135ae'
         'e1bd1523e38745e948c710db1a330bb1')
options=(!libtool)

build() {
  cd $srcdir/$pkgname-$pkgver
  patch -p0 -i $srcdir/openvpn-2.3.0-fix-systemd-ask-password-path.patch
  # Build openvpn
  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 -m644 COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
  # Install contrib
  install -d -m755 $pkgdir/usr/share/openvpn/contrib
  cp -r contrib $pkgdir/usr/share/openvpn
  # Install easy-rsa
  cd $srcdir/easy-rsa-2.2.0_master
  make install DESTDIR=$pkgdir
  rm -f ${pkgdir}/usr/share/openvpn/easy-rsa/openssl-0.9.?.cnf
  # Install rc scripts
  install -D -m644 $srcdir/openvpn@.service $pkgdir/usr/lib/systemd/system/openvpn@.service
}