diff mbox

[v5,04/17] gnu: Add perl-net-dns-resolver-programmable.

Message ID 20160728213833.22057-5-dannym@scratchpost.org
State New
Headers show

Commit Message

Danny Milosavljevic July 28, 2016, 9:38 p.m. UTC
gnu: Add perl-net-dns-resolver-programmable.

* gnu/packages/networking.scm (perl-net-dns-resolver-programmable): New variable.
---
 gnu/packages/networking.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Leo Famulari Aug. 8, 2016, 7:41 p.m. UTC | #1
On Thu, Jul 28, 2016 at 11:38:20PM +0200, Danny Milosavljevic wrote:
> 
> gnu: Add perl-net-dns-resolver-programmable.
> 
> * gnu/packages/networking.scm (perl-net-dns-resolver-programmable): New variable.

I'm going through v5 of this patch series. This is the first patch I
have a question about.

> +(define-public perl-net-dns-resolver-programmable
> + (package
> +  (name "perl-net-dns-resolver-programmable")
> +  (version "v0.003")
> +  (source
> +    (origin
> +      (method url-fetch)
> +      (uri (string-append
> +             "mirror://cpan/authors/id/J/JM/JMEHNLE/net-dns-resolver-programmable/"
> +             "Net-DNS-Resolver-Programmable-" version ".tar.gz"))
> +      (sha256
> +        (base32
> +          "1v3nl2kaj4fs55n1617n53q8sa3mir06898vpy1rq98zjih24h4d"))
> +      (patches
> +       (list (origin
> +               (method url-fetch)
> +               (uri "https://rt.cpan.org/Public/Ticket/Attachment/1575108/841078/patch.txt")
> +               (sha256
> +                 (base32
> +                   "027fzq1dryqwhkprz4r32vj78qfdnx1mhjx6piag7p62p5npmdic")))))))

Can you send a comment explaining why we have to apply this patch? Its
URL does not enable me to "go back" to the relevant discussion and learn
the context or identity of the author.

Assuming we keep the upstream patch, I will download it and add it to
'gnu/packages/patches', and apply it using the method seen in the cpio
package definition. I can do that on my own, or you can submit a v6 of
this patch.
Danny Milosavljevic Aug. 8, 2016, 9:08 p.m. UTC | #2
Hi Leo,

> Can you send a comment explaining why we have to apply this patch? Its
> URL does not enable me to "go back" to the relevant discussion and learn
> the context or identity of the author.

Mail-SPF uses a programmable (mock) DNS server to run its tests.

That's what Net-DNS-Resolver-Programmable is supposed to do. Unfortunately it doesn't work without the patch.

It said:
> t/00.04-class-server.t test fails: [...] ok 19 - Server "A" dns_lookup() answer RR type Unknown error on DNS 'A' lookup of 'example.com' (EDNSError) at /home/test/fedora/perl-Mail-SPF/Mail-SPF-v2.9.0/blib/lib/Mail/SPF/Server.pm line 573. # Looks like you planned 23 tests but ran 19. # Looks like your test exited with 255 just after 19.

That's because it was using an undocumented internal method of Net::DNS which is not exposed anymore. The patch makes the call of the undefined method contigent upon it existing. That way, the DNS resolver will actually work.

See also <https://rt.cpan.org/Public/Bug/Display.html?id=95901>.
diff mbox

Patch

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index a6318b2..a69ef0e 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -469,3 +469,36 @@  application stack itself.")
   (description "Socket6 binds the IPv6 related part of the C socket header
 definitions and structure manipulators for Perl.")
   (license license:bsd-3)))
+
+(define-public perl-net-dns-resolver-programmable
+ (package
+  (name "perl-net-dns-resolver-programmable")
+  (version "v0.003")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append
+             "mirror://cpan/authors/id/J/JM/JMEHNLE/net-dns-resolver-programmable/"
+             "Net-DNS-Resolver-Programmable-" version ".tar.gz"))
+      (sha256
+        (base32
+          "1v3nl2kaj4fs55n1617n53q8sa3mir06898vpy1rq98zjih24h4d"))
+      (patches
+       (list (origin
+               (method url-fetch)
+               (uri "https://rt.cpan.org/Public/Ticket/Attachment/1575108/841078/patch.txt")
+               (sha256
+                 (base32
+                   "027fzq1dryqwhkprz4r32vj78qfdnx1mhjx6piag7p62p5npmdic")))))))
+  (build-system perl-build-system)
+  (native-inputs
+    `(("perl-module-build" ,perl-module-build)))
+  (inputs `(("perl-net-dns" ,perl-net-dns)))
+  (home-page
+    "http://search.cpan.org/dist/Net-DNS-Resolver-Programmable")
+  (synopsis
+    "programmable DNS resolver class for offline
+emulation of DNS")
+  (description "Net::DNS::Resolver::Programmable is a programmable DNS resolver for
+offline emulation of DNS.")
+  (license (package-license perl))))