dnsutils: Add smaller derivation of bind

This commit is contained in:
William A. Kennington III 2015-05-23 22:26:02 -07:00
parent 384d8a79d0
commit bb6ac771c4
2 changed files with 28 additions and 10 deletions

View File

@ -7,15 +7,19 @@
# Optional DLZ Modules
, postgresql ? null, libmysql ? null, db ? null, openldap ? null
# Extra arguments
, suffix ? ""
}:
assert postgresql != null;
with stdenv;
let
version = "9.10.2";
toolsOnly = suffix == "tools";
optLibseccomp = shouldUsePkg libseccomp;
optPython = shouldUsePkg python;
optPython = if toolsOnly then null else shouldUsePkg python;
optKerberos = shouldUsePkg kerberos;
optOpenssl = shouldUsePkg openssl;
optLibxml2 = shouldUsePkg libxml2;
@ -25,18 +29,19 @@ let
optIdnkit = shouldUsePkg idnkit;
optLibiconv = shouldUsePkg libiconv;
optPostgresql = shouldUsePkg postgresql;
optLibmysql = shouldUsePkg libmysql;
optDb = shouldUsePkg db;
optOpenldap = shouldUsePkg openldap;
optPostgresql = if toolsOnly then null else shouldUsePkg postgresql;
optLibmysql = if toolsOnly then null else shouldUsePkg libmysql;
optDb = if toolsOnly then null else shouldUsePkg db;
optOpenldap = if toolsOnly then null else shouldUsePkg openldap;
pythonBin = if optPython == null then null else "${optPython}/bin/python";
in
assert optPostgresql != null;
with stdenv.lib;
stdenv.mkDerivation rec {
name = "bind-${version}";
name = "bind${optionalString (suffix != "") "-${suffix}"}-${version}";
src = fetchurl {
url = "http://ftp.isc.org/isc/bind9/${version}/${name}.tar.gz";
url = "http://ftp.isc.org/isc/bind9/${version}/bind-${version}.tar.gz";
sha256 = "163s8pvqj4lyryvfzkc6acbys7gw1by5dqwilggiwp54ia8bg6vg";
};
@ -55,7 +60,7 @@ stdenv.mkDerivation rec {
(mkOther "localstatedir" "/var")
(mkOther "sysconfdir" "/etc")
(mkEnable (optLibseccomp != null) "seccomp" null)
(mkWith (optPython != null) "python" "${optPython}/bin/python")
(mkWith (optPython != null) "python" pythonBin)
(mkEnable true "kqueue" null)
(mkEnable true "epoll" null)
(mkEnable true "devpoll" null)
@ -109,8 +114,18 @@ stdenv.mkDerivation rec {
installFlags = [
"sysconfdir=\${out}/etc"
"localstatedir=\${TMPDIR}"
] ++ optionals toolsOnly [
"DESTDIR=\${TMPDIR}"
];
postInstall = optionalString toolsOnly ''
mkdir -p $out/{bin,etc,lib,share/man/man1}
install -m 0755 $TMPDIR/$out/bin/{dig,nslookup,nsupdate} $out/bin
install -m 0644 $TMPDIR/$out/etc/bind.keys $out/etc
install -m 0644 $TMPDIR/$out/lib/*.so.* $out/lib
install -m 0644 $TMPDIR/$out/share/man/man1/{dig,nslookup,nsupdate}.1 $out/share/man/man1
'';
enableParallelBuilding = true;
meta = {

View File

@ -8502,6 +8502,9 @@ let
sabnzbd = callPackage ../servers/sabnzbd { };
bind = callPackage ../servers/dns/bind { };
dnsutils = bind.override {
suffix = "tools";
};
bird = callPackage ../servers/bird { };