From 2ccfc49bb7fdb3dd82040f8202dc39b540f012c7 Mon Sep 17 00:00:00 2001 From: nia Date: Fri, 7 Jan 2022 12:43:14 +0000 Subject: [PATCH] add x11/xtar XTar is a package for graphically viewing and manipulating files which have been archived using tar (Tape ARchive), and possibly compressed with gzip or the standard UNIX compress utility. XTar requires an ANSI C compiler and the Motif toolkit to build. --- x11/Makefile | 3 +- x11/xtar/DESCR | 4 ++ x11/xtar/Makefile | 17 +++++++ x11/xtar/PLIST | 5 ++ x11/xtar/distinfo | 20 ++++++++ x11/xtar/patches/patch-Imakefile | 13 +++++ x11/xtar/patches/patch-Xbr_XbrCB.c | 14 ++++++ x11/xtar/patches/patch-Xbr_XbrGfx.c | 14 ++++++ x11/xtar/patches/patch-Xbr_XbrList.h | 16 +++++++ x11/xtar/patches/patch-Xbr_XbrMenu.c | 14 ++++++ x11/xtar/patches/patch-common_ascii.c | 14 ++++++ x11/xtar/patches/patch-common_file.c | 16 +++++++ x11/xtar/patches/patch-common_magic.c | 40 ++++++++++++++++ x11/xtar/patches/patch-common_magic.h | 23 +++++++++ x11/xtar/patches/patch-common_nums.c | 15 ++++++ x11/xtar/patches/patch-common_pipe.c | 16 +++++++ x11/xtar/patches/patch-common_regexpr.c | 64 +++++++++++++++++++++++++ x11/xtar/patches/patch-common_str.c | 24 ++++++++++ x11/xtar/patches/patch-common_tmpfile.c | 14 ++++++ x11/xtar/patches/patch-xtar.c | 32 +++++++++++++ 20 files changed, 377 insertions(+), 1 deletion(-) create mode 100644 x11/xtar/DESCR create mode 100644 x11/xtar/Makefile create mode 100644 x11/xtar/PLIST create mode 100644 x11/xtar/distinfo create mode 100644 x11/xtar/patches/patch-Imakefile create mode 100644 x11/xtar/patches/patch-Xbr_XbrCB.c create mode 100644 x11/xtar/patches/patch-Xbr_XbrGfx.c create mode 100644 x11/xtar/patches/patch-Xbr_XbrList.h create mode 100644 x11/xtar/patches/patch-Xbr_XbrMenu.c create mode 100644 x11/xtar/patches/patch-common_ascii.c create mode 100644 x11/xtar/patches/patch-common_file.c create mode 100644 x11/xtar/patches/patch-common_magic.c create mode 100644 x11/xtar/patches/patch-common_magic.h create mode 100644 x11/xtar/patches/patch-common_nums.c create mode 100644 x11/xtar/patches/patch-common_pipe.c create mode 100644 x11/xtar/patches/patch-common_regexpr.c create mode 100644 x11/xtar/patches/patch-common_str.c create mode 100644 x11/xtar/patches/patch-common_tmpfile.c create mode 100644 x11/xtar/patches/patch-xtar.c diff --git a/x11/Makefile b/x11/Makefile index 478cb13b30b4..eb60a4c7c572 100644 --- a/x11/Makefile +++ b/x11/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.948 2021/12/26 18:21:44 gutteridge Exp $ +# $NetBSD: Makefile,v 1.949 2022/01/07 12:43:14 nia Exp $ # COMMENT= Packages to support the X Window System @@ -679,6 +679,7 @@ SUBDIR+= xsm SUBDIR+= xsnow SUBDIR+= xst SUBDIR+= xstdcmap +SUBDIR+= xtar SUBDIR+= xteddy SUBDIR+= xteddy2 SUBDIR+= xterm diff --git a/x11/xtar/DESCR b/x11/xtar/DESCR new file mode 100644 index 000000000000..fc10bd0df724 --- /dev/null +++ b/x11/xtar/DESCR @@ -0,0 +1,4 @@ +XTar is a package for graphically viewing and manipulating files which have +been archived using tar (Tape ARchive), and possibly compressed with gzip +or the standard UNIX compress utility. XTar requires an ANSI C compiler and +the Motif toolkit to build. diff --git a/x11/xtar/Makefile b/x11/xtar/Makefile new file mode 100644 index 000000000000..5e182a13071c --- /dev/null +++ b/x11/xtar/Makefile @@ -0,0 +1,17 @@ +# $NetBSD: Makefile,v 1.1 2022/01/07 12:43:14 nia Exp $ + +DISTNAME= xtar-1.4 +CATEGORIES= x11 +MASTER_SITES= ${MASTER_SITE_XCONTRIB:=utilities/} + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= https://ftp.gwdg.de/pub/x11/x.org/contrib/utilities/ +COMMENT= View and manipulate the contents of a tar file +LICENSE= modified-bsd # ish + +USE_IMAKE= yes + +MAKE_JOBS_SAFE= no + +.include "../../mk/motif.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/x11/xtar/PLIST b/x11/xtar/PLIST new file mode 100644 index 000000000000..d3113d4389c3 --- /dev/null +++ b/x11/xtar/PLIST @@ -0,0 +1,5 @@ +@comment $NetBSD: PLIST,v 1.1 2022/01/07 12:43:14 nia Exp $ +bin/xtar +lib/X11/app-defaults/XTar +lib/X11/xtar/xtar.doc +man/man1/xtar.1 diff --git a/x11/xtar/distinfo b/x11/xtar/distinfo new file mode 100644 index 000000000000..ad7fbf0b9b64 --- /dev/null +++ b/x11/xtar/distinfo @@ -0,0 +1,20 @@ +$NetBSD: distinfo,v 1.1 2022/01/07 12:43:14 nia Exp $ + +BLAKE2s (xtar-1.4.tar.gz) = 3a2d17f4c1fd2d6d46c5f91b919d54367c1268b027984016aa6c992e0e0b070f +SHA512 (xtar-1.4.tar.gz) = aac20f1eefcdc2401dc0fa39ba4291a56cb505ee4a6a5202ac6401e8bbc27dcf40368495e5b22669c21a30d90cf116d2dbdc67ce86273f4fd8df21f070d2f121 +Size (xtar-1.4.tar.gz) = 87506 bytes +SHA1 (patch-Imakefile) = 6bbc68103dd399c0a744f837dbe3016d5a367424 +SHA1 (patch-Xbr_XbrCB.c) = db5544ed0ede603a53f091a47335505c2207b7d5 +SHA1 (patch-Xbr_XbrGfx.c) = 2ff219fe99837c2b0109667866b7b822312ec0c0 +SHA1 (patch-Xbr_XbrList.h) = b038bfa8b9bc1300de868994ad6e6ff2fa7e20ee +SHA1 (patch-Xbr_XbrMenu.c) = 193673bed0d88510331bb466c1cef24840aded36 +SHA1 (patch-common_ascii.c) = 45c8d20e0e7557ff16e7984c1b18fd909c573858 +SHA1 (patch-common_file.c) = 959078bb12666c2f9970644e5f23f054abb3ae81 +SHA1 (patch-common_magic.c) = 50b27640f9e913a32db499121c2dd1f990c60902 +SHA1 (patch-common_magic.h) = 23dacfc0d3dbbca9bdadeb1f6678cefec4c640fc +SHA1 (patch-common_nums.c) = b71fbbb3f1a956155ad06fb394f18a53c6460093 +SHA1 (patch-common_pipe.c) = 827efb75e5c49808ffbcad6fa9bbea60c8666ec0 +SHA1 (patch-common_regexpr.c) = 14ef6d96bb0f81fae929595204b4d3ac134e6d1c +SHA1 (patch-common_str.c) = 9290827ba81b9255957a17c5df975036c1024365 +SHA1 (patch-common_tmpfile.c) = a8a5c1870fd200c437d97869fdb17e6fb65f058e +SHA1 (patch-xtar.c) = 5b3eb5d2ee883efbd329f871f5f29189e9969072 diff --git a/x11/xtar/patches/patch-Imakefile b/x11/xtar/patches/patch-Imakefile new file mode 100644 index 000000000000..98d2a0aa1590 --- /dev/null +++ b/x11/xtar/patches/patch-Imakefile @@ -0,0 +1,13 @@ +$NetBSD: patch-Imakefile,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Prevent the insertion of a space so DESTDIR is honored. + +--- Imakefile.orig 1995-07-17 11:28:19.000000000 +0000 ++++ Imakefile +@@ -30,5 +30,5 @@ OBJS = $(SRCS:.c=.o) + MakeSubdirs($(SUBDIRS)) + ComplexProgramTarget(xtar) + MakeDirectories(install,$(LIBDIR)/xtar) +-InstallNonExec(xtar.doc, $(LIBDIR)/xtar) ++InstallNonExec(xtar.doc,$(LIBDIR)/xtar) + InstallAppDefaults(XTar) diff --git a/x11/xtar/patches/patch-Xbr_XbrCB.c b/x11/xtar/patches/patch-Xbr_XbrCB.c new file mode 100644 index 000000000000..3026706cda8a --- /dev/null +++ b/x11/xtar/patches/patch-Xbr_XbrCB.c @@ -0,0 +1,14 @@ +$NetBSD: patch-Xbr_XbrCB.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. + +--- Xbr/XbrCB.c.orig 1995-05-09 08:06:46.000000000 +0000 ++++ Xbr/XbrCB.c +@@ -19,6 +19,7 @@ + */ + + #include ++#include + + void XbrCBExitApplication(Widget, XtPointer, XtPointer); + void XbrCBDestroyWidget(Widget, XtPointer, XtPointer); diff --git a/x11/xtar/patches/patch-Xbr_XbrGfx.c b/x11/xtar/patches/patch-Xbr_XbrGfx.c new file mode 100644 index 000000000000..35d82ea49bb7 --- /dev/null +++ b/x11/xtar/patches/patch-Xbr_XbrGfx.c @@ -0,0 +1,14 @@ +$NetBSD: patch-Xbr_XbrGfx.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. + +--- Xbr/XbrGfx.c.orig 1995-05-09 08:06:47.000000000 +0000 ++++ Xbr/XbrGfx.c +@@ -46,6 +46,7 @@ + */ + + #include ++#include + #include + #include + #include diff --git a/x11/xtar/patches/patch-Xbr_XbrList.h b/x11/xtar/patches/patch-Xbr_XbrList.h new file mode 100644 index 000000000000..fca0c728b2f9 --- /dev/null +++ b/x11/xtar/patches/patch-Xbr_XbrList.h @@ -0,0 +1,16 @@ +$NetBSD: patch-Xbr_XbrList.h,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- "implicit int" may have been cool in 1995, but it now produces + compiler warnings. + +--- Xbr/XbrList.h.orig 1995-05-09 08:06:46.000000000 +0000 ++++ Xbr/XbrList.h +@@ -29,7 +29,7 @@ extern void XbrListClear(Widget); + extern void XbrListAddItem(Widget, char *, int); + extern char **XbrListGetSelection(Widget); + extern void XbrListSelectionFree(char **); +-extern XbrListItemSelected(Widget, int *); ++extern int XbrListItemSelected(Widget, int *); + extern void XbrListTop(Widget); + extern int XbrListNumItems(Widget); + diff --git a/x11/xtar/patches/patch-Xbr_XbrMenu.c b/x11/xtar/patches/patch-Xbr_XbrMenu.c new file mode 100644 index 000000000000..c9ca11b78d4f --- /dev/null +++ b/x11/xtar/patches/patch-Xbr_XbrMenu.c @@ -0,0 +1,14 @@ +$NetBSD: patch-Xbr_XbrMenu.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. + +--- Xbr/XbrMenu.c.orig 1995-05-09 08:06:47.000000000 +0000 ++++ Xbr/XbrMenu.c +@@ -18,6 +18,7 @@ + * + */ + ++#include + #include + #include + #include diff --git a/x11/xtar/patches/patch-common_ascii.c b/x11/xtar/patches/patch-common_ascii.c new file mode 100644 index 000000000000..03a063f6908c --- /dev/null +++ b/x11/xtar/patches/patch-common_ascii.c @@ -0,0 +1,14 @@ +$NetBSD: patch-common_ascii.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. + +--- common/ascii.c.orig 1995-05-09 08:06:46.000000000 +0000 ++++ common/ascii.c +@@ -24,6 +24,7 @@ + */ + + #include ++#include + #include + + #include "cdefs.h" diff --git a/x11/xtar/patches/patch-common_file.c b/x11/xtar/patches/patch-common_file.c new file mode 100644 index 000000000000..6c1b18c5f300 --- /dev/null +++ b/x11/xtar/patches/patch-common_file.c @@ -0,0 +1,16 @@ +$NetBSD: patch-common_file.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. + +--- common/file.c.orig 1995-05-09 08:06:46.000000000 +0000 ++++ common/file.c +@@ -22,7 +22,9 @@ + #include + #include + #include ++#include + #include ++#include + #include + #include + diff --git a/x11/xtar/patches/patch-common_magic.c b/x11/xtar/patches/patch-common_magic.c new file mode 100644 index 000000000000..080f3784ee66 --- /dev/null +++ b/x11/xtar/patches/patch-common_magic.c @@ -0,0 +1,40 @@ +$NetBSD: patch-common_magic.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. +- Add support for bzip2 and xz archives. + +--- common/magic.c.orig 1995-05-09 08:06:46.000000000 +0000 ++++ common/magic.c +@@ -21,6 +21,8 @@ + + #include + #include ++#include ++#include + + #include "magic.h" + +@@ -30,6 +32,8 @@ static unsigned char jpeg[2] = { 0 + static unsigned char gif[3] = { 0x47, 0x49, 0x46 }; + static unsigned char compress[3] = { 0x1f, 0x9d, 0x90 }; + static unsigned char gzip[3] = { 0x1f, 0x8b, 0x08 }; ++static unsigned char bzip2[3] = { 0x42, 0x5a, 0x68 }; ++static unsigned char xz[3] = { 0xfd, 0x37, 0x7a }; + static unsigned char troff[2] = { 0x5c, 0x22 }; + static unsigned char postscript[2] = { 0x25, 0x21 }; + +@@ -65,6 +69,14 @@ int magic_ftype(char *filename, int type + + /* Compare bytes with type we are after */ + switch(type) { ++ case MAGIC_BZIP2: ++ if(!memcmp(buffer, bzip2, 3)) ++ return(1); ++ break; ++ case MAGIC_XZ: ++ if(!memcmp(buffer, xz, 3)) ++ return(1); ++ break; + case MAGIC_JPEG: + if(!memcmp(buffer, jpeg, 2)) + return(1); diff --git a/x11/xtar/patches/patch-common_magic.h b/x11/xtar/patches/patch-common_magic.h new file mode 100644 index 000000000000..e78f4d2a2aa2 --- /dev/null +++ b/x11/xtar/patches/patch-common_magic.h @@ -0,0 +1,23 @@ +$NetBSD: patch-common_magic.h,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Add support for bzip2 and xz archives. + +--- common/magic.h.orig 1995-05-09 08:06:46.000000000 +0000 ++++ common/magic.h +@@ -27,13 +27,15 @@ + #define MAGIC_GZIP 4 + #define MAGIC_TROFF 5 + #define MAGIC_POSTSCRIPT 6 ++#define MAGIC_BZIP2 7 ++#define MAGIC_XZ 8 + + extern int magic_ftype(char *, int); + + #define is_jpeg(filename) magic_ftype(filename, MAGIC_JPEG) + #define is_gif(filename) magic_ftype(filename, MAGIC_GIF) + #define is_compressed(filename) magic_ftype(filename, MAGIC_COMPRESS) +-#define is_gzipped(filename) magic_ftype(filename, MAGIC_GZIP) ++#define is_gzipped(filename) magic_ftype(filename, MAGIC_GZIP) || magic_ftype(filename, MAGIC_BZIP2) || magic_ftype(filename, MAGIC_XZ) + #define is_troff(filename) magic_ftype(filename, MAGIC_TROFF) + #define is_postscript(filename) magic_ftype(filename, MAGIC_POSTSCRIPT) + diff --git a/x11/xtar/patches/patch-common_nums.c b/x11/xtar/patches/patch-common_nums.c new file mode 100644 index 000000000000..ccc1a801559c --- /dev/null +++ b/x11/xtar/patches/patch-common_nums.c @@ -0,0 +1,15 @@ +$NetBSD: patch-common_nums.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. + +--- common/nums.c.orig 1995-05-09 08:06:46.000000000 +0000 ++++ common/nums.c +@@ -21,6 +21,8 @@ + */ + + #include ++#include ++#include + + int num_random(); + long num_decimal(char *, int); diff --git a/x11/xtar/patches/patch-common_pipe.c b/x11/xtar/patches/patch-common_pipe.c new file mode 100644 index 000000000000..06e516a28061 --- /dev/null +++ b/x11/xtar/patches/patch-common_pipe.c @@ -0,0 +1,16 @@ +$NetBSD: patch-common_pipe.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. + +--- common/pipe.c.orig 1995-05-09 08:06:46.000000000 +0000 ++++ common/pipe.c +@@ -23,7 +23,9 @@ + + #include + #include ++#include + #include ++#include + + #include "magic.h" + #include "str.h" diff --git a/x11/xtar/patches/patch-common_regexpr.c b/x11/xtar/patches/patch-common_regexpr.c new file mode 100644 index 000000000000..666f7b35ca1e --- /dev/null +++ b/x11/xtar/patches/patch-common_regexpr.c @@ -0,0 +1,64 @@ +$NetBSD: patch-common_regexpr.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. +- Do not define own libc symbols. + +--- common/regexpr.c.orig 1995-05-09 08:06:46.000000000 +0000 ++++ common/regexpr.c +@@ -23,6 +23,8 @@ + * regular-expression syntax might require a total rethink. + */ + #include ++#include ++#include + + #include "regexpr.h" + +@@ -198,7 +200,6 @@ regexpr *reg_compile(char *exp) + register char *longest; + register int len; + int flags; +- extern char *malloc(); + + if (exp == NULL) + FAIL("NULL argument"); +@@ -682,7 +683,6 @@ STATIC char *regprop(char *); + int reg_execute(register regexpr *prog, register char *string) + { + register char *s; +- extern char *strchr(); + + /* Be paranoid... */ + if (prog == NULL || string == NULL) { +@@ -776,7 +776,6 @@ static int regmatch(char *prog) + { + register char *scan; /* Current node. */ + char *next; /* Next node. */ +- extern char *strchr(); + + scan = prog; + #ifdef DEBUG +@@ -964,7 +963,6 @@ static int regrepeat(char *p) + register int count = 0; + register char *scan; + register char *opnd; +- extern char *strchr(); + + scan = reginput; + opnd = OPERAND(p); +@@ -1031,7 +1029,6 @@ void reg_substitute(regexpr *prog, char + register char c; + register int no; + register int len; +- extern char *strncpy(); + + if (prog == NULL || source == NULL || dest == NULL) { + reg_error("NULL parm to reg_substitute"); +@@ -1086,7 +1083,6 @@ void regdump(regexpr *r) + register char *s; + register char op = EXACTLY; /* Arbitrary non-END op. */ + register char *next; +- extern char *strchr(); + + + s = r->program + 1; diff --git a/x11/xtar/patches/patch-common_str.c b/x11/xtar/patches/patch-common_str.c new file mode 100644 index 000000000000..93caa950178a --- /dev/null +++ b/x11/xtar/patches/patch-common_str.c @@ -0,0 +1,24 @@ +$NetBSD: patch-common_str.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Do not define symbols that belong to libc headers. +- Fix implicit declaration warnings. + +--- common/str.c.orig 1995-05-09 08:06:46.000000000 +0000 ++++ common/str.c +@@ -18,6 +18,7 @@ + * + */ + ++#include + #include + #include + #include +@@ -282,8 +283,6 @@ char *str_word(char **string) + ---------------------------------------------------------------------------*/ + char *str_error(int errnum) + { +- extern int sys_nerr; +- extern char *sys_errlist[]; + static char ebuf[40]; /* 64-bit number + slop */ + + if ((unsigned int)errnum < sys_nerr) diff --git a/x11/xtar/patches/patch-common_tmpfile.c b/x11/xtar/patches/patch-common_tmpfile.c new file mode 100644 index 000000000000..158b47b9a5ec --- /dev/null +++ b/x11/xtar/patches/patch-common_tmpfile.c @@ -0,0 +1,14 @@ +$NetBSD: patch-common_tmpfile.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. + +--- common/tmpfile.c.orig 1995-05-09 08:06:46.000000000 +0000 ++++ common/tmpfile.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + /* Data structure describing a temporary file */ + typedef struct tmp_struct { diff --git a/x11/xtar/patches/patch-xtar.c b/x11/xtar/patches/patch-xtar.c new file mode 100644 index 000000000000..11618f50a361 --- /dev/null +++ b/x11/xtar/patches/patch-xtar.c @@ -0,0 +1,32 @@ +$NetBSD: patch-xtar.c,v 1.1 2022/01/07 12:43:14 nia Exp $ + +- Fix implicit declaration warnings. +- Remove an unused variable that assumes it knows the size of + a private struct. + +--- xtar.c.orig 1995-07-17 11:44:19.000000000 +0000 ++++ xtar.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -46,6 +47,7 @@ + #include + #include + #include ++#include + + #include "Xbr.h" + #include "xtarint.h" +@@ -1164,7 +1166,6 @@ static int xtar_show(char *tfname, char + static int xtar_attributes(TAR_FILE *tf, char *filename) + { + int retval = 0; +- struct utimbuf utimbuf; + + /* If the file type is not a directory then try and set the access + permissions. We exclude directories because if write permission