From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMdEB-0006Qu-MT for guix-patches@gnu.org; Sun, 18 Jun 2017 12:39:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMdE7-0000Cd-KS for guix-patches@gnu.org; Sun, 18 Jun 2017 12:39:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:52592) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dMdE7-0000CG-Dw for guix-patches@gnu.org; Sun, 18 Jun 2017 12:39:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dMdE6-0000Sv-6x for guix-patches@gnu.org; Sun, 18 Jun 2017 12:39:03 -0400 Subject: [bug#27419] [PATCH] gnu: Add unbound. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMZgE-0006eu-JT for guix-patches@gnu.org; Sun, 18 Jun 2017 08:51:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMZgB-0005ZH-Et for guix-patches@gnu.org; Sun, 18 Jun 2017 08:51:50 -0400 Received: from mx03.zaehlwerk.net ([136.243.37.109]:48025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMZgA-0005Z5-Vy for guix-patches@gnu.org; Sun, 18 Jun 2017 08:51:47 -0400 Received: from localhost (localhost [127.0.0.1]) by mx03.zaehlwerk.net (Postfix) with ESMTP id EE6DF2B95A for ; Sun, 18 Jun 2017 14:51:43 +0200 (CEST) Received: from mail.zaehlwerk.net ([IPv6:::1]) by localhost (ps04.zaehlwerk.net [IPv6:::1]) (amavisd-new, port 10587) with ESMTP id FRwqOiBJheLO for ; Sun, 18 Jun 2017 14:51:43 +0200 (CEST) Received: from zaehlwerk.net (p200300DF73D97400CBE58096AA6ECF10.dip0.t-ipconnect.de [IPv6:2003:df:73d9:7400:cbe5:8096:aa6e:cf10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.zaehlwerk.net (Postfix) with ESMTPSA for ; Sun, 18 Jun 2017 14:51:43 +0200 (CEST) Date: Sun, 18 Jun 2017 14:51:43 +0200 From: Gregor Giesen Message-ID: <20170618125143.z3ump7fib2rmwi73@zaehlwerk.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="pihy5ardxxh6cy45" Content-Disposition: inline Content-Transfer-Encoding: 7bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 27419@debbugs.gnu.org --pihy5ardxxh6cy45 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I have added 'unbound', a recurse only caching DNS server. Best, Gregor --pihy5ardxxh6cy45 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="0001-gnu-Add-unbound.patch" Content-Transfer-Encoding: quoted-printable >From fac67e33fe0501ddcad3a1e75f20b4954f36834b Mon Sep 17 00:00:00 2001 From: Gregor Giesen Date: Sun, 18 Jun 2017 14:27:34 +0200 Subject: [PATCH 1/1] gnu: Add unbound. * gnu/packages/dns.scm (unbound): New variable. --- gnu/packages/dns.scm | 146 +++++++++++++++++++++++++++++++++++++++++++++= ++++++ 1 file changed, 146 insertions(+) diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm index 2e4d8fd18..d0d8319ce 100644 --- a/gnu/packages/dns.scm +++ b/gnu/packages/dns.scm @@ -8,6 +8,7 @@ ;;; Copyright =A9 2016, 2017 Tobias Geerinckx-Rice ;;; Copyright =A9 2016 Marius Bakke ;;; Copyright =A9 2017 Vasile Dumitrascu +;;; Copyright =A9 2017 Gregor Giesen ;;; ;;; This file is part of GNU Guix. ;;; @@ -31,6 +32,7 @@ #:use-module (gnu packages databases) #:use-module (gnu packages crypto) #:use-module (gnu packages datastructures) + #:use-module (gnu packages flex) #:use-module (gnu packages glib) #:use-module (gnu packages groff) #:use-module (gnu packages groff) @@ -42,12 +44,16 @@ #:use-module (gnu packages nettle) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages protobuf) + #:use-module (gnu packages python) + #:use-module (gnu packages swig) #:use-module (gnu packages tls) #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix utils) #:use-module (guix build-system gnu)) =20 (define-public dnsmasq @@ -275,6 +281,146 @@ asynchronous fashion.") (license:non-copyleft "file://LICENSE") ; includes.h license:openssl)))) =20 +(define-public unbound + (package + (name "unbound") + (version "1.6.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://www.unbound.net/downloads/unbound-" + version ".tar.gz")) + (sha256 + (base32 + "0pw4m4z5qspsagxzbjb61xq5bhd57amw26xqvqzi6b8d3mf6azjc")))) + (build-system gnu-build-system) + (outputs '("out" "python")) + (inputs + `(("expat" ,expat) + ("flex" ,flex) + ("libevent" ,libevent) + ("protobuf" ,protobuf) + ("python" ,python-3) + ("python-wrapper" ,python-wrapper) + ("openssl" ,openssl) + ("swig" ,swig))) + (arguments + `(#:configure-flags + (list (string-append + "--with-ssl=3D" (assoc-ref %build-inputs "openssl")) + (string-append + "--with-libevent=3D" (assoc-ref %build-inputs "libevent")) + (string-append + "--with-libexpat=3D" (assoc-ref %build-inputs "expat")) + "--with-pythonmodule" "--with-pyunbound") + #:phases + (modify-phases + %standard-phases + (add-after 'configure 'fix-python-site-package-path + ;; Move python modules into their own output. + (lambda* (#:key outputs #:allow-other-keys) + (let ((pyout (assoc-ref outputs "python")) + (ver ,(version-major+minor (package-version python)))= ) + (substitute* "Makefile" + (("^PYTHON_SITE_PKG=3D.*$") + (string-append + "PYTHON_SITE_PKG=3D" + pyout "/lib/python-" ver "/site-packages\n")))))) + (add-before 'check 'fix-missing-nss-for-tests + (lambda* (#:key inputs outputs #:allow-other-keys) + (use-modules (guix build utils)) + (let* ((source (assoc-ref %build-inputs "source")) + (gcc (assoc-ref %build-inputs "gcc"))) + (call-with-output-file "/tmp/nss_preload.c" + (lambda (port) + (display "#include +#include +#include + +#include + +struct protoent *getprotobyname(const char *name) { + struct protoent *p =3D malloc(sizeof(struct protoent)); + p->p_aliases =3D malloc(sizeof(char*)); + if (strcasecmp(name, \"tcp\") =3D=3D 0) { + p->p_name =3D \"tcp\"; + p->p_proto =3D 6; + p->p_aliases[0] =3D \"TCP\"; + } else if (strcasecmp(name, \"udp\") =3D=3D 0) { + p->p_name =3D \"udp\"; + p->p_proto =3D 17; + p->p_aliases[0] =3D \"UDP\"; + } else=20 + p =3D NULL; + return p; +} + +struct protoent *getprotobynumber(int proto) { + struct protoent *p =3D malloc(sizeof(struct protoent)); + p->p_aliases =3D malloc(sizeof(char*)); + switch(proto) { + case 6: + p->p_name =3D \"tcp\"; + p->p_proto =3D 6; + p->p_aliases[0] =3D \"TCP\"; + break; + case 17: + p->p_name =3D \"udp\"; + p->p_proto =3D 17; + p->p_aliases[0] =3D \"UDP\"; + break; + default: + p =3D NULL; + break; + } + return p; +} + +struct servent *getservbyname(const char *name, const char *proto) { + struct servent *s =3D malloc(sizeof(struct servent)); + char* buf =3D malloc((strlen(proto)+1)*sizeof(char)); + strcpy(buf, proto); + s->s_aliases =3D malloc(sizeof(char*)); + s->s_aliases[0] =3D NULL; + if (strcasecmp(name, \"domain\") =3D=3D 0) { + s->s_name =3D \"domain\"; + s->s_port =3D htons(53); + s->s_proto =3D buf; + } else=20 + s =3D NULL; + return s; +} + +struct servent *getservbyport(int port, const char *proto) { + char buf[32]; + struct servent *s =3D malloc(sizeof(struct servent)); + strcpy(buf, proto); + s->s_aliases =3D malloc(sizeof(char*)); + s->s_aliases[0] =3D NULL; + switch(port) { + case 53: + s->s_name =3D \"domain\"; + s->s_port =3D 53; + s->s_proto =3D \"udp\"; + break; + default: + s =3D NULL; + break; + } + return s; +}" port))) + (system* (string-append gcc "/bin/gcc") + "-shared" "-fPIC" "-o" "/tmp/nss_preload.so" + "/tmp/nss_preload.c") + (substitute* "Makefile" + (("./unittest") + "LD_PRELOAD=3D/tmp/nss_preload.so ./unittest")))))))) + (home-page "https://www.unbound.net") + (synopsis "Validating, recursive, and caching DNS resolver") + (description + "Unbound is a recursive-only caching DNS server which can perform D= NSSEC validation of results. It implements only a minimal amount of auth= oritative service to prevent leakage to the root nameservers: forward loo= kups for localhost, reverse for 127.0.0.1 and ::1, and NXDOMAIN for zones= served by AS112. Stub and forward zones are supported.") + (license license:bsd-3))) + (define-public yadifa (package (name "yadifa") --=20 2.13.1 --pihy5ardxxh6cy45--