From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: Re: [PATCH] Add procmail Date: Wed, 2 Mar 2016 20:46:05 -0500 Message-ID: <20160303014605.GA14850@jasmine> References: <87io1aqzrd.wl-lgradl@openmailbox.org> <20160229195019.GA21923@jasmine> <20160301044111.GB607@serenity.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abILD-0005H8-JB for guix-devel@gnu.org; Wed, 02 Mar 2016 20:46:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abIL9-0002um-Ff for guix-devel@gnu.org; Wed, 02 Mar 2016 20:46:11 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:53184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abIL9-0002ui-Aa for guix-devel@gnu.org; Wed, 02 Mar 2016 20:46:07 -0500 Content-Disposition: inline In-Reply-To: <20160301044111.GB607@serenity.lan> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Lukas Gradl Cc: guix-devel@gnu.org On Mon, Feb 29, 2016 at 10:41:12PM -0600, Lukas Gradl wrote: [...] > > > * gnu/packages/patches/procmail-ambiguous-getline-debian.patch: New file > > > * gnu-system.am: Add patch > > > * gnu/packages/mail.scm (procmail): New variable [...] > A new patch is attached. Thanks for the review! I added a copyright line for you and some context for the patch, and pushed as e90819c40af. Thank you! > > Best, > Lukas > > > > > > --- > > > gnu-system.am | 1 + > > > gnu/packages/mail.scm | 50 +++++++++++++++++++++ > > > .../procmail-ambiguous-getline-debian.patch | 52 ++++++++++++++++++++++ > > > 3 files changed, 103 insertions(+) > > > create mode 100644 gnu/packages/patches/procmail-ambiguous-getline-debian.patch > > > > > > diff --git a/gnu-system.am b/gnu-system.am > > > index 7727bad..c484031 100644 > > > --- a/gnu-system.am > > > +++ b/gnu-system.am > > > @@ -658,6 +658,7 @@ dist_patch_DATA = \ > > > gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ > > > gnu/packages/patches/polkit-drop-test.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/pulseaudio-fix-mult-test.patch \ > > > gnu/packages/patches/pulseaudio-longer-test-timeout.patch \ > > > diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm > > > index 5a9f420..31b23a1 100644 > > > --- a/gnu/packages/mail.scm > > > +++ b/gnu/packages/mail.scm > > > @@ -1085,4 +1085,54 @@ deliver it in various ways.") > > > ;; with that information. > > > (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 (alist-replace > > > + 'configure > > > + (lambda _ > > > + (substitute* "Makefile" > > > + (("/bin/sh") > > > + (which "sh"))) > > > + (substitute* "Makefile" > > > + (("/usr") > > > + (assoc-ref %outputs "out"))) > > > + (substitute* "Makefile" > > > + (("/bin/rm") > > > + (which "rm")))) > > > + %standard-phases) > > > + #:tests? #f)) ; no tests > > > + (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 > > > diff --git a/gnu/packages/patches/procmail-ambiguous-getline-debian.patch b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch > > > new file mode 100644 > > > index 0000000..63bf258 > > > --- /dev/null > > > +++ b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch > > > @@ -0,0 +1,52 @@ > > > +--- 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)); > > > -- > > > 2.6.3 > > > > > > > -- > Lukas Gradl > Email: lgradl@openmailbox.org > fingerprint: > 2F07 6B84 2704 B631 B8D3 6C0E A49D 050F AC97 11C1 > You won't find me on Facebook > From 959dbec07bb2509c9c997ac02cef55bedc53e005 Mon Sep 17 00:00:00 2001 > From: Lukas Gradl > Date: Mon, 29 Feb 2016 22:07:35 -0600 > Subject: [PATCH] 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. > --- > gnu-system.am | 1 + > gnu/packages/mail.scm | 52 ++++++++++++++++++++++ > .../procmail-ambiguous-getline-debian.patch | 52 ++++++++++++++++++++++ > 3 files changed, 105 insertions(+) > create mode 100644 gnu/packages/patches/procmail-ambiguous-getline-debian.patch > > diff --git a/gnu-system.am b/gnu-system.am > index 7727bad..c484031 100644 > --- a/gnu-system.am > +++ b/gnu-system.am > @@ -658,6 +658,7 @@ dist_patch_DATA = \ > gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ > gnu/packages/patches/polkit-drop-test.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/pulseaudio-fix-mult-test.patch \ > gnu/packages/patches/pulseaudio-longer-test-timeout.patch \ > diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm > index 5a9f420..cbb1271 100644 > --- a/gnu/packages/mail.scm > +++ b/gnu/packages/mail.scm > @@ -1085,4 +1085,56 @@ deliver it in various ways.") > ;; with that information. > (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 > + > diff --git a/gnu/packages/patches/procmail-ambiguous-getline-debian.patch b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch > new file mode 100644 > index 0000000..63bf258 > --- /dev/null > +++ b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch > @@ -0,0 +1,52 @@ > +--- 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)); > -- > 2.6.3 >