Merge pull request #13952 from sheenobu/freeradius/modules
freeradius: optional dependency support, pcap and cap enabled
This commit is contained in:
commit
2c19812cc9
@ -1,28 +1,69 @@
|
|||||||
{ stdenv, fetchurl, autoreconfHook, talloc, openssl ? null }:
|
{ stdenv, fetchurl, autoreconfHook, talloc
|
||||||
|
, openssl
|
||||||
|
, linkOpenssl? true
|
||||||
|
, openldap
|
||||||
|
, withLdap ? false
|
||||||
|
, sqlite
|
||||||
|
, withSqlite ? false
|
||||||
|
, libpcap
|
||||||
|
, withPcap ? true
|
||||||
|
, libcap
|
||||||
|
, withCap ? true
|
||||||
|
, libmemcached
|
||||||
|
, withMemcached ? false
|
||||||
|
, hiredis
|
||||||
|
, withRedis ? false
|
||||||
|
, libmysql
|
||||||
|
, withMysql ? false
|
||||||
|
, withJson ? false
|
||||||
|
, libyubikey
|
||||||
|
, withYubikey ? false
|
||||||
|
, collectd
|
||||||
|
, withCollectd ? false
|
||||||
|
}:
|
||||||
|
|
||||||
## TODO: include ldap optionally
|
assert withSqlite -> sqlite != null;
|
||||||
## TODO: include sqlite optionally
|
assert withLdap -> openldap != null;
|
||||||
## TODO: include mysql optionally
|
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;
|
||||||
|
|
||||||
|
## TODO: include windbind optionally (via samba?)
|
||||||
|
## TODO: include oracle optionally
|
||||||
|
## TODO: include ykclient optionally
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "freeradius-${version}";
|
name = "freeradius-${version}";
|
||||||
version = "3.0.11";
|
version = "3.0.11";
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [ autoreconfHook openssl talloc ]
|
||||||
autoreconfHook
|
++ optional withLdap [ openldap ]
|
||||||
talloc
|
++ optional withSqlite [ sqlite ]
|
||||||
openssl
|
++ optional withPcap [ libpcap ]
|
||||||
];
|
++ optional withCap [ libcap ]
|
||||||
|
++ optional withMemcached [ libmemcached ]
|
||||||
|
++ optional withRedis [ hiredis ]
|
||||||
|
++ optional withMysql [ libmysql ]
|
||||||
|
++ optional withJson [ pkgs."json-c" ]
|
||||||
|
++ optional withYubikey [ libyubikey ]
|
||||||
|
++ optional withCollectd [ collectd ];
|
||||||
|
|
||||||
|
# NOTE: are the --with-{lib}-lib-dir and --with-{lib}-include-dir necessary with buildInputs ?
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--sysconfdir=/etc"
|
"--sysconfdir=/etc"
|
||||||
"--localstatedir=/var"
|
"--localstatedir=/var"
|
||||||
];
|
] ++ optional (!linkOpenssl) "--with-openssl=no";
|
||||||
|
|
||||||
installFlags = [
|
installFlags = [
|
||||||
"sysconfdir=\${out}/etc"
|
"sysconfdir=\${out}/etc"
|
||||||
"localstatedir=\${TMPDIR}"
|
"localstatedir=\${TMPDIR}"
|
||||||
];
|
];
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-${version}.tar.gz";
|
url = "ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-${version}.tar.gz";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user