nixpkgs/pkgs/tools/networking/openvpn/openvpn-auth-ldap.nix

77 lines
1.9 KiB
Nix
Raw Normal View History

2017-11-01 21:07:01 +00:00
{ stdenv, lib, fetchFromGitHub, fetchpatch,
autoreconfHook, re2c, openldap, openvpn, gnustep, check
}:
let
srcName = "openvpn-auth-ldap";
srcVersion = "2.0.3";
debianRev = "6.1";
fetchPatchFromDebian =
{patch, sha256}:
fetchpatch {
inherit sha256;
url = "http://sources.debian.net/data/main/o/${srcName}/${srcVersion}-${debianRev}/debian/patches/${patch}";
};
in
stdenv.mkDerivation rec {
name = "${srcName}-${version}";
version = "${srcVersion}+deb${debianRev}";
2017-11-22 14:00:19 +00:00
src = fetchFromGitHub {
2017-11-01 21:07:01 +00:00
owner = "threerings";
repo = srcName;
2017-11-22 14:00:19 +00:00
rev = "auth-ldap-${srcVersion}";
2017-11-01 21:07:01 +00:00
sha256 = "1v635ylzf5x3l3lirf3n6173q1w8g0ssjjkf27qqw98c3iqp63sq";
};
patches = map fetchPatchFromDebian [
{patch = "STARTTLS_before_auth.patch";
2017-11-22 14:00:19 +00:00
sha256 = "02kky73mgx9jf16lpabppl271zyjn4a1160k8b6a0fax5ic8gbwk";}
2017-11-01 21:07:01 +00:00
{patch = "gobjc_4.7_runtime.patch";
2017-11-22 14:00:19 +00:00
sha256 = "0ljmdn70g5xp4kjcv59wg2wnqaifjdfdv1wlj356d10a7fzvxc76";}
2017-11-01 21:07:01 +00:00
{patch = "openvpn_ldap_simpler_add_handler_4";
2017-11-22 14:00:19 +00:00
sha256 = "0nha9mazp3dywbs1ywj8xi4ahzsjsasyrcic87v8c0x2nwl9kaa0";}
2017-11-01 21:07:01 +00:00
{patch = "auth-ldap-gnustep.patch";
2017-11-22 14:00:19 +00:00
sha256 = "053jni1s3pacpi2s43dkmk95j79ifh8rybjly13yy2dqffbasr31";}
2017-11-01 21:07:01 +00:00
];
nativeBuildInputs = [
autoreconfHook
];
buildInputs = [
check
gnustep.base
gnustep.libobjc
gnustep.make
openldap
openvpn
re2c
];
configureFlags = [
"--with-objc-runtime=modern"
"--with-openvpn=${openvpn}/include"
"--libdir=$(out)/lib/openvpn"
];
preInstall = ''
mkdir -p $out/lib/openvpn $out/share/doc/openvpn/examples
cp README $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";
2017-11-01 21:07:01 +00:00
license = [
licenses.asl20
licenses.bsd3
];
maintainers = [ maintainers.benley ];
platforms = platforms.unix;
};
}