diff options
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | 0001-systemd.patch | 38 | ||||
-rw-r--r-- | PKGBUILD | 57 |
3 files changed, 80 insertions, 23 deletions
@@ -1,8 +1,8 @@ # Generated by mksrcinfo v8 -# Fri Nov 18 14:15:15 UTC 2016 +# Sun Nov 27 12:31:03 UTC 2016 pkgbase = openvpn-git - pkgdesc = An easy-to-use, robust, and highly configurable VPN (Virtual Private Network) - git checkout - pkgver = 2.4.beta1.r1.g237fd7f + pkgdesc = An easy-to-use, robust and highly configurable VPN (Virtual Private Network) - git checkout + pkgver = 2.4.beta2.r0.g9bc2be7 pkgrel = 1 url = http://openvpn.net/index.php/open-source.html arch = i686 @@ -23,7 +23,9 @@ pkgbase = openvpn-git conflicts = openvpn conflicts = openvpn-dev source = git://git.code.sf.net/p/openvpn/openvpn + source = 0001-systemd.patch sha256sums = SKIP + sha256sums = 21d09aea89ab3c61239ab4f619ba5885bbd89a45424efb249b108877ed03529e pkgname = openvpn-git diff --git a/0001-systemd.patch b/0001-systemd.patch new file mode 100644 index 000000000000..a82351e28eac --- /dev/null +++ b/0001-systemd.patch @@ -0,0 +1,38 @@ +diff --git a/distro/systemd/openvpn-client@.service b/distro/systemd/openvpn-client@.service +index 18b84dd..92e04f8 100644 +--- a/distro/systemd/openvpn-client@.service ++++ b/distro/systemd/openvpn-client@.service +@@ -7,12 +7,9 @@ Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage + Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO + + [Service] ++Type=forking + PrivateTmp=true +-RuntimeDirectory=openvpn-client +-RuntimeDirectoryMode=0710 +-WorkingDirectory=/etc/openvpn/client +-ExecStartPre=/bin/sh -c 'grep -q -E ^daemon %i.conf || exit 0 && /usr/bin/echo "OpenVPN configuration cannot contain --daemon when being managed by systemd" ; exit 1' +-ExecStart=/usr/sbin/openvpn --suppress-timestamps --nobind --config %i.conf ++ExecStart=/usr/sbin/openvpn --cd /etc/openvpn/client --daemon openvpn-client@%i --suppress-timestamps --nobind --config %i.conf + CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE + LimitNPROC=10 + DeviceAllow=/dev/null rw +diff --git a/distro/systemd/openvpn-server@.service b/distro/systemd/openvpn-server@.service +index a2b7b52..9dbfa43 100644 +--- a/distro/systemd/openvpn-server@.service ++++ b/distro/systemd/openvpn-server@.service +@@ -7,12 +7,11 @@ Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage + Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO + + [Service] ++Type=forking + PrivateTmp=true + RuntimeDirectory=openvpn-server + RuntimeDirectoryMode=0710 +-WorkingDirectory=/etc/openvpn/server +-ExecStartPre=/bin/sh -c 'grep -q -E ^daemon %i.conf || exit 0 && /usr/bin/echo "OpenVPN configuration cannot contain --daemon when being managed by systemd" ; exit 1' +-ExecStart=/usr/sbin/openvpn --status %t/openvpn-server/status-%i.log --status-version 2 --suppress-timestamps --config %i.conf ++ExecStart=/usr/sbin/openvpn --cd /etc/openvpn/server --daemon openvpn-server@%i --status %t/openvpn-server/status-%i.log --status-version 2 --suppress-timestamps --config %i.conf + CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE + LimitNPROC=10 + DeviceAllow=/dev/null rw @@ -1,11 +1,11 @@ # Maintainer: Christian Hesse <mail@eworm.de> pkgname=openvpn-git -pkgver=2.4.beta1.r1.g237fd7f +pkgver=2.4.beta2.r0.g9bc2be7 pkgrel=1 -pkgdesc="An easy-to-use, robust, and highly configurable VPN (Virtual Private Network) - git checkout" +pkgdesc='An easy-to-use, robust and highly configurable VPN (Virtual Private Network) - git checkout' arch=(i686 x86_64) -url="http://openvpn.net/index.php/open-source.html" +url='http://openvpn.net/index.php/open-source.html' depends=('openssl' 'lzo' 'snappy' 'lz4' 'iproute2' 'libsystemd' 'pkcs11-helper') optdepends=('easy-rsa: easy CA and certificate handling') makedepends=('git' 'systemd') @@ -13,8 +13,10 @@ conflicts=('openvpn' 'openvpn-dev') provides=('openvpn=2.4.0' 'openvpn-dev') license=('custom') # for 2.3.x release branch use: git://git.code.sf.net/p/openvpn/openvpn#branch=release/2.3 -source=('git://git.code.sf.net/p/openvpn/openvpn') -sha256sums=('SKIP') +source=('git://git.code.sf.net/p/openvpn/openvpn' + '0001-systemd.patch') +sha256sums=('SKIP' + '21d09aea89ab3c61239ab4f619ba5885bbd89a45424efb249b108877ed03529e') pkgver() { cd openvpn/ @@ -31,44 +33,59 @@ pkgver() { fi } +prepare() { + cd openvpn/ + + # modifications to upstream systemd units + patch -Np1 < "${srcdir}"/0001-systemd.patch +} + build() { cd openvpn/ - # Build openvpn autoreconf -vi - CFLAGS="${CFLAGS} -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn\\\"" ./configure \ + CFLAGS="${CFLAGS} -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn/plugins\\\"" \ + ./configure \ --prefix=/usr \ --sbindir=/usr/bin \ - --enable-password-save \ - --mandir=/usr/share/man \ --enable-iproute2 \ - --enable-systemd \ + --enable-password-save \ --enable-pkcs11 \ + --enable-plugins \ + --enable-systemd \ --enable-x509-alt-username make } +check() { + cd openvpn/ + + make check +} + package() { cd openvpn/ # Install openvpn - make DESTDIR=${pkgdir} install - install -d -m0755 ${pkgdir}/etc/openvpn + make DESTDIR="${pkgdir}" install + + # Create empty configuration directory + install -d -m0750 -g 90 "${pkgdir}"/etc/openvpn/{client,server} # Install examples - install -d -m0755 ${pkgdir}/usr/share/openvpn - cp -r sample/sample-config-files ${pkgdir}/usr/share/openvpn/examples + install -d -m0755 "${pkgdir}"/usr/share/openvpn + cp -r sample/sample-config-files "${pkgdir}"/usr/share/openvpn/examples # Install license - install -d -m0755 ${pkgdir}/usr/share/licenses/openvpn - ln -sf /usr/share/doc/${pkgname}/{COPYING,COPYRIGHT.GPL} ${pkgdir}/usr/share/licenses/openvpn + install -d -m0755 "${pkgdir}"/usr/share/licenses/openvpn + ln -sf /usr/share/doc/"${pkgname}"/{COPYING,COPYRIGHT.GPL} "${pkgdir}"/usr/share/licenses/openvpn # Install contrib - install -d -m0755 ${pkgdir}/usr/share/openvpn/contrib - cp -r contrib ${pkgdir}/usr/share/openvpn + install -d -m0755 "${pkgdir}"/usr/share/openvpn/contrib + cp -r contrib "${pkgdir}"/usr/share/openvpn # Install systemd services - install -D -m0644 distro/systemd/openvpn-client@.service ${pkgdir}/usr/lib/systemd/system/openvpn-client@.service - install -D -m0644 distro/systemd/openvpn-server@.service ${pkgdir}/usr/lib/systemd/system/openvpn-server@.service + install -d -m0755 "${pkgdir}"/usr/lib/systemd/system/ + install -m0644 distro/systemd/openvpn-{client,server}@.service "${pkgdir}"/usr/lib/systemd/system/ } |