summary refs log tree commit diff
path: root/pkgs/tools/networking/openvpn/openvpn-auth-ldap.nix
blob: 70dacddafc3735f03650b90a65a0ead0292263c8 (plain) (blame)
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
{ lib
, stdenv
, fetchFromGitHub
, autoreconfHook
, gnustep
, re2c
, openldap
, openssl
, openvpn
}:

stdenv.mkDerivation rec {
  pname = "openvpn-auth-ldap";
  version = "2.0.4";

  src = fetchFromGitHub {
    owner = "threerings";
    repo = "openvpn-auth-ldap";
    rev = "auth-ldap-${version}";
    sha256 = "1j30sygj8nm8wjqxzpb7pfzr3dxqxggswzxd7z5yk7y04c0yp1hb";
  };

  nativeBuildInputs = [
    autoreconfHook
    gnustep.base
    gnustep.libobjc
    gnustep.make
    re2c
  ];

  buildInputs = [
    openldap
    openssl
    openvpn
  ];

  configureFlags = [
    "--with-objc-runtime=GNU"
    "--with-openvpn=${openvpn}/include"
    "--libdir=$(out)/lib/openvpn"
  ];

  doCheck = true;

  preInstall = ''
    mkdir -p $out/lib/openvpn $out/share/doc/openvpn/examples
    cp README.md $out/share/doc/openvpn/
    cp auth-ldap.conf $out/share/doc/openvpn/examples/
  '';

  meta = with lib; {
    description = "LDAP authentication plugin for OpenVPN";
    homepage = "https://github.com/threerings/openvpn-auth-ldap";
    license = [
      licenses.asl20
      licenses.bsd3
    ];
    maintainers = [ maintainers.benley ];
    platforms = platforms.unix;
  };
}