summaryrefslogtreecommitdiff
path: root/net-mail/mpack
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-mail/mpack
reinit the tree, so we can have metadata
Diffstat (limited to 'net-mail/mpack')
-rw-r--r--net-mail/mpack/Manifest14
-rw-r--r--net-mail/mpack/files/mpack-1.6-clang.patch11
-rw-r--r--net-mail/mpack/files/mpack-1.6-compile.patch129
-rw-r--r--net-mail/mpack/files/mpack-1.6-cve-2011-4919.patch28
-rw-r--r--net-mail/mpack/files/mpack-1.6-filenames.patch30
-rw-r--r--net-mail/mpack/files/mpack-1.6-gentoo.patch69
-rw-r--r--net-mail/mpack/files/mpack-1.6-munpack.patch55
-rw-r--r--net-mail/mpack/files/mpack-1.6-paths.patch95
-rw-r--r--net-mail/mpack/files/mpack-1.6-usage.patch25
-rw-r--r--net-mail/mpack/metadata.xml8
-rw-r--r--net-mail/mpack/mpack-1.6-r3.ebuild37
-rw-r--r--net-mail/mpack/mpack-1.6-r4.ebuild38
12 files changed, 539 insertions, 0 deletions
diff --git a/net-mail/mpack/Manifest b/net-mail/mpack/Manifest
new file mode 100644
index 000000000000..b3242aee205f
--- /dev/null
+++ b/net-mail/mpack/Manifest
@@ -0,0 +1,14 @@
+AUX mpack-1.6-clang.patch 205 SHA256 56158e8e97bf8b6eeb9fe193447972e0e25e1e88b970e3264053fd63565beff0 SHA512 194b280dfd1b6267ee383be97aa88080ae1d78675741486280357b807c5dd4e75ef3a110f4143b70a8fa628a42d38bde98ea6b72a72eea4ddaa46cdb3d3315a0 WHIRLPOOL c03150b23416b95c260504e9eb69770b498e347e2a8218cc035dfa5f6126ffc6d1b8a405994ac27a73e15e5f92ba96d570a845d2a9743ee982e7d7e57e9b470c
+AUX mpack-1.6-compile.patch 2652 SHA256 190b6a97588203d3e1527b0aa5aa68137e80ca27ce8211bdd135cca2ffd1e2bb SHA512 60396619da56d1166c27d6307b7d3437e928311eb2a3120f7062ef9f52bedd729a80fef25e657897b2219af0b4d90633a0827335dd4cc0f5cf8585377ca7cd2d WHIRLPOOL 8d54549f170dd167f9b003dde5ccc1b4753ffa991cc5c95340ab12d6b0cb2966ed743b418904f940d0066a2d8a610acea2daded6017d11f40dfd0e2ad6c55841
+AUX mpack-1.6-cve-2011-4919.patch 706 SHA256 ff86494abdee7d4868656bf525a018ccfbd479cde75faf10e468e1c0c8f1fb0c SHA512 82ddbc6af292c2f695fa45572ce66705ab4e272322bdf4d47b2078e934a1d4e822808b3c174560b3d315431d4fcd095809eb4b4f80958c2dd8c7be955f7a1740 WHIRLPOOL 30778176b171120379fd7cfa7e63a294891f1790fc3e1a694821663d8172b2e14ebd6f691211bf39d6266e99aa18d43009e601108706bb3e6e991fcb7d7279bb
+AUX mpack-1.6-filenames.patch 882 SHA256 1aad17f5b71a36a59edd1a5ee32257477534c7a0986032801990e6bd58e3d339 SHA512 ec36e1f4775ec5063fc7e8e10b75d0f47e2a7b675b62967726abe6283d9bc3885a8376ea9b264b837959bba65eaee6d92739afbab8237b2eb4a4bd2eda9f0e60 WHIRLPOOL 6f2aa298aaaa7491316ac27d70c491524ce9207bb63ebcf79fbd6219c592e43758d96c962ea53506707aa5598d63f2822c2047d3e0f8612470585d35081d2747
+AUX mpack-1.6-gentoo.patch 2022 SHA256 7d00e9be884b8c672820b5801b46bc708f143cc93d356828044f9c1370b58feb SHA512 543a073bf034914a9484713ca0cb838fd4a23b60b61997f358aaf782d9485f188382dc502f2f1bcab0f48e322fe1c5be15f4120aeeccafd981a1abbb695c0616 WHIRLPOOL 02e907683aeb8a066c82d440047aefdeb1cc5a60862f29fb588cdfa64711371e82a84d0390f685b9a6f20cd3dd25a1c1eef77460a943519aa1ff9ce515ec4b3a
+AUX mpack-1.6-munpack.patch 1341 SHA256 865c4cbeaf2f90a0e338a5ef4a9e371936c4bb5aa6a9f48947fde6ef2e39a2ed SHA512 b9a895798d3ffb0c1dc7e0d67cabef1570f64ee02175dd6082f9581caa08f759a4d4488d329433e1f2c529b19df32fe645e08fc079a1aa667ff0f9c38c1e51a1 WHIRLPOOL 6445d4e006a4472fe7f45ab46359c1c3b1cc34027b12c3d80bfcf2208b89e85ca4cb5fb672342f8a64bc67546ad5e1065106018c5a218994ad31a60ab90cc7c5
+AUX mpack-1.6-paths.patch 2729 SHA256 534e3e26d91bd72f3e476ccc09c3091d87b8525f5a521630b2edfe29b323ed42 SHA512 918a1f25e5f224d34f2e1b44aae7683b5d31b384d6e124de88c1fe661e42ef5d88810d7380bc4e298a2d7efe152f0da5cfc3b3028c65a3f2a337511d3384fcf7 WHIRLPOOL 8ae4a9e2460206d1dec21f61d3cae2422ed18d59453adbec7b6edf0be5ea9ea34ecc6a8b59a9a21784abc26d87132807ff92cd0900097e5c6a462ab23b0fe093
+AUX mpack-1.6-usage.patch 721 SHA256 797dd899449256e0a1c029bc8402f86779b71aa58611c5f993875dd235ba153d SHA512 e07f72e6a0d037f788829904050bbee9f1c8c722a6b363b8a95ab012dda99b952e36bd7a9772a63d22ff4da34fdd44ead8d42db510e8c340f3410b3cd0d52b1a WHIRLPOOL c4a7dbb80bf9983f21d3a010f70448a42c84feb901ab988b683f4de6ef280699dfb4f458b1d688081f424986fd09630fbbca889beb29210dbe1f4f1906f471ba
+DIST mpack-1.6.tar.gz 179850 SHA256 274108bb3a39982a4efc14fb3a65298e66c8e71367c3dabf49338162d207a94c SHA512 9bff0d2753d78288e428a20c8cbb4596bd9862de4da7f42176731ce5fd459b15883d758f9b1ec7d4e1281cc1aeaaa046cec54aeb0997a7ffed74de07edd84714 WHIRLPOOL 322e880e02ca67a18bfaab751f91298fdb9629e8d732b2ded37c8bc921897c6eb1a3b075a80d959ea52122e0e13fcb8967bccf47abaa94311fab2268e57a4a90
+EBUILD mpack-1.6-r3.ebuild 891 SHA256 4415f1894abdb299e4dd4786e086ade09c63f7d69c0b1a1336d768963253a7c3 SHA512 30e892df7523284b1b800b36608b404a41e0aeff496dbd2fbdb7a638de0be52214a00e9be1a0256e877527fd3ba63d296f4968a7033445136abbaf647f310970 WHIRLPOOL 12ebdcda4d14388be6cc82aa1c43504aee0d385ec096233c45b2323e1ad66846f6428399cdf07f81133bf662e03ae86a99b3c317b4a1e5f9755a6ebbc99b16d9
+EBUILD mpack-1.6-r4.ebuild 847 SHA256 69d99495d12d193ffc1a6761855703e11f47016bb5c01d6b82406a971acc20c0 SHA512 8f7dfee7130a942478bf19f73ec75ea397e29adf5b54e3e4e493cb38855081e92d227c20279317e35896919e54e56d2c84b3e83158b044a3875b5c8856a4c2db WHIRLPOOL fc3cf8f48e92b6224a60e4f2272351a8d3a7c9d441dd8a6c67de804ae46edf2ab7bbef3c3683619e051d6d96b4ad2e48b24d5db02b2b0e337d02e8c63981aa9e
+MISC ChangeLog 2752 SHA256 405b49e6d75bc118e4a0b411ded0596b9f1b9ae2dc67da2ec0feedfa552ca0db SHA512 e28c0a3116726a57eba3882b84d2abb3ad15000184e1b02e635c1c6591e131a671923630f18987184e8c0dcd41cf521666422a396d2b0a3053407a87dd71d1b1 WHIRLPOOL 6954d2e1b471b609025edbe1351431cff04a6feb5f1c427e8f1d348c05a75602a5bf44a86289abf20ef337cedcce4bb56c03c145d165888e660c1c8c75d44cbf
+MISC ChangeLog-2015 4062 SHA256 ff9e3816a5214eae3e41387f465a5823bacaf2a72d2da684c8508bdedf6bec14 SHA512 3c454f7604f50b3bad54e0f8c370627c1854e9ea76f3c817f40fcfbc1b0d538a6c5bb67fb0e333884bb61586271b302fc6c7e074b4129e329477a342c32f3c2b WHIRLPOOL 45fb7f10f6e5173229e87f91444a8c35448842ef5828e049d94a617836b8c953f118885a0ab7b06ae582d9c959080112723aeb237eca92cb256128ea6eea2d28
+MISC metadata.xml 240 SHA256 f0e0bb7a24c4b1ff6b6a8a3e9315245c298499c03fbda429c0f775ec6a5396af SHA512 97824dbce22630efb21e647b55212b7a8a19d8e38b5bf05cb0b8078530bbbaaf4dc91284e2a11beab7dfcfb779df82b87b49d11a746c7a4f6dc71f2fda8942db WHIRLPOOL a7adfcb24489ae67a43a59d8350a70b20874fb03de95681c5b516a741d95422560a433f641de5a7222cf5d3500333e215055ec0cb3844e7abc6d6a836de97357
diff --git a/net-mail/mpack/files/mpack-1.6-clang.patch b/net-mail/mpack/files/mpack-1.6-clang.patch
new file mode 100644
index 000000000000..fc21d170af5f
--- /dev/null
+++ b/net-mail/mpack/files/mpack-1.6-clang.patch
@@ -0,0 +1,11 @@
+--- umpack-1.6/udecode.c 2003-07-21 20:46:37.000000000 +0000
++++ mpack-1.6/uudecode.c 2014-04-19 10:04:19.000000000 +0000
+@@ -845,7 +845,7 @@
+ }
+ line += 4;
+ }
+- return;
++ return 0;
+ }
+
+
diff --git a/net-mail/mpack/files/mpack-1.6-compile.patch b/net-mail/mpack/files/mpack-1.6-compile.patch
new file mode 100644
index 000000000000..570319cabe55
--- /dev/null
+++ b/net-mail/mpack/files/mpack-1.6-compile.patch
@@ -0,0 +1,129 @@
+From a01468c1734129595355af0815d4577af4e265cc Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Wed, 7 Dec 2011 23:22:55 +0100
+Subject: [PATCH] Add missing includes, remove conflicting prototypes
+
+---
+ decode.c | 1 +
+ encode.c | 1 +
+ magic.c | 1 +
+ part.c | 1 +
+ unixos.c | 5 +----
+ unixpk.c | 2 ++
+ unixpk.o | Bin 12000 -> 12016 bytes
+ unixunpk.c | 1 +
+ xmalloc.c | 2 +-
+ 9 files changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/decode.c b/decode.c
+index c96918f..8b8df56 100644
+--- a/decode.c
++++ b/decode.c
+@@ -28,6 +28,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
++#include <stdlib.h>
+ #include "xmalloc.h"
+ #include "common.h"
+ #include "part.h"
+diff --git a/encode.c b/encode.c
+index 0ba3934..1377cf8 100644
+--- a/encode.c
++++ b/encode.c
+@@ -24,6 +24,7 @@
+ */
+ #include <stdio.h>
+ #include <string.h>
++#include <stdlib.h>
+
+ extern char *magic_look(FILE *infile);
+ extern char *os_genid(void);
+diff --git a/magic.c b/magic.c
+index e08c6f8..a452a43 100644
+--- a/magic.c
++++ b/magic.c
+@@ -23,6 +23,7 @@
+ * SOFTWARE.
+ */
+ #include <stdio.h>
++#include <string.h>
+
+ /* Description of the various file formats and their magic numbers */
+ struct magic {
+diff --git a/part.c b/part.c
+index 1d4efe6..15fd724 100644
+--- a/part.c
++++ b/part.c
+@@ -28,6 +28,7 @@
+
+ #include <stdio.h>
+ #include <string.h>
++#include <stdlib.h>
+
+ #include "part.h"
+ #include "xmalloc.h"
+diff --git a/unixos.c b/unixos.c
+index 3f5c4c0..fa6d0a7 100644
+--- a/unixos.c
++++ b/unixos.c
+@@ -30,6 +30,7 @@
+ #include <sys/param.h>
+ #include <netdb.h>
+ #include <fcntl.h>
++#include <stdlib.h>
+ #include "xmalloc.h"
+ #include "common.h"
+ #include "part.h"
+@@ -38,10 +39,6 @@
+ #define MAXHOSTNAMELEN 64
+ #endif
+
+-extern int errno;
+-extern char *malloc();
+-extern char *getenv();
+-
+ int overwrite_files = 0;
+ int didchat;
+
+diff --git a/unixpk.c b/unixpk.c
+index c2aaa56..1f81ea9 100644
+--- a/unixpk.c
++++ b/unixpk.c
+@@ -25,6 +25,8 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <errno.h>
++#include <stdlib.h>
++#include <unistd.h>
+ #include "common.h"
+ #include "version.h"
+ #include "xmalloc.h"
+diff --git a/unixunpk.c b/unixunpk.c
+index a1f065b..0f5fa85 100644
+--- a/unixunpk.c
++++ b/unixunpk.c
+@@ -23,6 +23,7 @@
+ * SOFTWARE.
+ */
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "version.h"
+ #include "part.h"
+
+diff --git a/xmalloc.c b/xmalloc.c
+index 7c74360..46dbbd1 100644
+--- a/xmalloc.c
++++ b/xmalloc.c
+@@ -24,7 +24,7 @@
+ */
+ #include <stdio.h>
+ #include <string.h>
+-extern char *malloc(), *realloc();
++#include <stdlib.h>
+
+ char *xmalloc (int size)
+ {
+--
+1.7.8
+
diff --git a/net-mail/mpack/files/mpack-1.6-cve-2011-4919.patch b/net-mail/mpack/files/mpack-1.6-cve-2011-4919.patch
new file mode 100644
index 000000000000..62a04faa7936
--- /dev/null
+++ b/net-mail/mpack/files/mpack-1.6-cve-2011-4919.patch
@@ -0,0 +1,28 @@
+From 0c87201f64491575350b18d04c62ec142e119d1f Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Sat, 31 Dec 2011 20:17:20 +0100
+Subject: [PATCH] Fix permissions
+
+---
+ unixos.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/unixos.c b/unixos.c
+index fa6d0a7..0e2f469 100644
+--- a/unixos.c
++++ b/unixos.c
+@@ -134,9 +134,9 @@ FILE *os_createnewfile(char *fname)
+ FILE *ret;
+
+ #ifdef O_EXCL
+- fd=open(fname, O_RDWR|O_CREAT|O_EXCL, 0644);
++ fd=open(fname, O_RDWR|O_CREAT|O_EXCL, 0600);
+ #else
+- fd=open(fname, O_RDWR|O_CREAT|O_TRUNC, 0644);
++ fd=open(fname, O_RDWR|O_CREAT|O_TRUNC, 0600);
+ #endif
+
+ if (fd == -1)
+--
+1.7.8.1
+
diff --git a/net-mail/mpack/files/mpack-1.6-filenames.patch b/net-mail/mpack/files/mpack-1.6-filenames.patch
new file mode 100644
index 000000000000..6a1fc225a791
--- /dev/null
+++ b/net-mail/mpack/files/mpack-1.6-filenames.patch
@@ -0,0 +1,30 @@
+From 10aad11d7baf7044328fff616b9c6f1859bd2cbd Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Sun, 8 Jan 2012 17:36:20 +0100
+Subject: [PATCH 1/2] Use actual filenames for unpacking (rather than
+ "part[0-9]+")
+
+Example:
+# curl http://pbot.rmdir.de/b224d87617c5d76d6cd938bd4410fabf | ./munpack
+---
+ decode.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/decode.c b/decode.c
+index 8b8df56..7349abd 100644
+--- a/decode.c
++++ b/decode.c
+@@ -546,8 +546,8 @@ getDispositionFilename(char *disposition)
+ SkipWhitespace(&disposition);
+ if (!disposition) return 0;
+
+- /* If we're looking at a ";", we found what we're looking for */
+- if (*disposition++ == ';') break;
++ /* If we're looking at a "=", we found what we're looking for */
++ if (*disposition++ == '=') break;
+ }
+
+ SkipWhitespace(&disposition);
+--
+1.7.8.3
+
diff --git a/net-mail/mpack/files/mpack-1.6-gentoo.patch b/net-mail/mpack/files/mpack-1.6-gentoo.patch
new file mode 100644
index 000000000000..faf72eb67e7a
--- /dev/null
+++ b/net-mail/mpack/files/mpack-1.6-gentoo.patch
@@ -0,0 +1,69 @@
+diff -bur mpack-1.6-orig/unixos.c mpack-1.6/unixos.c
+--- mpack-1.6-orig/unixos.c 2007-03-11 02:02:02.000000000 +0100
++++ mpack-1.6/unixos.c 2007-03-11 02:04:48.000000000 +0100
+@@ -39,7 +39,7 @@
+ #endif
+
+ extern int errno;
+-extern char *malloc();
++extern void *malloc();
+ extern char *getenv();
+
+ int overwrite_files = 0;
+@@ -90,7 +90,7 @@
+ strcpy(buf, getenv("TMPDIR"));
+ }
+ else {
+- strcpy(buf, "/usr/tmp");
++ strcpy(buf, "/var/tmp");
+ }
+ strcat(buf, "/m-prts-");
+ p = getenv("USER");
+diff -bur mpack-1.6-orig/unixpk.c mpack-1.6/unixpk.c
+--- mpack-1.6-orig/unixpk.c 2007-03-11 02:02:02.000000000 +0100
++++ mpack-1.6/unixpk.c 2007-03-11 02:14:02.000000000 +0100
+@@ -167,7 +167,7 @@
+ strcpy(fnamebuf, "/usr/tmp");
+ }
+ strcat(fnamebuf, "/mpackXXXXXX");
+- mktemp(fnamebuf);
++ mkstemp(fnamebuf);
+ outfname = strsave(fnamebuf);
+ }
+
+diff -bur mpack-1.6-orig/unixpk.man mpack-1.6/unixpk.man
+--- mpack-1.6-orig/unixpk.man 2007-03-11 02:02:02.000000000 +0100
++++ mpack-1.6/unixpk.man 2007-03-11 02:14:13.000000000 +0100
+@@ -136,7 +136,7 @@
+ .SH ENVIRONMENT
+ .TP
+ .B TMPDIR
+-Directory to store temporary files. Default is /usr/tmp.
++Directory to store temporary files. Default is /var/tmp.
+ .TP
+ .B SPLITSIZE
+ Default value of the -m switch.
+diff -bur mpack-1.6-orig/unixunpk.man mpack-1.6/unixunpk.man
+--- mpack-1.6-orig/unixunpk.man 2007-03-11 02:02:02.000000000 +0100
++++ mpack-1.6/unixunpk.man 2007-03-11 02:03:14.000000000 +0100
+@@ -107,7 +107,7 @@
+ .SH ENVIRONMENT
+ .TP
+ .B TMPDIR
+-Directory to store temporary files. Default is /usr/tmp.
++Directory to store temporary files. Default is /var/tmp.
+ .SH FILES
+ .TP
+ .B $TMPDIR/m-prts-$USER/
+diff -bur mpack-1.6-orig/xmalloc.c mpack-1.6/xmalloc.c
+--- mpack-1.6-orig/xmalloc.c 2007-03-11 02:02:02.000000000 +0100
++++ mpack-1.6/xmalloc.c 2007-03-11 02:04:29.000000000 +0100
+@@ -24,7 +24,7 @@
+ */
+ #include <stdio.h>
+ #include <string.h>
+-extern char *malloc(), *realloc();
++extern void *malloc(), *realloc();
+
+ char *xmalloc (int size)
+ {
diff --git a/net-mail/mpack/files/mpack-1.6-munpack.patch b/net-mail/mpack/files/mpack-1.6-munpack.patch
new file mode 100644
index 000000000000..9d5c8af6e814
--- /dev/null
+++ b/net-mail/mpack/files/mpack-1.6-munpack.patch
@@ -0,0 +1,55 @@
+From a4ececa89969adfa53c30878b21178e1427cb6c5 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Wed, 18 Jan 2012 05:22:25 +0100
+Subject: [PATCH] Fix unpacking of multiple parts
+
+The problem was reported by Dirk Meyer of FreeBSD.
+
+He shared these commands to reproduce:
+$ ./mpack -s Subject -m 1700 -o zparts md5c.c
+$ ./munpack zparts.*
+---
+ decode.c | 2 +-
+ unixos.c | 13 +++++++++++++
+ 2 files changed, 14 insertions(+), 1 deletions(-)
+
+diff --git a/decode.c b/decode.c
+index 7349abd..e8e8d56 100644
+--- a/decode.c
++++ b/decode.c
+@@ -633,7 +633,7 @@ int handlePartial(struct part *inpart, char *headers, params contentParams, int
+ }
+ /* Store number of parts in reassembly directory */
+ sprintf(buf, "%sCT", dir);
+- partfile = os_createnewfile(buf);
++ partfile = os_resetfile(buf);
+ if (!partfile) {
+ os_perror(buf);
+ goto ignore;
+diff --git a/unixos.c b/unixos.c
+index 0e2f469..1650594 100644
+--- a/unixos.c
++++ b/unixos.c
+@@ -146,6 +146,19 @@ FILE *os_createnewfile(char *fname)
+ return ret;
+ }
+
++FILE *os_resetfile(char *fname)
++{
++ int fd;
++ FILE *ret;
++
++ fd=open(fname, O_RDWR|O_CREAT|O_TRUNC, 0600);
++ if (fd == -1)
++ return NULL;
++
++ ret=fdopen(fd, "w");
++ return ret;
++}
++
+
+ /*
+ * Create a new file, with suggested filename "fname".
+--
+1.7.8.3
+
diff --git a/net-mail/mpack/files/mpack-1.6-paths.patch b/net-mail/mpack/files/mpack-1.6-paths.patch
new file mode 100644
index 000000000000..0dc2de8b2123
--- /dev/null
+++ b/net-mail/mpack/files/mpack-1.6-paths.patch
@@ -0,0 +1,95 @@
+From b857da37ec211e4472070c9e870aa5a0b827563b Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Thu, 8 Dec 2011 00:09:03 +0100
+Subject: [PATCH] Use /var/tmp rather than /usr/tmp
+
+---
+ README.unix | 2 +-
+ mkreadme.pl | 2 +-
+ unixos.c | 2 +-
+ unixpk.c | 2 +-
+ unixpk.man | 2 +-
+ unixunpk.man | 2 +-
+ 8 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/README.unix b/README.unix
+index d7a762c..c26b7c8 100644
+--- a/README.unix
++++ b/README.unix
+@@ -188,7 +188,7 @@ The environment variables which control munpack's behavior are:
+
+ TMPDIR
+ Root of directory to store partial messages awaiting
+- reassembly. Default is "/usr/tmp". Partial messages
++ reassembly. Default is "/var/tmp". Partial messages
+ are stored in subdirectories of $TMPDIR/m-prts-$USER/
+
+
+diff --git a/mkreadme.pl b/mkreadme.pl
+index a45117b..22e4e81 100755
+--- a/mkreadme.pl
++++ b/mkreadme.pl
+@@ -413,7 +413,7 @@ The environment variables which control munpack's behavior are:
+ =unix
+ TMPDIR
+ Root of directory to store partial messages awaiting
+- reassembly. Default is "/usr/tmp". Partial messages
++ reassembly. Default is "/var/tmp". Partial messages
+ are stored in subdirectories of $TMPDIR/m-prts-$USER/
+
+ =pc os2
+diff --git a/unixos.c b/unixos.c
+index 2243d12..fa6d0a7 100644
+--- a/unixos.c
++++ b/unixos.c
+@@ -87,7 +87,7 @@ char *os_idtodir(char *id)
+ strcpy(buf, getenv("TMPDIR"));
+ }
+ else {
+- strcpy(buf, "/usr/tmp");
++ strcpy(buf, "/var/tmp");
+ }
+ strcat(buf, "/m-prts-");
+ p = getenv("USER");
+diff --git a/unixpk.c b/unixpk.c
+index 3605dd1..0bae849 100644
+--- a/unixpk.c
++++ b/unixpk.c
+@@ -166,7 +166,7 @@ int main(int argc, char **argv)
+ strcpy(fnamebuf, getenv("TMPDIR"));
+ }
+ else {
+- strcpy(fnamebuf, "/usr/tmp");
++ strcpy(fnamebuf, "/var/tmp");
+ }
+ strcat(fnamebuf, "/mpackXXXXXX");
+ mktemp(fnamebuf);
+diff --git a/unixpk.man b/unixpk.man
+index de251ee..c4c9313 100644
+--- a/unixpk.man
++++ b/unixpk.man
+@@ -136,7 +136,7 @@ Mail the generated messages to the specified addresses.
+ .SH ENVIRONMENT
+ .TP
+ .B TMPDIR
+-Directory to store temporary files. Default is /usr/tmp.
++Directory to store temporary files. Default is /var/tmp.
+ .TP
+ .B SPLITSIZE
+ Default value of the -m switch.
+diff --git a/unixunpk.man b/unixunpk.man
+index da384b1..8c9ab7e 100644
+--- a/unixunpk.man
++++ b/unixunpk.man
+@@ -107,7 +107,7 @@ see the section "OPTIONS" above.
+ .SH ENVIRONMENT
+ .TP
+ .B TMPDIR
+-Directory to store temporary files. Default is /usr/tmp.
++Directory to store temporary files. Default is /var/tmp.
+ .SH FILES
+ .TP
+ .B $TMPDIR/m-prts-$USER/
+--
+1.7.8
+
diff --git a/net-mail/mpack/files/mpack-1.6-usage.patch b/net-mail/mpack/files/mpack-1.6-usage.patch
new file mode 100644
index 000000000000..f4f07e530ee9
--- /dev/null
+++ b/net-mail/mpack/files/mpack-1.6-usage.patch
@@ -0,0 +1,25 @@
+From 74fd172db4961ab07f134a60cd88955fb170f11d Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Sun, 8 Jan 2012 17:39:51 +0100
+Subject: [PATCH 2/2] Mention parameter -t in usage output
+
+---
+ unixunpk.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/unixunpk.c b/unixunpk.c
+index 0f5fa85..1320b70 100644
+--- a/unixunpk.c
++++ b/unixunpk.c
+@@ -101,7 +101,7 @@ int main(int argc, char **argv)
+
+ void usage(void) {
+ fprintf(stderr, "munpack version %s\n", MPACK_VERSION);
+- fprintf(stderr, "usage: munpack [-f] [-q] [-C directory] [files...]\n");
++ fprintf(stderr, "usage: munpack [-f] [-q] [-t] [-C directory] [files...]\n");
+ exit(1);
+ }
+
+--
+1.7.8.3
+
diff --git a/net-mail/mpack/metadata.xml b/net-mail/mpack/metadata.xml
new file mode 100644
index 000000000000..9a6d80e5da48
--- /dev/null
+++ b/net-mail/mpack/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+</maintainer>
+</pkgmetadata>
diff --git a/net-mail/mpack/mpack-1.6-r3.ebuild b/net-mail/mpack/mpack-1.6-r3.ebuild
new file mode 100644
index 000000000000..5016cc6747d0
--- /dev/null
+++ b/net-mail/mpack/mpack-1.6-r3.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="3"
+
+AT_M4DIR=cmulocal
+
+inherit eutils autotools
+
+DESCRIPTION="Command-line MIME encoding and decoding utilities"
+HOMEPAGE="ftp://ftp.andrew.cmu.edu/pub/mpack/"
+SRC_URI="ftp://ftp.andrew.cmu.edu/pub/mpack/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="HPND"
+KEYWORDS="amd64 x86 ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-filenames.patch
+ epatch "${FILESDIR}"/${P}-usage.patch
+ epatch "${FILESDIR}"/${P}-munpack.patch
+
+ # NOTE: These three patches replace <mpack-1.6-gentoo.patch>
+ epatch "${FILESDIR}"/${P}-compile.patch
+ epatch "${FILESDIR}"/${P}-paths.patch
+ epatch "${FILESDIR}"/${P}-cve-2011-4919.patch
+
+ epatch "${FILESDIR}"/${P}-clang.patch
+
+ eautoreconf
+}
+
+src_install () {
+ emake DESTDIR="${D}" install || die
+ dodoc README.* Changes
+}
diff --git a/net-mail/mpack/mpack-1.6-r4.ebuild b/net-mail/mpack/mpack-1.6-r4.ebuild
new file mode 100644
index 000000000000..549f2af53198
--- /dev/null
+++ b/net-mail/mpack/mpack-1.6-r4.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+AT_M4DIR=cmulocal
+
+inherit autotools
+
+DESCRIPTION="Command-line MIME encoding and decoding utilities"
+HOMEPAGE="ftp://ftp.andrew.cmu.edu/pub/mpack/"
+SRC_URI="ftp://ftp.andrew.cmu.edu/pub/mpack/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="HPND"
+KEYWORDS="~amd64 ~x86 ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+PATCHES=( "${FILESDIR}"/${P}-filenames.patch
+ "${FILESDIR}"/${P}-usage.patch
+ "${FILESDIR}"/${P}-munpack.patch
+ # NOTE: These three patches replace <mpack-1.6-gentoo.patch>
+ "${FILESDIR}"/${P}-compile.patch
+ "${FILESDIR}"/${P}-paths.patch
+ "${FILESDIR}"/${P}-cve-2011-4919.patch
+
+ "${FILESDIR}"/${P}-clang.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_install () {
+ emake DESTDIR="${D}" install
+ dodoc README.* Changes
+}