diff options
Diffstat (limited to 'nixpkgs/pkgs/servers/dns/bind')
4 files changed, 166 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/dns/bind/darwin-openssl-linking-fix.patch b/nixpkgs/pkgs/servers/dns/bind/darwin-openssl-linking-fix.patch new file mode 100644 index 000000000000..8276c28c3f4b --- /dev/null +++ b/nixpkgs/pkgs/servers/dns/bind/darwin-openssl-linking-fix.patch @@ -0,0 +1,26 @@ +diff --git a/configure b/configure +index b9ad66b..a2a7382 100755 +--- a/configure ++++ b/configure +@@ -16033,21 +16033,6 @@ $as_echo "not found" >&6; } + *-hp-hpux*) + DST_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto" + ;; +- *-apple-darwin*) +- # +- # Apple's ld seaches for serially for dynamic +- # then static libraries. This means you can't +- # use -L to override dynamic system libraries +- # with static ones when linking. Instead +- # we specify a absolute path. +- # +- if test -f "$use_openssl/lib/libcrypto.dylib" +- then +- DST_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto" +- else +- DST_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a" +- fi +- ;; + *) + DST_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto" + ;; diff --git a/nixpkgs/pkgs/servers/dns/bind/default.nix b/nixpkgs/pkgs/servers/dns/bind/default.nix new file mode 100644 index 000000000000..74e1fda2d423 --- /dev/null +++ b/nixpkgs/pkgs/servers/dns/bind/default.nix @@ -0,0 +1,87 @@ +{ stdenv, lib, fetchurl +, perl +, libcap, libtool, libxml2, openssl +, enablePython ? false, python3 ? null +, enableSeccomp ? false, libseccomp ? null, buildPackages +}: + +assert enableSeccomp -> libseccomp != null; +assert enablePython -> python3 != null; + +let version = "9.12.3-P1"; in + +stdenv.mkDerivation rec { + name = "bind-${version}"; + + src = fetchurl { + url = "https://ftp.isc.org/isc/bind9/${version}/${name}.tar.gz"; + sha256 = "0wzdbn6ig851354cjdys5q3gvqcvl2gmmih1gzr8ldl7sy4r7dvc"; + }; + + outputs = [ "out" "lib" "dev" "man" "dnsutils" "host" ]; + + patches = [ ./dont-keep-configure-flags.patch ./remove-mkdir-var.patch ] ++ + stdenv.lib.optional stdenv.isDarwin ./darwin-openssl-linking-fix.patch; + + nativeBuildInputs = [ perl ]; + buildInputs = [ libtool libxml2 openssl ] + ++ lib.optional stdenv.isLinux libcap + ++ lib.optional enableSeccomp libseccomp + ++ lib.optional enablePython python3; + + STD_CDEFINES = [ "-DDIG_SIGCHASE=1" ]; # support +sigchase + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + + configureFlags = [ + "--localstatedir=/var" + "--with-libtool" + "--with-libxml2=${libxml2.dev}" + "--with-openssl=${openssl.dev}" + (if enablePython then "--with-python" else "--without-python") + "--without-atf" + "--without-dlopen" + "--without-docbook-xsl" + "--without-gssapi" + "--without-idn" + "--without-idnlib" + "--without-lmdb" + "--without-libjson" + "--without-pkcs11" + "--without-purify" + "--with-randomdev=/dev/random" + "--with-ecdsa" + "--with-gost" + "--without-eddsa" + "--with-aes" + ] ++ lib.optional stdenv.isLinux "--with-libcap=${libcap.dev}" + ++ lib.optional enableSeccomp "--enable-seccomp"; + + postInstall = '' + moveToOutput bin/bind9-config $dev + moveToOutput bin/isc-config.sh $dev + + moveToOutput bin/host $host + + moveToOutput bin/dig $dnsutils + moveToOutput bin/nslookup $dnsutils + moveToOutput bin/nsupdate $dnsutils + + for f in "$lib/lib/"*.la "$dev/bin/"{isc-config.sh,bind*-config}; do + sed -i "$f" -e 's|-L${openssl.dev}|-L${openssl.out}|g' + done + ''; + + doCheck = false; # requires root and the net + + meta = { + homepage = http://www.isc.org/software/bind; + description = "Domain name server"; + license = stdenv.lib.licenses.mpl20; + + maintainers = with stdenv.lib.maintainers; [peti]; + platforms = with stdenv.lib.platforms; unix; + + outputsToInstall = [ "out" "dnsutils" "host" ]; + }; +} diff --git a/nixpkgs/pkgs/servers/dns/bind/dont-keep-configure-flags.patch b/nixpkgs/pkgs/servers/dns/bind/dont-keep-configure-flags.patch new file mode 100644 index 000000000000..5a934056d13d --- /dev/null +++ b/nixpkgs/pkgs/servers/dns/bind/dont-keep-configure-flags.patch @@ -0,0 +1,41 @@ +diff --git a/bin/named/include/named/globals.h b/bin/named/include/named/globals.h +index 388dc97..3c6135c 100644 +--- a/bin/named/include/named/globals.h ++++ b/bin/named/include/named/globals.h +@@ -65,7 +65,9 @@ EXTERN const char * named_g_version INIT(VERSION); + EXTERN const char * named_g_product INIT(PRODUCT); + EXTERN const char * named_g_description INIT(DESCRIPTION); + EXTERN const char * named_g_srcid INIT(SRCID); ++#if 0 + EXTERN const char * named_g_configargs INIT(CONFIGARGS); ++#endif + EXTERN const char * named_g_builder INIT(BUILDER); + EXTERN in_port_t named_g_port INIT(0); + EXTERN isc_dscp_t named_g_dscp INIT(-1); +diff --git a/bin/named/main.c b/bin/named/main.c +index 4fb0566..60d56cd 100644 +--- a/bin/named/main.c ++++ b/bin/named/main.c +@@ -672,8 +672,10 @@ parse_command_line(int argc, char *argv[]) { + (*named_g_description != '\0') ? " " : "", + named_g_description, named_g_srcid); + printf("running on %s\n", named_os_uname()); ++ #if 0 + printf("built by %s with %s\n", + named_g_builder, named_g_configargs); ++ #endif + #ifdef __clang__ + printf("compiled by CLANG %s\n", __VERSION__); + #else +@@ -1075,9 +1077,11 @@ setup(void) { + NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, + "running on %s", named_os_uname()); + ++#if 0 + isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, + NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, + "built with %s", named_g_configargs); ++#endif + + isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, + NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, diff --git a/nixpkgs/pkgs/servers/dns/bind/remove-mkdir-var.patch b/nixpkgs/pkgs/servers/dns/bind/remove-mkdir-var.patch new file mode 100644 index 000000000000..d0dcd580c20a --- /dev/null +++ b/nixpkgs/pkgs/servers/dns/bind/remove-mkdir-var.patch @@ -0,0 +1,12 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -53,8 +53,7 @@ docclean manclean maintainer-clean:: + doc man:: ${MANOBJS} + + installdirs: +- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir} \ +- ${DESTDIR}${localstatedir}/run ${DESTDIR}${sysconfdir} ++ $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir} ${DESTDIR}${sysconfdir} + $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1 + + install:: isc-config.sh installdirs |