From a732706ca7da239ddca579bb4581689f35c87c26 Mon Sep 17 00:00:00 2001 From: sthen Date: Fri, 27 Jan 2023 18:04:19 +0000 Subject: [PATCH] mpack: mirror the distfile, whack some implicit function definitions and a 64-bit time_t issue --- converters/mpack/Makefile | 6 ++--- converters/mpack/patches/patch-common_h | 12 +++++++++ converters/mpack/patches/patch-decode_c | 20 +++++++++++---- converters/mpack/patches/patch-unixos_c | 30 +++++++++++++++++------ converters/mpack/patches/patch-unixpk_c | 12 ++++++--- converters/mpack/patches/patch-unixunpk_c | 10 +++++--- converters/mpack/patches/patch-uudecode_c | 20 +++++++++++---- 7 files changed, 82 insertions(+), 28 deletions(-) create mode 100644 converters/mpack/patches/patch-common_h diff --git a/converters/mpack/Makefile b/converters/mpack/Makefile index e56558d3aad..d671dfd3e9e 100644 --- a/converters/mpack/Makefile +++ b/converters/mpack/Makefile @@ -1,7 +1,7 @@ COMMENT= external MIME packer/unpacker DISTNAME= mpack-1.6 -REVISION= 2 +REVISION= 3 CATEGORIES= converters mail news # BSD @@ -10,12 +10,12 @@ PERMIT_PACKAGE= Yes WANTLIB += c MASTER_SITES= http://ftp.andrew.cmu.edu/pub/mpack/ \ - ftp://ftp.andrew.cmu.edu/pub/mpack/ + https://spacehopper.org/mirrors/ CONFIGURE_STYLE= gnu NO_TEST= Yes -# less annoying for patching +# less annoying for patching; not the same as FIX_EXTRACT_PERMISSIONS post-extract: chmod -R u+w ${WRKSRC}/ diff --git a/converters/mpack/patches/patch-common_h b/converters/mpack/patches/patch-common_h new file mode 100644 index 00000000000..6470673d345 --- /dev/null +++ b/converters/mpack/patches/patch-common_h @@ -0,0 +1,12 @@ +Index: common.h +--- common.h.orig ++++ common.h +@@ -29,6 +29,8 @@ + #define TEMPFILENAME "tempdesc.txt" + #endif + ++#include ++ + #if defined(unix) && !defined(remove) + #define remove unlink + #endif diff --git a/converters/mpack/patches/patch-decode_c b/converters/mpack/patches/patch-decode_c index 9ebb8b60653..5ec08115400 100644 --- a/converters/mpack/patches/patch-decode_c +++ b/converters/mpack/patches/patch-decode_c @@ -1,6 +1,11 @@ ---- decode.c.orig Mon Jul 21 21:47:54 2003 -+++ decode.c Tue Dec 11 10:47:55 2012 -@@ -28,10 +28,11 @@ +Index: decode.c +--- decode.c.orig ++++ decode.c +@@ -25,17 +25,20 @@ + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. */ + ++#include #include #include #include @@ -13,7 +18,12 @@ extern char *os_idtodir(char *id); extern FILE *os_newtypedfile(char *fname, char *contentType, int flags, params contentParams); -@@ -545,8 +546,8 @@ getDispositionFilename(char *disposition) + extern FILE *os_createnewfile(char *fname); ++extern FILE *os_resetfile(char *fname); + extern char *md5contextTo64(MD5_CTX *context); + + /* The possible content transfer encodings */ +@@ -545,8 +548,8 @@ getDispositionFilename(char *disposition) SkipWhitespace(&disposition); if (!disposition) return 0; @@ -24,7 +34,7 @@ } SkipWhitespace(&disposition); -@@ -632,7 +633,7 @@ int handlePartial(struct part *inpart, char *headers, +@@ -632,7 +635,7 @@ int handlePartial(struct part *inpart, char *headers, } /* Store number of parts in reassembly directory */ sprintf(buf, "%sCT", dir); diff --git a/converters/mpack/patches/patch-unixos_c b/converters/mpack/patches/patch-unixos_c index 41c54d0e352..194e2a737a4 100644 --- a/converters/mpack/patches/patch-unixos_c +++ b/converters/mpack/patches/patch-unixos_c @@ -1,16 +1,23 @@ Fixes from Sebastian Pipping/gentoo. ---- unixos.c.orig Mon Jul 21 21:54:05 2003 -+++ unixos.c Tue Dec 11 10:52:04 2012 -@@ -30,6 +30,7 @@ +Index: unixos.c +--- unixos.c.orig ++++ unixos.c +@@ -26,10 +26,13 @@ + #include + #include + #include ++#include + #include #include ++#include #include #include +#include #include "xmalloc.h" #include "common.h" #include "part.h" -@@ -38,10 +39,6 @@ +@@ -38,10 +41,6 @@ #define MAXHOSTNAMELEN 64 #endif @@ -21,7 +28,16 @@ Fixes from Sebastian Pipping/gentoo. int overwrite_files = 0; int didchat; -@@ -90,7 +87,7 @@ char *os_idtodir(char *id) +@@ -76,7 +75,7 @@ char *os_genid(void) + } + + result = malloc(25+strlen(hostname)); +- sprintf(result, "%d.%d@%s", pid, curtime++, hostname); ++ sprintf(result, "%d.%lld@%s", pid, (long long)curtime++, hostname); + return result; + } + +@@ -90,7 +89,7 @@ char *os_idtodir(char *id) strcpy(buf, getenv("TMPDIR")); } else { @@ -30,7 +46,7 @@ Fixes from Sebastian Pipping/gentoo. } strcat(buf, "/m-prts-"); p = getenv("USER"); -@@ -136,11 +133,7 @@ FILE *os_createnewfile(char *fname) +@@ -136,11 +135,7 @@ FILE *os_createnewfile(char *fname) int fd; FILE *ret; @@ -43,7 +59,7 @@ Fixes from Sebastian Pipping/gentoo. if (fd == -1) return NULL; -@@ -149,7 +142,19 @@ FILE *os_createnewfile(char *fname) +@@ -149,7 +144,19 @@ FILE *os_createnewfile(char *fname) return ret; } diff --git a/converters/mpack/patches/patch-unixpk_c b/converters/mpack/patches/patch-unixpk_c index 79295a05990..321ff558416 100644 --- a/converters/mpack/patches/patch-unixpk_c +++ b/converters/mpack/patches/patch-unixpk_c @@ -1,11 +1,15 @@ ---- unixpk.c.orig Mon Jul 21 21:50:41 2003 -+++ unixpk.c Tue Dec 11 10:52:18 2012 -@@ -25,6 +25,8 @@ +Index: unixpk.c +--- unixpk.c.orig ++++ unixpk.c +@@ -22,9 +22,11 @@ + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ ++#include #include #include #include +#include -+#include #include "common.h" #include "version.h" #include "xmalloc.h" diff --git a/converters/mpack/patches/patch-unixunpk_c b/converters/mpack/patches/patch-unixunpk_c index 017c85b6bc2..e6d83ad3369 100644 --- a/converters/mpack/patches/patch-unixunpk_c +++ b/converters/mpack/patches/patch-unixunpk_c @@ -1,14 +1,16 @@ ---- unixunpk.c.orig Mon Jul 21 21:51:55 2003 -+++ unixunpk.c Sun Jan 8 00:04:32 2012 -@@ -23,6 +23,7 @@ +Index: unixunpk.c +--- unixunpk.c.orig ++++ unixunpk.c +@@ -23,6 +23,8 @@ * SOFTWARE. */ #include +#include ++#include #include "version.h" #include "part.h" -@@ -100,7 +101,7 @@ int main(int argc, char **argv) +@@ -100,7 +102,7 @@ int main(int argc, char **argv) void usage(void) { fprintf(stderr, "munpack version %s\n", MPACK_VERSION); diff --git a/converters/mpack/patches/patch-uudecode_c b/converters/mpack/patches/patch-uudecode_c index 541b5b7c402..d57f6ff0391 100644 --- a/converters/mpack/patches/patch-uudecode_c +++ b/converters/mpack/patches/patch-uudecode_c @@ -1,8 +1,18 @@ Allow building with CLang's scan-build. ---- uudecode.c.orig Mon Jul 21 21:46:37 2003 -+++ uudecode.c Tue Dec 11 10:23:21 2012 -@@ -35,6 +35,7 @@ extern FILE *os_createnewfile(char *fname); +Index: uudecode.c +--- uudecode.c.orig ++++ uudecode.c +@@ -23,6 +23,8 @@ + * SOFTWARE. + */ + #include ++#include ++#include + #include + #include + #include "xmalloc.h" +@@ -35,6 +37,7 @@ extern FILE *os_createnewfile(char *fname); static FILE *startDescFile(char *fname); @@ -10,7 +20,7 @@ Allow building with CLang's scan-build. /* Length of a normal uuencoded line, including newline */ #define UULENGTH 62 -@@ -826,7 +827,7 @@ uudecodefiles(char *dir, int nparts) +@@ -826,7 +829,7 @@ uudecodefiles(char *dir, int nparts) /* * Decode a uuencoded line to 'outfile' */ @@ -19,7 +29,7 @@ Allow building with CLang's scan-build. { int c, len; -@@ -845,7 +846,4 @@ int uudecodeline(char *line, FILE *outfile) +@@ -845,7 +848,4 @@ int uudecodeline(char *line, FILE *outfile) } line += 4; }