diff options
Diffstat (limited to 'net-analyzer/symon')
-rw-r--r-- | net-analyzer/symon/Manifest | 4 | ||||
-rw-r--r-- | net-analyzer/symon/files/symon-2.89-condition-makefiles.patch | 39 | ||||
-rw-r--r-- | net-analyzer/symon/files/symon-2.89-extern_c.patch | 441 | ||||
-rw-r--r-- | net-analyzer/symon/symon-2.89.ebuild | 99 |
4 files changed, 583 insertions, 0 deletions
diff --git a/net-analyzer/symon/Manifest b/net-analyzer/symon/Manifest index e8a8c1179e52..fed783e28ca3 100644 --- a/net-analyzer/symon/Manifest +++ b/net-analyzer/symon/Manifest @@ -1,7 +1,11 @@ +AUX symon-2.89-condition-makefiles.patch 793 BLAKE2B 5b3c1ad062527a71ec43385461787497e3dfa224246dbaf4d92a9e607bc3636c3aaf24c348f36ed299ee39a6471c052bf98483bbe407e6ee0a33f0db441edcc3 SHA512 d3733904ccbafab0318f00f1f63a761fb2dc24b24c10d471ed0b420bd96dccb45c5a46304205aa5014207da38373768990fde2f1dcf68b1b902b2596ebeced67 +AUX symon-2.89-extern_c.patch 8640 BLAKE2B 0a248da8302eee752d899e38ef43f43987c80aabffc9582d534dca05169d6809d33e0808e9471020769cf94f8d7b38568c6d3159415254b36ea35895d265d37e SHA512 2452e642ef34945236dc607405f87acebfde86ae13dbf09d601e3c63bcb6953de0478daed46f3d742b9ab61eb919728739ff7acf4786ec3c2bc5049376318187 AUX symon-init.d 554 BLAKE2B 0bb42706009565db50396176e93931ede24221488db03d5b4139f847e8ab6f2991da131d33a5675456602dca149bd7f431d35a19854965f3407b42a0942ffaa9 SHA512 5d9261c9784e17c39717fa7b446ab7e840e356549a687b423f28cb3bc0af03f4ee27652fea0ce4c7116d02eddd3adf7a417e61430b0cd4b21a9b286d484856a6 AUX symon.conf 313 BLAKE2B ab28f18000d5c20b2d2f690d2b77ed1d43339582bf5c7bb44c5b3bc16b9befabd2edb76de42856925cd8e342a3177de59b38ddb8e86c5c2ccbb0ec2bdcbcc18f SHA512 9d83d316a5024c0fc5a9c487113088548e6ba193360d684b162d39e0373bc478ebdb40b7ce508c0de2287de6684c75cfcf2f312e34e9def1dcaaeb0036ecab56 AUX symux-init.d 548 BLAKE2B 2affcdfeddc941aa1220e00aa5e88fc673f494f591afb3b40d6e67235df2423b4dfdebdb0f389dc4e370c33d379d9c16bc98eb2421036640c2a37efdbb5da16a SHA512 0f494d3d141cfcc800d33dc0ed364fafaf713811ec8a8ccec7a77b421888aff42546ad742bdaf3928c49bf61d76b97fd3f2fc8992fadf1d1c499c9a1aeada11d AUX symux.conf 952 BLAKE2B cbe1effaf2b9678575a2ef938432e6bc6aa7f2b13248a111ff2f821e10f6d70d4894d1682dccb2f55a702435d07bf93751f0d1417334fd77bf8bda878f2752da SHA512 5f7aa2d069ed6cb58dfc6ce7ab192f1486256551c1315b86b0216c56d4ee93d84101168c5ee8c1507729136dcd05c7a09cc9c901f132c5fc8015b2502bc15272 DIST symon-2.88.tar.gz 110149 BLAKE2B 918ecf6c87a363e85ce67f9890b2ff6d326f14f896cb85ee6e501b962cb4e476b8fab9d6a96857e63e34aa2ebd2036fbb507c52d74b66b59ff7d77c7bc571474 SHA512 d2079caefcde4cf017460560826c7bf9e97aee9dcce886cd0a85d671bdad877c513889c9b7cd67844dbb4161ce6b6e6f99709475dd2591141f1bc61ee11e8173 +DIST symon-2.89.tar.gz 106210 BLAKE2B d87fececf6e1e6dc9c39c0474e2a3e5bb6bb47b9a256e377385302a011532d94b751572040594b62962d4b2c2ac2d5bbd90513a79ab82bd69aeb4f30e93609a1 SHA512 631870aafbd29610a0ddc936f86ab12c16c3b19454b6bd98b3f1a1179767be890f9ea828dddcb8d79278f2c10b67631184386d6deb8ffb5c090d7bdc558e5db7 EBUILD symon-2.88.ebuild 2216 BLAKE2B 953f76211ed063bde873755819fda19710f8ffb828e0ee5f27afea85f4d1629d9306c81fcb4921919b8a42fe99d5db990d955138cb656ab636731b14c0f59317 SHA512 07d2e3522f42eedef48259b7f902119ee0185ec372ed86ab69d77c40dacf22f2ab433febe6c25026cfaec46f1ec75a30dddbb9b7f6512d15ed427ac3cb4574b1 +EBUILD symon-2.89.ebuild 2263 BLAKE2B ad6d0282d1044995f3ee4a4617c31ae60122334cacada8b94f86d569adcfd216271af535a8a1f915e32dbe8cb3abca55c89a5e3ae0a568482186f2ea17bb832e SHA512 018ec6835cdcac5d520662552bd60e1b537ba503a21db374c108f33aec53a0868986fb3a3e4976cae53aec61b36071f030b8ab3a3d84ad0291caff52afafb7f9 MISC metadata.xml 633 BLAKE2B f48fb079c3d60ebc433a6795e9edbdd269b9b752dd0d437a8744e5740d6a27f742fb9d55dbd74b5ec4fcb60e796f7cb3b928560c5cfc0dd83dd94f0707cdfc42 SHA512 f145aa2a9fede34d6d4be72dfecd706880e8ff71eedae7026600bb7ec179ad5f3516e04448990fd1b9607bc0e9709bd39c171573531ade086628ceafefd38562 diff --git a/net-analyzer/symon/files/symon-2.89-condition-makefiles.patch b/net-analyzer/symon/files/symon-2.89-condition-makefiles.patch new file mode 100644 index 000000000000..76ff4f517da7 --- /dev/null +++ b/net-analyzer/symon/files/symon-2.89-condition-makefiles.patch @@ -0,0 +1,39 @@ +Fold sed that injects LDFLAGS. Inject CFLAGS too. +Remove hardcoded CFLAGS. Remove strip that previously was sidestepped +by setting STRIP=true in ebuild +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -2,7 +2,6 @@ + + AR?= ar + CC?= cc +-CFLAGS+=-g -Wall -Wpedantic -Wextra -Wno-unused-parameter -Werror + INSTALL?=install + LORDER?=lorder + TSORT?=tsort +--- a/symon/Makefile ++++ b/symon/Makefile +@@ -21,9 +21,8 @@ + ${OBJS}: conf.h + + symon: ${OBJS} +- ${CC} -o $@ ${OBJS} ${LIBS} ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ ${OBJS} ${LIBS} + .ifndef DEBUG +- ${STRIP} $@ + .endif + + clean: +--- a/symux/Makefile ++++ b/symux/Makefile +@@ -10,9 +10,8 @@ + all: symux symux.cat8 + + symux: ${OBJS} +- ${CC} -o $@ ${OBJS} ${LIBS} ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ ${OBJS} ${LIBS} + .ifndef DEBUG +- ${STRIP} $@ + .endif + + clean: diff --git a/net-analyzer/symon/files/symon-2.89-extern_c.patch b/net-analyzer/symon/files/symon-2.89-extern_c.patch new file mode 100644 index 000000000000..088f8c53ec6c --- /dev/null +++ b/net-analyzer/symon/files/symon-2.89-extern_c.patch @@ -0,0 +1,441 @@ +Replace internal glib definition with correct C++ guard +https://bugs.gentoo.org/716080 +--- a/lib/data.c ++++ b/lib/data.c +@@ -54,14 +54,18 @@ + #include "net.h" + #include "xmalloc.h" + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int bytelenvar(char); + int checklen(int, int, int); + struct stream *create_stream(int, char *); + char *formatstrvar(char); + char *rrdstrvar(char); + int strlenvar(char); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* Stream formats + * +--- a/lib/data.h ++++ b/lib/data.h +@@ -38,6 +38,8 @@ + #ifndef _SYMON_LIB_DATA_H + #define _SYMON_LIB_DATA_H + ++#include <sys/types.h> ++ + #include "platform.h" + + #include <stdarg.h> + +--- a/lib/error.c ++++ b/lib/error.c +@@ -27,8 +27,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + * + */ +-#include <sys/cdefs.h> +- + #include <limits.h> + #include <stdarg.h> + #include <stdio.h> +@@ -38,9 +36,13 @@ + + #include "error.h" + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + void output_message(int, char *, va_list); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + int flag_daemon = 0; + int flag_debug = 0; +--- a/lib/error.h ++++ b/lib/error.h +@@ -31,17 +31,19 @@ + #ifndef _SYMON_LIB_ERROR_H + #define _SYMON_LIB_ERROR_H + +-#include <sys/cdefs.h> +- + extern char *__progname; + extern int flag_debug; + extern int flag_daemon; + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + void fatal(char *,...); + void warning(char *,...); + void info(char *,...); + void debug(char *,...); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* _SYMON_LIB_ERROR_H */ +--- a/lib/lex.h ++++ b/lib/lex.h +@@ -36,8 +36,6 @@ + #ifndef _SYMON_LIB_LEX_H + #define _SYMON_LIB_LEX_H + +-#include <sys/cdefs.h> +- + #include <stdio.h> + + /* Tokens known to lex */ +@@ -100,7 +98,9 @@ + type; /* type of token in buffer */ + }; + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + char *parse_opcode(int); + int lex_nexttoken(struct lex *); + int parse_token(const char *); +@@ -110,7 +110,9 @@ + void parse_error(struct lex *, const char *); + void reset_lex(struct lex *); + void rewind_lex(struct lex *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* EXPECT(l,x) = next token in l must be opcode x or error. */ + #define EXPECT(l, x) do { \ +--- a/lib/net.h ++++ b/lib/net.h +@@ -40,7 +40,9 @@ + extern char res_service[]; + extern struct sockaddr_storage res_addr; + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int cmpsock_addr(struct sockaddr *, struct sockaddr *); + int get_numeric_name(struct sockaddr_storage *); + int getaddr(char *, char *, int, int); +@@ -50,6 +52,8 @@ + void get_sockaddr(struct sockaddr_storage *, int, int, int, char*, char *); + void get_mux_sockaddr(struct mux *, int); + int get_source_sockaddr(struct source *, int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* _SYMON_LIB_NET_H */ +--- a/lib/xmalloc.h ++++ b/lib/xmalloc.h +@@ -18,10 +18,14 @@ + #include <sys/types.h> + + /* Like malloc and friends, but these call fatal if something breaks */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + void *xmalloc(size_t); + void *xrealloc(void *, size_t); + void xfree(void *); + char *xstrdup(const char *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + #endif /* _SYMON_LIB_XMALLOC_H */ +--- a/symon/readconf.c ++++ b/symon/readconf.c +@@ -40,11 +40,15 @@ + #include "symon.h" + #include "xmalloc.h" + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int read_host_port(struct muxlist *, struct mux *, struct lex *); + int read_symon_args(struct mux *, struct lex *); + int read_monitor(struct muxlist *, struct lex *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + const char *default_symux_port = SYMUX_PORT; + +--- a/symon/readconf.h ++++ b/symon/readconf.h +@@ -33,7 +33,11 @@ + + #include "data.h" + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int read_config_file(struct muxlist *, char *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + #endif /* _SYMON_READCONF_H */ +--- a/symon/symon.c ++++ b/symon/symon.c +@@ -53,13 +53,17 @@ + #include "symonnet.h" + #include "xmalloc.h" + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + void alarmhandler(int); + void exithandler(int); + void huphandler(int); + void init_streams(struct muxlist *mul); + void drop_privileges(int unsecure); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + int flag_unsecure = 0; + int flag_hup = 0; +--- a/symon/symon.h ++++ b/symon/symon.h +@@ -59,7 +59,9 @@ + extern time_t now; + + /* prototypes */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + /* sm_cpu.c */ + extern void init_cpu(struct stream *); + extern void gets_cpu(void); +@@ -136,6 +138,8 @@ + void gets_flukso(void); + int get_flukso(char *, int, struct stream *); + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* _SYMON_SYMON_H */ +--- a/symon/symonnet.h ++++ b/symon/symonnet.h +@@ -34,11 +34,15 @@ + #include "data.h" + + /* prototypes */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + void connect2mux(struct mux *); + void send_packet(struct mux *); + void prepare_packet(struct mux *, time_t t); + void stream_in_packet(struct stream *, struct mux *); + void finish_packet(struct mux *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + #endif /* _SYMON_SYMONNET_H */ +--- a/symux/readconf.c ++++ b/symux/readconf.c +@@ -28,8 +28,8 @@ + * + */ + +-#include <sys/stat.h> ++#include <sys/stat.h> + + #include <string.h> + #include <fcntl.h> + #include <unistd.h> +@@ -42,12 +42,15 @@ + #include "readconf.h" + #include "xmalloc.h" + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int read_mux(struct muxlist * mul, struct lex *); + int read_source(struct sourcelist * sol, struct lex *, int); + int insert_filename(char *, int, int, char *); +-__END_DECLS +- ++#ifdef __cplusplus ++} ++#endif + const char *default_symux_port = SYMUX_PORT; + + int +--- a/symux/readconf.h ++++ b/symux/readconf.h +@@ -34,8 +34,12 @@ + + #include "data.h" + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int read_config_file(struct muxlist *, const char *, int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* _SYMUX_READCONF_H */ +--- a/symux/share.c ++++ b/symux/share.c +@@ -76,7 +76,9 @@ + * + */ + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + void check_master(void); + void check_sem(void); + void client_doneread(void); +@@ -86,7 +88,9 @@ + void exitmaster(void); + void master_resetsem(int); + void reap_clients(void); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + int realclients; /* number of clients active */ + int newclients; +--- a/symux/share.h ++++ b/symux/share.h +@@ -47,7 +47,9 @@ + }; + + /* prototypes */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int master_forbidread(void); + void master_permitread(void); + long shared_getlen(int); +@@ -56,6 +58,8 @@ + void initshare(int); + void shared_setlen(int, long); + pid_t spawn_client(int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* _SYMUX_SHARE_H */ +--- a/symux/symux.c ++++ b/symux/symux.c +@@ -56,11 +56,15 @@ + + #include "platform.h" + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + void exithandler(int); + void huphandler(int); + void signalhandler(int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + int flag_hup = 0; + int flag_testconf = 0; +--- a/symux/symuxnet.c ++++ b/symux/symuxnet.c +@@ -46,9 +46,13 @@ + #include "xmalloc.h" + #include "share.h" + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int check_crc_packet(struct symonpacket *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* Obtain sockets for incoming symon traffic */ + int +--- a/symux/symuxnet.h ++++ b/symux/symuxnet.h +@@ -34,11 +34,15 @@ + #include "data.h" + + /* prototypes */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int get_client_socket(struct mux *); + int get_symon_sockets(struct mux *); + int accept_connection(int); + int recv_symon_packet(struct mux *, int, struct source **); + void wait_for_traffic(struct mux *, struct source **); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + #endif /* _SYMUX_SYMUXNET_H */ +--- a/lib/data.h ++++ b/lib/data.h +@@ -358,7 +360,9 @@ + }; + + /* prototypes */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + char *type2str(const int); + int bytelen_sourcelist(struct sourcelist *); + int bytelen_streamlist(struct streamlist *); +@@ -393,5 +397,7 @@ + void init_crc32(void); + void init_symon_packet(struct mux *); + void init_symux_packet(struct mux *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + #endif /* _SYMON_LIB_DATA_H */ diff --git a/net-analyzer/symon/symon-2.89.ebuild b/net-analyzer/symon/symon-2.89.ebuild new file mode 100644 index 000000000000..ae76643393c0 --- /dev/null +++ b/net-analyzer/symon/symon-2.89.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit edo perl-module toolchain-funcs + +DESCRIPTION="Performance and information monitoring tool" +HOMEPAGE="https://wpd.home.xs4all.nl/symon/" +SRC_URI="https://wpd.home.xs4all.nl/symon/philes/${P}.tar.gz" +S="${WORKDIR}"/${PN} + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64 ~sparc ~x86" +IUSE="perl +symon symux" +REQUIRED_USE="|| ( perl symon symux )" +# there are no tests, trying to run them fails because pmakefile +RESTRICT="test" + +BDEPEND="dev-build/pmake" +RDEPEND=" + perl? ( dev-lang/perl ) + symux? ( net-analyzer/rrdtool ) +" +DEPEND="${RDEPEND}" + +# Deletes the directory passed as an argument from the internal pmake +# variable SUBDIR. +zap_subdir() { + sed -i "/^SUBDIR/s|$1||" Makefile || die +} + +PATCHES=( + "${FILESDIR}/${P}-condition-makefiles.patch" + "${FILESDIR}/${P}-extern_c.patch" +) + +src_configure() { + # Do some sed magic in accordance with the USE flags. + use perl && ! use symon && ! use symux && zap_subdir lib + ! use perl && zap_subdir client + ! use symux && zap_subdir symux + ! use symon && zap_subdir symon +} + +src_compile() { + edo pmake CC="$(tc-getCC)" CFLAGS+="${CFLAGS}" LDFLAGS+="${LDFLAGS}" +} + +src_install() { + if use symon; then + insinto /etc + doins "${FILESDIR}"/symon.conf + + newinitd "${FILESDIR}"/symon-init.d symon + + dodoc CHANGELOG HACKERS TODO + + doman symon/symon.8 + dosbin symon/symon + fi + + if use perl; then + dobin client/getsymonitem.pl + + perl_set_version + insinto ${VENDOR_LIB} + doins client/SymuxClient.pm + fi + + if use symux; then + insinto /etc + doins "${FILESDIR}"/symux.conf + + newinitd "${FILESDIR}"/symux-init.d symux + + doman symux/symux.8 + dosbin symux/symux + + insinto /usr/share/symon + doins symux/c_smrrds.sh + fperms a+x /usr/share/symon/c_smrrds.sh + + dodir /var/lib/symon/rrds/localhost + keepdir /var/lib/symon/rrds/localhost + fi +} + +pkg_postinst() { + if use symux; then + elog "The RRDs files can be obtained by running" + elog "/usr/share/symon/c_smrrds.sh all." + elog "For information about migrating RRDs from a previous" + elog "symux version read the LEGACY FORMATS section of symux(8)." + elog "To view the rrdtool pictures of the stored data, emerge" + elog "net-analyzer/syweb." + fi +} |