gnu: Add procmail.

* gnu/packages/patches/procmail-ambiguous-getline-debian.patch: New file.
 * gnu-system.am (dist_patch_DATA): Add it.
 * gnu/packages/mail.scm (procmail): New variable.

Signed-off-by: Leo Famulari <leo@famulari.name>
This commit is contained in:
Lukas Gradl 2016-02-29 22:07:35 -06:00 committed by Leo Famulari
parent 94d609aba8
commit e90819c40a
3 changed files with 115 additions and 0 deletions

View File

@ -663,6 +663,7 @@ dist_patch_DATA = \
gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ gnu/packages/patches/plotutils-libpng-jmpbuf.patch \
gnu/packages/patches/polkit-drop-test.patch \ gnu/packages/patches/polkit-drop-test.patch \
gnu/packages/patches/portaudio-audacity-compat.patch \ gnu/packages/patches/portaudio-audacity-compat.patch \
gnu/packages/patches/procmail-ambiguous-getline-debian.patch \
gnu/packages/patches/pt-scotch-build-parallelism.patch \ gnu/packages/patches/pt-scotch-build-parallelism.patch \
gnu/packages/patches/pulseaudio-fix-mult-test.patch \ gnu/packages/patches/pulseaudio-fix-mult-test.patch \
gnu/packages/patches/pulseaudio-longer-test-timeout.patch \ gnu/packages/patches/pulseaudio-longer-test-timeout.patch \

View File

@ -12,6 +12,7 @@
;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org> ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
;;; Copyright © 2016 Al McElrath <hello@yrns.org> ;;; Copyright © 2016 Al McElrath <hello@yrns.org>
;;; Copyright © 2016 Leo Famulari <leo@famulari.name> ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -1098,4 +1099,56 @@ deliver it in various ways.")
;; with that information. ;; with that information.
(non-copyleft "https://github.com/nicm/fdm/blob/master/command.c")))) (non-copyleft "https://github.com/nicm/fdm/blob/master/command.c"))))
(define-public procmail
(package
(name "procmail")
(version "3.22")
(source
(origin
(method url-fetch)
(uri (string-append
"ftp://ftp.fu-berlin.de/pub/unix/mail/procmail/procmail-"
version
".tar.gz"))
(sha256
(base32
"05z1c803n5cppkcq99vkyd5myff904lf9sdgynfqngfk9nrpaz08"))
;; The following patch fixes an ambiguous definition of
;; getline() in formail.c. The patch is provided by Debian as
;; patch 24.
(patches
(list
(search-patch "procmail-ambiguous-getline-debian.patch")))))
(arguments
`(#:phases (modify-phases %standard-phases
(replace 'configure
(lambda _
(substitute* "Makefile"
(("/bin/sh")
(which "sh"))
(("/usr")
(assoc-ref %outputs "out"))
(("/bin/rm")
(which "rm")))
#t)))
#:tests? #f)) ;; There are no tests indicating a successful
;; build. Some tests of basic locking mechanisms provided by the
;; filesystem are performed during 'make install'. However, these
;; are performed before the actual build process.
(build-system gnu-build-system)
(inputs `(("glibc" ,glibc)
("exim" ,exim)))
(home-page "http://www.procmail.org/")
(synopsis "Versatile mail delivery agent (MDA)")
(description "Procmail is a mail delivery agent (MDA) featuring support
for a variety of mailbox formats such as mbox, mh and maildir. Incoming mail
can be sorted into separate files/directories and arbitrary commands can be
executed on mail arrival. Procmail is considered stable, but is no longer
maintained.")
(license gpl2+))) ;; procmail allows to choose the
;; nonfree Artistic License 1.0
;; as alternative to the GPL2+.
;; This option is not listed here.
;;; mail.scm ends here ;;; mail.scm ends here

View File

@ -0,0 +1,61 @@
Rename getline() to procmail_getline() to avoid namespace clash with
POSIX getline(). Fixes FTBFS.
Copied from Debian:
http://sources.debian.net/src/procmail/3.22-24/debian/patches/24/
References:
http://bugs.debian.org/549426
--- a/src/fields.c
+++ b/src/fields.c
@@ -110,16 +110,16 @@
/* try and append one valid field to rdheader from stdin */
int readhead P((void))
{ int idlen;
- getline();
+ procmail_getline();
if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */
return 0;
if(idlen==STRLEN(FROM)&&eqFrom_(buf)) /* it's a From_ line */
{ if(rdheader)
return 0; /* the From_ line was a fake! */
- for(;buflast=='>';getline()); /* gather continued >From_ lines */
+ for(;buflast=='>';procmail_getline()); /* gather continued >From_ lines */
}
else
- for(;;getline()) /* get the rest of the continued field */
+ for(;;procmail_getline()) /* get the rest of the continued field */
{ switch(buflast) /* will this line be continued? */
{ case ' ':case '\t': /* yep, it sure is */
continue;
--- a/src/formail.c
+++ b/src/formail.c
@@ -819,7 +819,7 @@
{ if(split) /* gobble up the next start separator */
{ buffilled=0;
#ifdef sMAILBOX_SEPARATOR
- getline();buffilled=0; /* but only if it's defined */
+ procmail_getline();buffilled=0; /* but only if it's defined */
#endif
if(buflast!=EOF) /* if any */
goto splitit;
--- a/src/formisc.c
+++ b/src/formisc.c
@@ -115,7 +115,7 @@
buf[buffilled++]=c;
}
-int getline P((void)) /* read a newline-terminated line */
+int procmail_getline P((void)) /* read a newline-terminated line */
{ if(buflast==EOF) /* at the end of our Latin already? */
{ loadchar('\n'); /* fake empty line */
return EOF; /* spread the word */
--- a/src/formisc.h
+++ b/src/formisc.h
@@ -17,4 +17,4 @@
char*
skipwords P((char*start));
int
- getline P((void));
+ procmail_getline P((void));