diff mbox

wip spamassassin

Message ID 20160727005058.63ff3252@scratchpost.org
State New
Headers show

Commit Message

Danny Milosavljevic July 26, 2016, 10:50 p.m. UTC
Hi,

I'm trying to package spamassassin.

I've got it to work with

$ guix build -S spamassassin
... extract it
$ guix environment --pure spamassassin
$ perl Makefile.PL PREFIX=/gnu/store/37hdpcyz1b6y5jjwzdmxw14gd1xsf9fv-spamassassin-3.4.1 INSTALLDIRS=site
$ make
... works fine.

But

$ guix package -i spamassassin

fails with:

...
checking for h_errno... yes
checking for in_addr_t... yes
checking for INADDR_NONE... yes
checking for EX__MAX... yes
checking for EAI_ADDRFAMILY... no
checking for EAI_SYSTEM... (cached) no
checking for EAI_NODATA... (cached) no
configure: creating ./config.status
./configure: line 5848: /bin/sh: No such file or directory
Makefile:1815: recipe for target 'spamc/Makefile' failed
make: *** [spamc/Makefile] Error 1
phase `build' failed after 6.1 seconds
builder for `/gnu/store/y604k3bqc40zxclhvja45f2fq8yz4jnz-spamassassin-3.4.1.drv' failed with exit code 1
guix package: error: build failed: build of `/gnu/store/y604k3bqc40zxclhvja45f2fq8yz4jnz-spamassassin-3.4.1.drv' failed

Why?

Patch:


It needs all the perl packages I've submitted lately, too.

Comments

Ben Woodcroft July 27, 2016, 12:01 a.m. UTC | #1
Hi Danny,

Thanks for all your patches.

On 27/07/16 08:50, Danny Milosavljevic wrote:
> Hi,
>
> I'm trying to package spamassassin.
>
> I've got it to work with
>
> $ guix build -S spamassassin
> ... extract it
> $ guix environment --pure spamassassin
> $ perl Makefile.PL PREFIX=/gnu/store/37hdpcyz1b6y5jjwzdmxw14gd1xsf9fv-spamassassin-3.4.1 INSTALLDIRS=site
> $ make
> ... works fine.
>
> But
>
> $ guix package -i spamassassin
>
> fails with:
>
> ...
> checking for h_errno... yes
> checking for in_addr_t... yes
> checking for INADDR_NONE... yes
> checking for EX__MAX... yes
> checking for EAI_ADDRFAMILY... no
> checking for EAI_SYSTEM... (cached) no
> checking for EAI_NODATA... (cached) no
> configure: creating ./config.status
> ./configure: line 5848: /bin/sh: No such file or directory

This seems to be the error here. Is "/bin/sh" hard-coded into a file 
somewhere? This path exists outside the build environment, but doesn't 
inside, potentially explaining why compilation works outside but not inside.

ben
Leo Famulari July 28, 2016, 9:47 p.m. UTC | #2
On Wed, Jul 27, 2016 at 12:50:58AM +0200, Danny Milosavljevic wrote:
> ./configure: line 5848: /bin/sh: No such file or directory

I recommend you try adapting the 'patch-config-files' phase from
the Vim package definition in (gnu packages vim):

        #:phases
        (modify-phases %standard-phases
          (add-after 'configure 'patch-config-files
            (lambda _
              (substitute* "runtime/tools/mve.awk"
                (("/usr/bin/nawk") (which "gawk")))
              (substitute* "src/testdir/Makefile"
                (("/bin/sh") (which "sh"))))))))

I hope that helps!
diff mbox

Patch

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 6d47016..1d410cb 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1326,3 +1326,41 @@  Khard can also be used from within the email client @command{mutt}.")
   (description "Mail::SPF is the Sender Policy Framework implemented
 in Perl.")
   (license bsd-3)))
+
+(define-public spamassassin
+  (package
+    (name "spamassassin")
+    (version "3.4.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://mirror.klaus-uwe.me/apache/spamassassin/source/"
+                                  "Mail-SpamAssassin-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0la6s5ilamf9129kyjckcma8cr6fpb6b5f2fb64v7106iy0ckhd0"))))
+    (build-system perl-build-system)
+    (inputs `(("perl-html-parser" ,perl-html-parser)
+              ("perl-net-dns" ,perl-net-dns)
+              ("perl-netaddr-ip" ,perl-netaddr-ip)
+              ("perl-digest-sha1" ,perl-digest-sha1)
+              ("perl-db-file" ,perl-db-file)
+              ("perl-mail-spf" ,perl-mail-spf)
+              ("perl-geo-ip" ,perl-geo-ip)
+              ("perl-net-cidr-lite" ,perl-net-cidr-lite)
+              ; FIXME find and re-add ("perl-razor2" ,perl-razor2)
+              ("perl-io-socket-inet6" ,perl-io-socket-inet6)
+              ("perl-io-socket-ssl" ,perl-io-socket-ssl)
+              ;; FIXME fix and re-add ("perl-mail-dkim" ,perl-mail-dkim)
+              ("perl-dbi" ,perl-dbi)
+              ; FIXME find and re-add ("perl-lwp-useragent" ,perl-lwp-useragent)
+              ("perl-http-date" ,perl-http-date)
+              ("perl-encode-detect" ,perl-encode-detect)
+              ("perl-net-patricia" ,perl-net-patricia)
+              ; FIXME find and re-add ("perl-net-dns-nameserver" ,perl-net-dns-nameserver)
+))
+    ; TODO optional binaries: gpg wget curl fetch
+    (synopsis "Spam Filter")
+    (description "SpamAssassin is a complete spam checker, featuring local tests, remote
+tests, Bayesian filtering, and more.")
+    (home-page "http://spamassassin.apache.org/")
+    (license asl2.0)))