summaryrefslogtreecommitdiff
path: root/mail-filter/procmail
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /mail-filter/procmail
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'mail-filter/procmail')
-rw-r--r--mail-filter/procmail/Manifest1
-rw-r--r--mail-filter/procmail/files/gentoo-maildir3.diff12
-rw-r--r--mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch70
-rw-r--r--mail-filter/procmail/files/procmail-3.22-interix.patch16
-rw-r--r--mail-filter/procmail/files/procmail-comsat-segfault.diff20
-rw-r--r--mail-filter/procmail/files/procmail-lazy-bindings.diff16
-rw-r--r--mail-filter/procmail/files/procmail-maxprocs-fix.diff11
-rw-r--r--mail-filter/procmail/files/procmail-pipealloc.diff21
-rw-r--r--mail-filter/procmail/files/procmail-prefix.patch155
-rw-r--r--mail-filter/procmail/metadata.xml5
-rw-r--r--mail-filter/procmail/procmail-3.22-r10.ebuild111
11 files changed, 438 insertions, 0 deletions
diff --git a/mail-filter/procmail/Manifest b/mail-filter/procmail/Manifest
new file mode 100644
index 00000000000..1d4b08fc68b
--- /dev/null
+++ b/mail-filter/procmail/Manifest
@@ -0,0 +1 @@
+DIST procmail-3.22.tar.gz 226817 SHA256 087c75b34dd33d8b9df5afe9e42801c9395f4bf373a784d9bc97153b0062e117 SHA512 3d0658329a55957a8d5741e03b0853b030c4524acef30641663213aa9eefc8264f8cc2b68a00a89e5f9f0f7c916c41a42e1b6c8df562c545ba97d8ab9049a936 WHIRLPOOL f2ad3fae5919caba6a14a004b8ec5f185265fdcc3491b1562804d8c5ce4d2f18dea37c777adefef752f9db7a2bb26aa24b5e2215a455a30138ffa39f09c538db
diff --git a/mail-filter/procmail/files/gentoo-maildir3.diff b/mail-filter/procmail/files/gentoo-maildir3.diff
new file mode 100644
index 00000000000..51dfef64ae8
--- /dev/null
+++ b/mail-filter/procmail/files/gentoo-maildir3.diff
@@ -0,0 +1,12 @@
+--- procmail-3.22/src/authenticate.c.orig 2002-07-26 20:38:52.000000000 -0400
++++ procmail-3.22/src/authenticate.c 2002-07-26 20:57:56.000000000 -0400
+@@ -39,7 +39,7 @@
+ #include "authenticate.h"
+
+ #ifndef MAILSPOOLDIR
+-#define MAILSPOOLDIR "/var/spool/mail/" /* watch the trailing / */
++#define MAILSPOOLDIR "" /* watch the trailing / */
+ #endif
+ #ifndef MAILSPOOLSUFFIX
+ #define MAILSPOOLSUFFIX "" /* suffix to force maildir or MH style */
+
diff --git a/mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch b/mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch
new file mode 100644
index 00000000000..2663bf50118
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch
@@ -0,0 +1,70 @@
+diff -NrU5 procmail-3.22.orig/src/fields.c procmail-3.22/src/fields.c
+--- procmail-3.22.orig/src/fields.c 2009-05-21 18:21:25.000000000 +0200
++++ procmail-3.22/src/fields.c 2009-05-21 18:22:14.000000000 +0200
+@@ -108,20 +108,20 @@
+ extractfield(p);
+ }
+ /* 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;
+ }
+ break;
+diff -NrU5 procmail-3.22.orig/src/formail.c procmail-3.22/src/formail.c
+--- procmail-3.22.orig/src/formail.c 2009-05-21 18:21:25.000000000 +0200
++++ procmail-3.22/src/formail.c 2009-05-21 18:22:14.000000000 +0200
+@@ -817,11 +817,11 @@
+ #ifdef MAILBOX_SEPARATOR
+ if(!strncmp(emboxsep,buf,STRLEN(emboxsep))) /* end of mail? */
+ { 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;
+ break;
+ }
+diff -NrU5 procmail-3.22.orig/src/formisc.c procmail-3.22/src/formisc.c
+--- procmail-3.22.orig/src/formisc.c 2009-05-21 18:21:25.000000000 +0200
++++ procmail-3.22/src/formisc.c 2009-05-21 18:22:14.000000000 +0200
+@@ -113,11 +113,11 @@
+ { if(buffilled==buflen)
+ buf=realloc(buf,buflen+=Bsize);
+ 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 */
+ }
+ loadchar(buflast); /* load leftover into the buffer */
+diff -NrU5 procmail-3.22.orig/src/formisc.h procmail-3.22/src/formisc.h
+--- procmail-3.22.orig/src/formisc.h 2009-05-21 18:21:25.000000000 +0200
++++ procmail-3.22/src/formisc.h 2009-05-21 18:22:14.000000000 +0200
+@@ -15,6 +15,6 @@
+ closemine P((void)),
+ opensink P((void));
+ char*
+ skipwords P((char*start));
+ int
+- getline P((void));
++ procmail_getline P((void));
diff --git a/mail-filter/procmail/files/procmail-3.22-interix.patch b/mail-filter/procmail/files/procmail-3.22-interix.patch
new file mode 100644
index 00000000000..a24c052f3d2
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-3.22-interix.patch
@@ -0,0 +1,16 @@
+diff -ru procmail-3.22.orig/src/setid.c procmail-3.22/src/setid.c
+--- procmail-3.22.orig/src/setid.c 2010-02-04 10:05:43 +0100
++++ procmail-3.22/src/setid.c 2010-02-04 10:11:18 +0100
+@@ -15,7 +15,11 @@
+ return EX_USAGE;
+ }
+ endpwent();
+- if(initgroups(argv[1],p->pw_gid)||setgid(p->pw_gid)||setuid(p->pw_uid))
++ if(
++#ifndef __INTERIX
++ initgroups(argv[1],p->pw_gid)||
++#endif
++ setgid(p->pw_gid)||setuid(p->pw_uid))
+ return EX_OSERR;
+ if(fopen(CHECK_FILE,"r"))
+ { struct stat stbuf;
diff --git a/mail-filter/procmail/files/procmail-comsat-segfault.diff b/mail-filter/procmail/files/procmail-comsat-segfault.diff
new file mode 100644
index 00000000000..e96bb5d94a3
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-comsat-segfault.diff
@@ -0,0 +1,20 @@
+--- src/comsat.c.old 2005-08-17 19:17:20.000000000 +0200
++++ src/comsat.c 2005-08-17 19:18:19.000000000 +0200
+@@ -92,7 +92,7 @@
+ }
+ if(newvalid) /* so far, so good */
+ { int s;
+- if(!*chp) /* no service */
++ if(!chad||!*chp) /* no service */
+ chp=BIFF_serviceport; /* new balls please! */
+ s=strtol(chp,&chad,10);
+ if(chp!=chad) /* the service is not numeric */
+@@ -120,7 +120,7 @@
+ { int s;const char*p;
+ if(!csvalid||!buf) /* is comat on and set to a valid address? */
+ return;
+- if(!*cslgname||strlen(cslgname)+2>linebuf) /* is $LOGNAME bogus? */
++ if(!cslgname||!*cslgname||strlen(cslgname)+2>linebuf) /* is $LOGNAME bogus? */
+ return;
+ if(!(p=folder?folder:cslastf)) /* do we have a folder? */
+ return;
diff --git a/mail-filter/procmail/files/procmail-lazy-bindings.diff b/mail-filter/procmail/files/procmail-lazy-bindings.diff
new file mode 100644
index 00000000000..f1c4221650e
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-lazy-bindings.diff
@@ -0,0 +1,16 @@
+--- src/Makefile.0.old 2005-05-23 10:34:25.000000000 +0200
++++ src/Makefile.0 2005-05-23 10:34:52.000000000 +0200
+@@ -18,11 +18,11 @@
+ .PRECIOUS: Makefile
+
+ procmail: procmail.$(O) $(PM_OBJ) setid
+- $(CC) $(CFLAGS) $@.$(O) $(PM_OBJ) -o $@ $(LDFLAGS)
++ $(CC) $(CFLAGS) $@.$(O) $(PM_OBJ) -o $@ -Wl,-z,now $(LDFLAGS)
+ @test -z "$(STRIP)" || ( echo $(STRIP) $@; $(STRIP) $@ )
+
+ lockfile: lockfile.$(O) $(LF_OBJ)
+- $(CC) $(CFLAGS) $@.$(O) $(LF_OBJ) -o $@ $(LDFLAGS)
++ $(CC) $(CFLAGS) $@.$(O) $(LF_OBJ) -o $@ -Wl,-z,now $(LDFLAGS)
+ @test -z "$(STRIP)" || ( echo $(STRIP) $@; $(STRIP) $@ )
+
+ formail: formail.$(O) $(FM_OBJ)
diff --git a/mail-filter/procmail/files/procmail-maxprocs-fix.diff b/mail-filter/procmail/files/procmail-maxprocs-fix.diff
new file mode 100644
index 00000000000..c78b000a8b9
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-maxprocs-fix.diff
@@ -0,0 +1,11 @@
+--- src/formisc.c.orig 2006-01-22 00:35:30.000000000 -0800
++++ src/formisc.c 2006-01-22 00:35:55.000000000 -0800
+@@ -183,7 +183,7 @@
+ retval=excode;
+ } /* reap some children */
+ while(childlimit&&children>=childlimit||(child=fork())==-1&&children)
+- for(--children;(excode=waitfor((pid_t)0))!=NO_PROCESS;)
++ for(;(excode=waitfor((pid_t)0))!=NO_PROCESS;)
+ { if(excode!=EXIT_SUCCESS)
+ retval=excode;
+ if(--children<=maxchild)
diff --git a/mail-filter/procmail/files/procmail-pipealloc.diff b/mail-filter/procmail/files/procmail-pipealloc.diff
new file mode 100644
index 00000000000..fdd5cc97328
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-pipealloc.diff
@@ -0,0 +1,21 @@
+diff -rc procmail-3.22/src/pipes.c procmail-3.22-fixed/src/pipes.c
+*** procmail-3.22/src/pipes.c Tue Sep 11 00:58:44 2001
+--- procmail-3.22-fixed/src/pipes.c Wed Nov 21 23:53:39 2007
+***************
+*** 194,200 ****
+ makeblock(&temp,Stdfilled);
+ tmemmove(temp.p,Stdout,Stdfilled);
+ readdyn(&temp,&Stdfilled,Stdfilled+backlen+1);
+! Stdout=realloc(Stdout,&Stdfilled+1);
+ tmemmove(Stdout,temp.p,Stdfilled+1);
+ freeblock(&temp);
+ retStdout(Stdout,pwait&&pipw,!backblock);
+--- 194,200 ----
+ makeblock(&temp,Stdfilled);
+ tmemmove(temp.p,Stdout,Stdfilled);
+ readdyn(&temp,&Stdfilled,Stdfilled+backlen+1);
+! Stdout=realloc(Stdout,Stdfilled+1);
+ tmemmove(Stdout,temp.p,Stdfilled+1);
+ freeblock(&temp);
+ retStdout(Stdout,pwait&&pipw,!backblock);
+
diff --git a/mail-filter/procmail/files/procmail-prefix.patch b/mail-filter/procmail/files/procmail-prefix.patch
new file mode 100644
index 00000000000..6063b92db2b
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-prefix.patch
@@ -0,0 +1,155 @@
+--- config.h~ 2007-10-03 17:55:24 +0200
++++ config.h 2007-10-03 18:01:38 +0200
+@@ -116,11 +116,11 @@
+ is not found, maildelivery will proceed as normal to the default
+ system mailbox. This also must be an absolute path */
+
+-#define ETCRC "/etc/procmailrc" /* optional global procmailrc startup
++#define ETCRC "@GENTOO_PORTAGE_EPREFIX@/etc/procmailrc" /* optional global procmailrc startup
+ file (will only be read if procmail
+ is started with no rcfile on the command line). */
+
+-#define ETCRCS "/etc/procmailrcs/" /* optional trusted path prefix for
++#define ETCRCS "@GENTOO_PORTAGE_EPREFIX@/etc/procmailrcs/" /* optional trusted path prefix for
+ rcfiles which will be executed with
+ the uid of the owner of the rcfile (this only happens if procmail is
+ called with the -m option, without variable assignments on the command
+@@ -168,7 +168,7 @@
+ #define INEFFICIENTrealloc /* don't pussy-foot around */
+ #endif
+ #define MAXinMEM (1024*1024) /* when to switch to mmap() */
+-#define MMAP_DIR "/var/spool/procmail/" /* where to put */
++#define MMAP_DIR "@GENTOO_PORTAGE_EPREFIX@/var/spool/procmail/" /* where to put */
+ #endif /* the files */
+ #define MINlogbuf 81 /* fit an entire line */
+ #define MAXlogbuf 1000 /* in case someone abuses LOG */
+@@ -220,8 +220,8 @@
+ #define DEFcomsat offvalue /* when an rcfile has been specified */
+ /* set to either "offvalue" or "empty" */
+
+-#define BinSh "/bin/sh"
+-#define ROOT_DIR "/"
++#define BinSh "@GENTOO_PORTAGE_EPREFIX@/bin/sh"
++#define ROOT_DIR "@GENTOO_PORTAGE_EPREFIX@"
+ #define DEAD_LETTER "/tmp/dead.letter" /* $ORGMAIL if no passwd entry */
+ #define DevNull "/dev/null"
+ #define NICE_RANGE 39 /* maximal nice difference */
+--- Makefile~ 2007-10-03 18:07:51 +0200
++++ Makefile 2007-10-03 18:10:07 +0200
+@@ -2,7 +2,7 @@
+
+ # BASENAME should point to where the whole lot will be installed
+ # change BASENAME to your home directory if need be
+-BASENAME = /usr
++BASENAME = @GENTOO_PORTAGE_EPREFIX@/usr
+ # For display in the man pages
+ VISIBLE_BASENAME= $(BASENAME)
+
+@@ -79,7 +79,7 @@
+ # -lresolv # not really needed, is it?
+
+ # Informal list of directories where we look for the libraries in SEARCHLIBS
+-LIBPATHS=/lib /usr/lib /usr/local/lib
++LIBPATHS=@GENTOO_PORTAGE_EPREFIX@/lib @GENTOO_PORTAGE_EPREFIX@/usr/lib
+
+ GCC_WARNINGS = -O2 -pedantic -Wreturn-type -Wunused -Wformat -Wtraditional \
+ -Wpointer-arith -Wconversion -Waggregate-return \
+@@ -97,10 +97,10 @@
+ ####CC = cc # gcc
+ # object file extension
+ O = o
+-RM = /bin/rm -f
++RM = @GENTOO_PORTAGE_EPREFIX@/bin/rm -f
+ MV = mv -f
+ LN = ln
+-BSHELL = /bin/sh
++BSHELL = @GENTOO_PORTAGE_EPREFIX@/bin/sh
+ INSTALL = cp
+ DEVNULL = /dev/null
+ STRIP = strip
+@@ -112,7 +112,7 @@
+ MANS5S = procmailrc procmailsc procmailex
+
+ # Possible locations for the sendmail.cf file
+-SENDMAILCFS = /etc/mail/sendmail.cf /etc/sendmail.cf /usr/lib/sendmail.cf
++SENDMAILCFS = @GENTOO_PORTAGE_EPREFIX@/etc/mail/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/usr/lib/sendmail.cf
+
+ # Makefile.1 - mark, don't (re)move this, a sed script needs it
+
+--- src/autoconf~ 2001-09-11 06:55:46 +0200
++++ src/autoconf 2007-10-03 19:17:51 +0200
+@@ -1,4 +1,4 @@
+-#! /bin/sh
++#! @GENTOO_PORTAGE_EPREFIX@/bin/sh
+ :
+ # Copyright (c) 1990-1997, S.R. van den Berg, The Netherlands
+ # $Id$
+@@ -1416,20 +1416,10 @@
+
+ found=no
+
+-for a in /var/spool/mail /usr/spool/mail /var/mail /usr/mail /spool/mail
+-do
+- test -d $a -a $found != yes &&
+- echo '#define MAILSPOOLDIR "'$a'/"' >>$ACONF && found=yes
+-done
+-if test $found != yes
+-then
+- echo '#define MAILSPOOLDIR "/var/spool/mail/"' >>$ACONF
+- echo Could not find the system-mailbox directory, supplied default.
+-fi
++echo '#define MAILSPOOLDIR "@GENTOO_PORTAGE_EPREFIX@/var/spool/mail/"' >>$ACONF
+
+ cat >lookfor <<HERE
+-for a in /usr/sbin /usr/lib /lib /usr/etc /etc /usr/bin /bin /usr/local/bin \
+- /usr/lbin /usr/local/lib /usr/local /usr/.lib /local/bin /sbin
++for a in @GENTOO_PORTAGE_EPREFIX@/usr/sbin
+ do
+ if test -f "\$a/\$1"
+ then
+@@ -1458,7 +1448,7 @@
+ grep '^#define SENDMAIL ".*/sendmail"' $ACONF >$DEVNULL ||
+ echo "#define DEFflagsendmail \"\"" >>$ACONF
+
+-a=/tmp/_chowntst.$$
++a=@GENTOO_PORTAGE_EPREFIX@/tmp/_chowntst.$$
+ $RM -r $a
+ OLDTESTDIRS="$a $OLDTESTDIRS"
+ mkdir $a
+@@ -1466,19 +1456,18 @@
+
+ _autotst $a/__ $a/__/__ 4 >>$ACONF
+
+-cat /usr/lib/sendmail.cf /etc/sendmail.cf /etc/mail/sendmail.cf 2>$DEVNULL |
++cat @GENTOO_PORTAGE_EPREFIX@/usr/lib/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/mail/sendmail.cf 2>$DEVNULL |
+ grep 'Mlocal.*procmail' >$DEVNULL ||
+ echo '#define CF_no_procmail_yet' >>$ACONF
+
+-cat /usr/lib/sendmail.cf /etc/sendmail.cf /etc/mail/sendmail.cf 2>$DEVNULL |
++cat @GENTOO_PORTAGE_EPREFIX@/usr/lib/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/mail/sendmail.cf 2>$DEVNULL |
+ grep '^V' >$DEVNULL ||
+ echo '#define buggy_SENDMAIL' >>$ACONF
+
+-lpath='/bin'
+-bins="/bin"
++lpath='@GENTOO_PORTAGE_EPREFIX@/bin'
++bins='@GENTOO_PORTAGE_EPREFIX@/bin'
+
+-for newd in /usr/bin /usr/ucb /usr/5bin $BINDIR /local/bin /usr/local/bin \
+- /global/bin /usr/bin/X11 /usr/X*/bin
++for newd in @GENTOO_PORTAGE_EPREFIX@/usr/bin
+ do
+ if test -d $newd
+ then
+--- src/recommend.c~ 2007-10-03 19:10:01 +0200
++++ src/recommend.c 2007-10-03 19:11:04 +0200
+@@ -9,8 +9,7 @@
+
+ char mailspooldir[]=MAILSPOOLDIR;
+ const char dirsep[]=DIRSEP,
+- *const checkf[]={"/bin/mail","/bin/lmail","/usr/lib/sendmail",
+- "/usr/lib/smail",0};
++ *const checkf[]={"@GENTOO_PORTAGE_EPREFIX@/usr/bin/sendmail",0};
+
+ int main(argc,argv)const int argc;const char*const argv[];
+ { struct group*grp;struct stat stbuf;gid_t gid=(gid_t)-1;
diff --git a/mail-filter/procmail/metadata.xml b/mail-filter/procmail/metadata.xml
new file mode 100644
index 00000000000..51f94e3fbe0
--- /dev/null
+++ b/mail-filter/procmail/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+</pkgmetadata>
diff --git a/mail-filter/procmail/procmail-3.22-r10.ebuild b/mail-filter/procmail/procmail-3.22-r10.ebuild
new file mode 100644
index 00000000000..9f423490bcc
--- /dev/null
+++ b/mail-filter/procmail/procmail-3.22-r10.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs prefix
+
+DESCRIPTION="Mail delivery agent/filter"
+HOMEPAGE="http://www.procmail.org/"
+SRC_URI="http://www.procmail.org/${P}.tar.gz"
+
+LICENSE="|| ( Artistic GPL-2 )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x64-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
+IUSE="mbox selinux"
+
+DEPEND="virtual/mta"
+RDEPEND="selinux? ( sec-policy/selinux-procmail )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # disable flock, using both fcntl and flock style locking
+ # doesn't work with NFS with 2.6.17+ kernels, bug #156493
+
+ sed -e "s:/\*#define NO_flock_LOCK:#define NO_flock_LOCK:" \
+ -i config.h || die "sed failed"
+
+ if ! use mbox ; then
+ echo "# Use maildir-style mailbox in user's home directory" > "${S}"/procmailrc
+ echo 'DEFAULT=$HOME/.maildir/' >> "${S}"/procmailrc
+ cd "${S}"
+ epatch "${FILESDIR}/gentoo-maildir3.diff"
+ else
+ echo '# Use mbox-style mailbox in /var/spool/mail' > "${S}"/procmailrc
+ echo 'DEFAULT=${EPREFIX}/var/spool/mail/$LOGNAME' >> "${S}"/procmailrc
+ fi
+
+ # Do not use lazy bindings on lockfile and procmail
+ if [[ ${CHOST} != *-darwin* && ${CHOST} != *-interix* ]]; then
+ epatch "${FILESDIR}/${PN}-lazy-bindings.diff"
+ fi
+
+ # Fix for bug #102340
+ epatch "${FILESDIR}/${PN}-comsat-segfault.diff"
+
+ # Fix for bug #119890
+ epatch "${FILESDIR}/${PN}-maxprocs-fix.diff"
+
+ # Prefixify config.h
+ epatch "${FILESDIR}"/${PN}-prefix.patch
+ eprefixify config.h Makefile src/autoconf src/recommend.c
+
+ # Fix for bug #200006
+ epatch "${FILESDIR}/${PN}-pipealloc.diff"
+
+ # Fix for bug #270551
+ epatch "${FILESDIR}/${PN}-3.22-glibc-2.10.patch"
+
+ # Fix for x86-interix - doesn't have initgroups
+ epatch "${FILESDIR}"/${P}-interix.patch
+}
+
+src_compile() {
+ # -finline-functions (implied by -O3) leaves strstr() in an infinite loop.
+ # To work around this, we append -fno-inline-functions to CFLAGS
+ # Since GCC 4.7 we also need -fno-ipa-cp-clone (bug #466552)
+ append-flags -fno-inline-functions -fno-ipa-cp-clone
+
+ sed -e "s:CFLAGS0 = -O:CFLAGS0 = ${CFLAGS}:" \
+ -e "s:LDFLAGS0= -s:LDFLAGS0 = ${LDFLAGS}:" \
+ -e "s:LOCKINGTEST=__defaults__:#LOCKINGTEST=__defaults__:" \
+ -e "s:#LOCKINGTEST=/tmp:LOCKINGTEST=/tmp:" \
+ -i Makefile || die "sed failed"
+
+ emake CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ cd "${S}"/new
+ insinto /usr/bin
+ insopts -m 6755
+ doins procmail || die
+
+ doins lockfile || die
+ fowners root:mail /usr/bin/lockfile
+ fperms 2755 /usr/bin/lockfile
+
+ dobin formail mailstat || die
+ insopts -m 0644
+
+ doman *.1 *.5
+
+ cd "${S}"
+ dodoc FAQ FEATURES HISTORY INSTALL KNOWN_BUGS README
+
+ insinto /etc
+ doins procmailrc || die
+
+ docinto examples
+ dodoc examples/*
+}
+
+pkg_postinst() {
+ if ! use mbox ; then
+ elog "Starting with mail-filter/procmail-3.22-r9 you'll need to ensure"
+ elog "that you configure a mail storage location using DEFAULT in"
+ elog "/etc/procmailrc, for example:"
+ elog "\tDEFAULT=\$HOME/.maildir/"
+ fi
+}