From 67a49a92d013fa95e963b11bb0df5b5ce57564fb Mon Sep 17 00:00:00 2001 From: se Date: Tue, 22 Sep 2020 13:28:40 +0000 Subject: [PATCH] Fix build with -fno-common While here add license (GPLv2) --- sysutils/logtool/Makefile | 4 ++ sysutils/logtool/files/patch-src_ansi.c | 11 +++++ sysutils/logtool/files/patch-src_gethost.c | 11 +++++ ...h-src__includes.h => patch-src_includes.h} | 8 ++-- sysutils/logtool/files/patch-src_logtool.h | 44 +++++++++++++++++++ .../logtool/files/patch-src_mod__iptables.c | 11 +++++ sysutils/logtool/files/patch-src_mod__snort.c | 11 +++++ sysutils/logtool/files/patch-src_mods.h | 37 ++++++++++++++++ sysutils/logtool/files/patch-src_parser.c | 11 +++++ sysutils/logtool/files/patch-src_readconf.c | 13 ++++++ 10 files changed, 157 insertions(+), 4 deletions(-) create mode 100644 sysutils/logtool/files/patch-src_ansi.c create mode 100644 sysutils/logtool/files/patch-src_gethost.c rename sysutils/logtool/files/{patch-src__includes.h => patch-src_includes.h} (50%) create mode 100644 sysutils/logtool/files/patch-src_logtool.h create mode 100644 sysutils/logtool/files/patch-src_mod__iptables.c create mode 100644 sysutils/logtool/files/patch-src_mod__snort.c create mode 100644 sysutils/logtool/files/patch-src_mods.h create mode 100644 sysutils/logtool/files/patch-src_parser.c create mode 100644 sysutils/logtool/files/patch-src_readconf.c diff --git a/sysutils/logtool/Makefile b/sysutils/logtool/Makefile index f3d2223ca423..4b4a9860aac0 100644 --- a/sysutils/logtool/Makefile +++ b/sysutils/logtool/Makefile @@ -3,12 +3,16 @@ PORTNAME= logtool PORTVERSION= 1.3.1 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= http://xjack.org/logtool/download/ MAINTAINER= rodrigo@FreeBSD.org COMMENT= Parse ASCII logfiles into ANSI, CSV, HTML formats +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/COPYING + USES= gmake GNU_CONFIGURE= yes diff --git a/sysutils/logtool/files/patch-src_ansi.c b/sysutils/logtool/files/patch-src_ansi.c new file mode 100644 index 000000000000..357103e2bbec --- /dev/null +++ b/sysutils/logtool/files/patch-src_ansi.c @@ -0,0 +1,11 @@ +--- src/ansi.c.orig 2003-04-21 17:42:38 UTC ++++ src/ansi.c +@@ -20,6 +20,8 @@ + + #include "includes.h" + ++st_color color; ++ + void lt_colorset_ansi() { /* this sets up color definitions for the output module */ + + /* simple strcpy's to the appropriate variables */ diff --git a/sysutils/logtool/files/patch-src_gethost.c b/sysutils/logtool/files/patch-src_gethost.c new file mode 100644 index 000000000000..42b24339cb14 --- /dev/null +++ b/sysutils/logtool/files/patch-src_gethost.c @@ -0,0 +1,11 @@ +--- src/gethost.c.orig 2003-05-16 20:13:20 UTC ++++ src/gethost.c +@@ -21,6 +21,8 @@ + /* Yee ole includes (I put this all in one file for my sanity) */ + #include "includes.h" + ++char lt_host[LSIZE]; ++ + #ifndef NO_RESOLVER + /* var's for gethostbyaddr() stuff */ + extern int h_errno; diff --git a/sysutils/logtool/files/patch-src__includes.h b/sysutils/logtool/files/patch-src_includes.h similarity index 50% rename from sysutils/logtool/files/patch-src__includes.h rename to sysutils/logtool/files/patch-src_includes.h index 251d4cee729d..90e673df4e79 100644 --- a/sysutils/logtool/files/patch-src__includes.h +++ b/sysutils/logtool/files/patch-src_includes.h @@ -1,10 +1,10 @@ ---- logtool/includes.h.orig Wed Jan 10 04:18:00 2001 -+++ src/includes.h Wed Jan 10 04:20:00 2001 -@@ -22,6 +22,7 @@ +--- src/includes.h.orig 2003-05-02 17:44:53 UTC ++++ src/includes.h +@@ -27,6 +27,7 @@ #include #include #include +#include #include #include - + #include diff --git a/sysutils/logtool/files/patch-src_logtool.h b/sysutils/logtool/files/patch-src_logtool.h new file mode 100644 index 000000000000..41cd0dfdacba --- /dev/null +++ b/sysutils/logtool/files/patch-src_logtool.h @@ -0,0 +1,44 @@ +--- src/logtool.h.orig 2003-05-29 22:36:57 UTC ++++ src/logtool.h +@@ -82,7 +82,7 @@ int strncasecmp(const char *s1, const char *s2, size_t + #endif + + /* this is a global variable we use to pass around hostname's */ +-char lt_host[LSIZE]; ++extern char lt_host[LSIZE]; + + /* + * This is the structure each line of syslog file get's parsed into. +@@ -105,7 +105,7 @@ typedef struct { + char pmsg[(LSIZE * 4)]; /* where we store the string we're going to print */ + MOD m; /* pointer to where we store extra data for mod_* events*/ + } st_event; +-st_event event; ++extern st_event event; + + /* Structure for the event color variables */ + typedef struct { +@@ -137,7 +137,7 @@ typedef struct { + char unknown[256]; /* \033u */ + char end[256]; /* \033e */ + } st_color; +-st_color color; ++extern st_color color; + + typedef struct { + char configfile[1024]; /* ascii name of our config file */ +@@ -158,7 +158,7 @@ typedef struct { + short int resolv; /* disable host resolution, even if enabled in cfg file */ + } CONFIG; + +-CONFIG cf; ++extern CONFIG cf; + + extern int errno; /* the error number thing from the errno functions */ + +@@ -242,4 +242,4 @@ typedef struct { + regex_t include_reg; + } STRUCTURE_REGEXS; + +-STRUCTURE_REGEXS reg; ++extern STRUCTURE_REGEXS reg; diff --git a/sysutils/logtool/files/patch-src_mod__iptables.c b/sysutils/logtool/files/patch-src_mod__iptables.c new file mode 100644 index 000000000000..049016865a89 --- /dev/null +++ b/sysutils/logtool/files/patch-src_mod__iptables.c @@ -0,0 +1,11 @@ +--- src/mod_iptables.c.orig 2003-04-17 11:18:16 UTC ++++ src/mod_iptables.c +@@ -21,6 +21,8 @@ + /* Yee ole includes (I put this all in one file for my sanity) */ + #include "includes.h" + ++IPTABLES it; ++ + /* + * a module to process iptables messages into something sane to read with the naked eye + */ diff --git a/sysutils/logtool/files/patch-src_mod__snort.c b/sysutils/logtool/files/patch-src_mod__snort.c new file mode 100644 index 000000000000..77be64b44b75 --- /dev/null +++ b/sysutils/logtool/files/patch-src_mod__snort.c @@ -0,0 +1,11 @@ +--- src/mod_snort.c.orig 2003-05-02 16:38:33 UTC ++++ src/mod_snort.c +@@ -21,7 +21,7 @@ + /* Yee ole includes (I put this all in one file for my sanity) */ + #include "includes.h" + +- ++SNORT sn; + + /* + * NOTES: diff --git a/sysutils/logtool/files/patch-src_mods.h b/sysutils/logtool/files/patch-src_mods.h new file mode 100644 index 000000000000..c2d760025f6d --- /dev/null +++ b/sysutils/logtool/files/patch-src_mods.h @@ -0,0 +1,37 @@ +--- src/mods.h.orig 2003-04-17 11:21:37 UTC ++++ src/mods.h +@@ -45,12 +45,12 @@ short int ltm_iptables(); + char *get_host(char *host); + + /* for the snort log lines (this one's a bit complicated) */ +-short int ltm_snort(); ++extern short int ltm_snort(); + + /* variables to tell us if we're to use the functions in question or not */ +-short int ltm_use_syslog; +-short int ltm_use_snort; +-short int ltm_use_sudo; ++extern short int ltm_use_syslog; ++extern short int ltm_use_snort; ++extern short int ltm_use_sudo; + /* "ltm_unknown(); we allways have enabled (otherwise, what's the use? */ + + /* data structs for iptables and snort and so-on for linking in event->special */ +@@ -66,7 +66,7 @@ typedef struct { + char class[512]; /* Classification: field */ + char prior[512]; /* Priority: field */ + } SNORT; +-SNORT sn; ++extern SNORT sn; + + /* repeat for iptables variables */ + typedef struct { +@@ -84,7 +84,7 @@ typedef struct { + char ttl[64]; /* TTL=ttl packet time to live */ + char proto[64]; /* PROTO=UDP protocol of datagram */ + } IPTABLES; +-IPTABLES it; ++extern IPTABLES it; + + /* a wrapper struct so's we can point to structs like the above from + * event.* struct (see logtool.h for this struct) */ diff --git a/sysutils/logtool/files/patch-src_parser.c b/sysutils/logtool/files/patch-src_parser.c new file mode 100644 index 000000000000..217b556a32b5 --- /dev/null +++ b/sysutils/logtool/files/patch-src_parser.c @@ -0,0 +1,11 @@ +--- src/parser.c.orig 2003-05-29 18:13:56 UTC ++++ src/parser.c +@@ -20,6 +20,8 @@ + + #include "includes.h" + ++st_event event; ++ + /* a parsing function to do a string replacement (sorta like sed w/o the extended syntax) */ + + /* A function to do string replacement's (a bit like sed) */ diff --git a/sysutils/logtool/files/patch-src_readconf.c b/sysutils/logtool/files/patch-src_readconf.c new file mode 100644 index 000000000000..1cbe38a85eba --- /dev/null +++ b/sysutils/logtool/files/patch-src_readconf.c @@ -0,0 +1,13 @@ +--- src/readconf.c.orig 2003-04-17 11:12:41 UTC ++++ src/readconf.c +@@ -19,6 +19,10 @@ + */ + + #include "includes.h" ++ ++CONFIG cf; ++STRUCTURE_REGEXS reg; ++ + void lt_set_config_err(char *option, char *val) { + printf("Error: invalid value [%s] to option [%s] in cfg file\n", val, option); + exit (1);