db-move: moved webkit2gtk from [testing] to [extra] (x86_64)
[arch-packages.git] / openvpn / trunk / PKGBUILD
blob6fc8e2e451ff76aaf8f8ea262e38eb313aefea17
1 # Maintainer: Christian Hesse <mail@eworm.de>
3 pkgname=openvpn
4 _tag='4664c458f154156e5d56020bedefc160fdc79465' # git rev-parse v${pkgver}
5 pkgver=2.6.3
6 pkgrel=1
7 pkgdesc='An easy-to-use, robust and highly configurable VPN (Virtual Private Network)'
8 arch=('x86_64')
9 url='https://openvpn.net/index.php/open-source.html'
10 license=('custom')
11 depends=('openssl' 'lzo' 'lz4' 'systemd-libs' 'libsystemd.so' 'pkcs11-helper' 'libpkcs11-helper.so')
12 optdepends=('easy-rsa: easy CA and certificate handling'
13             'pam: authenticate via PAM')
14 makedepends=('git' 'systemd' 'python-docutils')
15 install=openvpn.install
16 validpgpkeys=('F554A3687412CFFEBDEFE0A312F5F7B42F2B01E7'  # OpenVPN - Security Mailing List <security@openvpn.net>
17               'B62E6A2B4E56570B7BDC6BE01D829EFECA562812') # Gert Doering <gert@v6.de>
18 source=("git+https://github.com/OpenVPN/openvpn.git#tag=${_tag}?signed"
19         '0001-unprivileged.patch'
20         'sysusers.conf'
21         'tmpfiles.conf')
22 sha256sums=('SKIP'
23             '77874824d96c1fd6c14259a6ea16232ae574dda3d5adba1798ccd6c93694846c'
24             '3646b865ac67783fafc6652589cfe2a3105ecef06f3907f33de5135815f6a621'
25             'b1436f953a4f1be7083711d11928a9924993f940ff56ff92d288d6100df673fc')
27 prepare() {
28   cd "${srcdir}"/${pkgname}
30   # https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19302.html
31   sed -i '/^CONFIGURE_DEFINES=/s/set/env/g' configure.ac
33   # start with unprivileged user and keep granted privileges
34   patch -Np1 < ../0001-unprivileged.patch
36   autoreconf --force --install
39 build() {
40   mkdir "${srcdir}"/build
41   cd "${srcdir}"/build
43   "${srcdir}"/openvpn/configure \
44     --prefix=/usr \
45     --sbindir=/usr/bin \
46     --enable-pkcs11 \
47     --enable-plugins \
48     --enable-systemd \
49     --enable-x509-alt-username
50   make
53 check() {
54   cd "${srcdir}"/build
56   make check
59 package() {
60   cd "${srcdir}"/build
62   # Install openvpn
63   make DESTDIR="${pkgdir}" install
65   # Install sysusers and tmpfiles files
66   install -D -m0644 ../sysusers.conf "${pkgdir}"/usr/lib/sysusers.d/openvpn.conf
67   install -D -m0644 ../tmpfiles.conf "${pkgdir}"/usr/lib/tmpfiles.d/openvpn.conf
69   # Install license
70   install -d -m0755 "${pkgdir}"/usr/share/licenses/openvpn/
71   ln -sf /usr/share/doc/openvpn/{COPYING,COPYRIGHT.GPL} "${pkgdir}"/usr/share/licenses/openvpn/
73   cd "${srcdir}"/${pkgname}
75   # Install examples
76   install -d -m0755 "${pkgdir}"/usr/share/openvpn
77   cp -r sample/sample-config-files "${pkgdir}"/usr/share/openvpn/examples
79   # Install contrib
80   for FILE in $(find contrib -type f); do
81     case "$(file --brief --mime-type --no-sandbox "${FILE}")" in
82       "text/x-shellscript")
83         install -D -m0755 "${FILE}" "${pkgdir}/usr/share/openvpn/${FILE}" ;;
84       *)
85         install -D -m0644 "${FILE}" "${pkgdir}/usr/share/openvpn/${FILE}" ;;
86     esac
87   done