2016-04-27 08:07:38 +01: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
|
2019-09-22 08:38:09 +01:00
|
|
|
, libmysqlclient
|
2016-03-16 07:15:55 +00:00
|
|
|
, withMysql ? false
|
2016-10-01 22:23:05 +01:00
|
|
|
, json_c
|
2016-03-16 07:15:55 +00:00
|
|
|
, withJson ? false
|
|
|
|
, libyubikey
|
|
|
|
, withYubikey ? false
|
|
|
|
, collectd
|
|
|
|
, withCollectd ? false
|
2018-08-01 01:19:25 +01:00
|
|
|
, curl
|
|
|
|
, withRest ? false
|
2016-03-16 07:15:55 +00:00
|
|
|
}:
|
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;
|
2019-09-22 08:38:09 +01:00
|
|
|
assert withMysql -> libmysqlclient != null;
|
2016-03-16 07:15:55 +00:00
|
|
|
assert withYubikey -> libyubikey != null;
|
|
|
|
assert withCollectd -> collectd != null;
|
2018-08-01 01:19:25 +01:00
|
|
|
assert withRest -> curl != null && withJson;
|
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 {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "freeradius";
|
2019-04-14 19:03:52 +01:00
|
|
|
version = "3.0.19";
|
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";
|
2019-04-14 19:03:52 +01:00
|
|
|
sha256 = "0v5b46rq878093ff549ijccy98md1l7l4rvshjxs672il0zvq5i4";
|
2017-01-26 02:00:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
|
|
|
buildInputs = [ openssl talloc finger_bsd perl ]
|
2016-10-01 22:23:05 +01:00
|
|
|
++ optional withLdap openldap
|
|
|
|
++ optional withSqlite sqlite
|
|
|
|
++ optional withPcap libpcap
|
|
|
|
++ optional withCap libcap
|
|
|
|
++ optional withMemcached libmemcached
|
|
|
|
++ optional withRedis hiredis
|
2019-09-22 08:38:09 +01:00
|
|
|
++ optional withMysql libmysqlclient
|
2016-10-01 22:23:05 +01:00
|
|
|
++ optional withJson json_c
|
|
|
|
++ optional withYubikey libyubikey
|
2018-08-01 01:19:25 +01:00
|
|
|
++ optional withCollectd collectd
|
|
|
|
++ optional withRest curl;
|
|
|
|
|
2016-03-16 07:15:55 +00:00
|
|
|
|
2016-03-13 07:22:27 +00:00
|
|
|
configureFlags = [
|
2018-08-01 01:19:25 +01:00
|
|
|
"--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 08:07:38 +01: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
|
|
|
|
2018-08-01 01:19:25 +01:00
|
|
|
outputs = [ "out" "dev" "man" "doc" ];
|
|
|
|
|
2016-03-13 07:22:27 +00:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-25 12:57:39 +01:00
|
|
|
homepage = https://freeradius.org/;
|
2016-03-13 07:22:27 +00:00
|
|
|
description = "A modular, high performance free RADIUS suite";
|
2017-09-02 00:08:07 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ sheenobu willibutz ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = with platforms; linux;
|
2016-03-13 07:22:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|