From bb6ac771c40342d578aa5959d81454b3676b0e49 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sat, 23 May 2015 22:26:02 -0700 Subject: [PATCH] dnsutils: Add smaller derivation of bind --- pkgs/servers/dns/bind/default.nix | 35 ++++++++++++++++++++++--------- pkgs/top-level/all-packages.nix | 3 +++ 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/pkgs/servers/dns/bind/default.nix b/pkgs/servers/dns/bind/default.nix index bb4e1a0f8d43..70d88b2a9689 100644 --- a/pkgs/servers/dns/bind/default.nix +++ b/pkgs/servers/dns/bind/default.nix @@ -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 = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8b0c09f2974c..339563fddf19 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8502,6 +8502,9 @@ let sabnzbd = callPackage ../servers/sabnzbd { }; bind = callPackage ../servers/dns/bind { }; + dnsutils = bind.override { + suffix = "tools"; + }; bird = callPackage ../servers/bird { };