summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 71d79b924a100c5a40581b86bd5ada5ae7d6c154 (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
# Maintainer: Shalygin Konstantin <k0ste@k0ste.ru>
# Contributor: Shalygin Konstantin <k0ste@k0ste.ru>

pkgname='openvpn-auth-ldap'
_name='auth-ldap'
pkgver='2.0.4'
pkgrel='3'
pkgdesc='OpenVPN Auth via LDAP/AD plugin. RFC2307 support.'
arch=('any')
url="https://github.com/threerings/${pkgname}"
license=('BSD')
depends=('openvpn' 'libldap' 'libsasl' 'openssl')
source=("${url}/archive/${_name}-${pkgver}.tar.gz"
	"${url}/pull/77.patch")
makedepends=('gcc-objc' 're2c' 'doxygen')
sha256sums=('81f600cdc88adb2258f57df1ed2d87f0afa945f66cbf8897ad50e76f42509168'
            '003e5acefebc5cdbea5a9513ca8a27f624917a357e72f825dccf4294c375b4f5')
backup=("etc/openvpn/server/${_name}.conf")
_gcc_objc_path="$(pacman -Ql gcc-objc |
  gawk 'match($0, /^gcc-objc\s(\/usr\/lib\/(.*)-gnu\/[0-9.]+\/include\/objc\/)$/, a) {print a[1]}')"

prepare() {
  cd "${srcdir}/${pkgname}-${_name}-${pkgver}"

  patch -p1 -i "${srcdir}/77.patch"
  sed -i 's|AC_CONFIG_SRCDIR(${srcdir}/src/auth-ldap.m)|AC_CONFIG_SRCDIR(src/auth-ldap.m)|g' configure.ac
  autoreconf -fvi
  autoheader

  OBJCFLAGS=-I${_gcc_objc_path} CFLAGS=-std=gnu99 \
  ./configure \
    --with-openvpn="/usr/include/openvpn" \
    --with-objc-runtime="GNU"
}

build() {
  cd "${srcdir}/${pkgname}-${_name}-${pkgver}"
  make
}

check() {
  cd "${srcdir}/${pkgname}-${_name}-${pkgver}"
  make test
}

package() {
  cd "${srcdir}/${pkgname}-${_name}-${pkgver}"
  install -Dm775 "src/${pkgname}.so" "${pkgdir}/usr/lib/openvpn/plugins/${pkgname}.so"
  install -Dm400 "${_name}.conf" "${pkgdir}/etc/openvpn/server/${_name}.conf"
}