2016-04-27 07:07:38 +00:00
|
|
|
{ stdenv, fetchurl, autoreconfHook, talloc, finger_bsd, perl
|
2016-03-16 07:15:55 +00:00
|
|
|
, openssl
|
|
|
|
, linkOpenssl? true
|
|
|
|
, openldap
|
2017-01-26 02:00:26 +00:00
|
|
|
, withLdap ? true
|
2016-03-16 07:15:55 +00:00
|
|
|
, sqlite
|
2017-01-26 02:00:26 +00:00
|
|
|
, withSqlite ? true
|
2016-03-16 07:15:55 +00:00
|
|
|
, libpcap
|
|
|
|
, withPcap ? true
|
|
|
|
, libcap
|
|
|
|
, withCap ? true
|
|
|
|
, libmemcached
|
|
|
|
, withMemcached ? false
|
|
|
|
, hiredis
|
|
|
|
, withRedis ? false
|
|
|
|
, libmysql
|
|
|
|
, withMysql ? false
|
2016-10-01 21:23:05 +00:00
|
|
|
, json_c
|
2016-03-16 07:15:55 +00:00
|
|
|
, withJson ? false
|
|
|
|
, libyubikey
|
|
|
|
, withYubikey ? false
|
|
|
|
, collectd
|
|
|
|
, withCollectd ? false
|
|
|
|
}:
|
2016-03-13 07:22:27 +00:00
|
|
|
|
2016-03-16 07:15:55 +00: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 -> libmysql != null;
|
|
|
|
assert withYubikey -> libyubikey != null;
|
|
|
|
assert withCollectd -> collectd != null;
|
2016-03-13 07:22:27 +00:00
|
|
|
|
2016-03-16 07:15:55 +00:00
|
|
|
## TODO: include windbind optionally (via samba?)
|
|
|
|
## TODO: include oracle optionally
|
|
|
|
## TODO: include ykclient optionally
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2016-03-13 07:22:27 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "freeradius-${version}";
|
2017-06-26 23:44:00 +00:00
|
|
|
version = "3.0.14";
|
2016-03-13 07:22:27 +00:00
|
|
|
|
2017-01-26 02:00:26 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-${version}.tar.gz";
|
2017-06-26 23:44:00 +00:00
|
|
|
sha256 = "02ar0xn4dfrs95cmd4c798k95rmnzzvcryyyl2vjv53ak16igmpw";
|
2017-01-26 02:00:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
|
|
|
buildInputs = [ openssl talloc finger_bsd perl ]
|
2016-10-01 21:23:05 +00:00
|
|
|
++ optional withLdap openldap
|
|
|
|
++ optional withSqlite sqlite
|
|
|
|
++ optional withPcap libpcap
|
|
|
|
++ optional withCap libcap
|
|
|
|
++ optional withMemcached libmemcached
|
|
|
|
++ optional withRedis hiredis
|
|
|
|
++ optional withMysql libmysql
|
|
|
|
++ optional withJson json_c
|
|
|
|
++ optional withYubikey libyubikey
|
|
|
|
++ optional withCollectd collectd;
|
2016-03-16 07:15:55 +00:00
|
|
|
|
2016-03-13 07:22:27 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2016-03-16 07:15:55 +00:00
|
|
|
] ++ optional (!linkOpenssl) "--with-openssl=no";
|
2016-03-13 07:22:27 +00:00
|
|
|
|
2016-04-27 07:07:38 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/main/checkrad.in --replace "/usr/bin/finger" "${finger_bsd}/bin/finger"
|
|
|
|
'';
|
|
|
|
|
2016-03-13 07:22:27 +00:00
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=\${out}/etc"
|
|
|
|
"localstatedir=\${TMPDIR}"
|
2016-03-16 07:15:55 +00:00
|
|
|
];
|
2016-03-13 07:22:27 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://freeradius.org/;
|
|
|
|
description = "A modular, high performance free RADIUS suite";
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2016-03-16 01:44:44 +00:00
|
|
|
maintainers = with maintainers; [ sheenobu ];
|
2016-08-02 17:50:55 +00:00
|
|
|
platforms = with platforms; linux;
|
2016-03-13 07:22:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|