nixpkgs/pkgs/servers/freeradius/default.nix

88 lines
2.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, autoreconfHook, talloc, finger_bsd, perl
, openssl
, linkOpenssl? true
, openldap
2017-01-26 03:00:26 +01:00
, withLdap ? true
, sqlite
2017-01-26 03:00:26 +01:00
, withSqlite ? true
, libpcap
, withPcap ? true
, libcap
, withCap ? true
, libmemcached
, withMemcached ? false
, hiredis
, withRedis ? false
, mysql
, withMysql ? false
, json_c
, withJson ? false
, libyubikey
, withYubikey ? false
, collectd
, withCollectd ? false
}:
2016-03-13 08:22:27 +01:00
assert withSqlite -> sqlite != null;
assert withLdap -> openldap != null;
assert withPcap -> libpcap != null;
assert withCap -> libcap != null;
assert withMemcached -> libmemcached != null;
assert withRedis -> hiredis != null;
assert withMysql -> mysql != null;
assert withYubikey -> libyubikey != null;
assert withCollectd -> collectd != null;
2016-03-13 08:22:27 +01:00
## TODO: include windbind optionally (via samba?)
## TODO: include oracle optionally
## TODO: include ykclient optionally
with stdenv.lib;
2016-03-13 08:22:27 +01:00
stdenv.mkDerivation rec {
name = "freeradius-${version}";
2018-01-15 19:29:20 +01:00
version = "3.0.16";
2016-03-13 08:22:27 +01:00
2017-01-26 03:00:26 +01:00
src = fetchurl {
url = "ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-${version}.tar.gz";
2018-01-15 19:29:20 +01:00
sha256 = "062dw4ckaa7k2br16l3naz9dr7hvzqhpxdwam3klq1i44v4hvl1b";
2017-01-26 03:00:26 +01:00
};
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ openssl talloc finger_bsd perl ]
++ optional withLdap openldap
++ optional withSqlite sqlite
++ optional withPcap libpcap
++ optional withCap libcap
++ optional withMemcached libmemcached
++ optional withRedis hiredis
++ optional withMysql mysql.connector-c
++ optional withJson json_c
++ optional withYubikey libyubikey
++ optional withCollectd collectd;
2016-03-13 08:22:27 +01:00
configureFlags = [
"--sysconfdir=/etc"
"--localstatedir=/var"
] ++ optional (!linkOpenssl) "--with-openssl=no";
2016-03-13 08:22:27 +01:00
postPatch = ''
substituteInPlace src/main/checkrad.in --replace "/usr/bin/finger" "${finger_bsd}/bin/finger"
'';
2016-03-13 08:22:27 +01:00
installFlags = [
"sysconfdir=\${out}/etc"
"localstatedir=\${TMPDIR}"
];
2016-03-13 08:22:27 +01:00
meta = with stdenv.lib; {
2017-08-25 13:57:39 +02:00
homepage = https://freeradius.org/;
2016-03-13 08:22:27 +01:00
description = "A modular, high performance free RADIUS suite";
2017-09-02 01:08:07 +02:00
license = licenses.gpl2;
maintainers = with maintainers; [ sheenobu willibutz ];
platforms = with platforms; linux;
2016-03-13 08:22:27 +01:00
};
}