summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9ce9f7b16e20f2b7e26151c1333c6fade1c7898e (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$
# Maintainer: s3rj1k <evasive.gyron@gmail.com>
# Contributor: Stanislaw Datskevich <me a nek0 net>
# Contributor: Thomas B├Ąchler <thomas@archlinux.org>

pkgname=openvpn-pkcs11
_pkgname=openvpn
pkgver=2.4.5
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' 'lzo' 'iproute2' 'pkcs11-helper')
conflicts=('openvpn')
provides=('openvpn')
optdepends=('easy-rsa: easy CA and certificate handling')
license=('custom')
source=("https://swupdate.openvpn.net/community/releases/${_pkgname}-${pkgver}.tar.xz")
sha256sums=('43c0a363a332350f620d1cd93bb431e082bedbc93d4fb872f758650d53c1d29e')

build() {
  cd "${srcdir}"/${_pkgname}-${pkgver}

  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --enable-iproute2 \
    --enable-pkcs11 \
    --enable-plugins \
    --enable-password-save \
    --enable-x509-alt-username
  make
}

check() {
  cd "${srcdir}"/${_pkgname}-${pkgver}

  make check
}

package() {
  cd "${srcdir}"/${_pkgname}-${pkgver}

  # Install ${_pkgname}
  make DESTDIR="${pkgdir}" install

  # Create empty configuration directories
  install -d -m0750 -g 90 "${pkgdir}"/etc/${_pkgname}/{client,server}

  # Install examples
  install -d -m0755 "${pkgdir}"/usr/share/${_pkgname}
  cp -r sample/sample-config-files "${pkgdir}"/usr/share/${_pkgname}/examples

  # Install license
  install -d -m0755 "${pkgdir}"/usr/share/licenses/${_pkgname}/
  ln -sf /usr/share/doc/${_pkgname}/{COPYING,COPYRIGHT.GPL} "${pkgdir}"/usr/share/licenses/${_pkgname}/

  # Install contrib
  for FILE in $(find contrib -type f); do
    case "$(file --brief --mime-type "${FILE}")" in
      "text/x-shellscript") install -D -m0755 "${FILE}" "${pkgdir}/usr/share/${_pkgname}/${FILE}" ;;
      *) install -D -m0644 "${FILE}" "${pkgdir}/usr/share/${_pkgname}/${FILE}" ;;
    esac
  done
}