[patch] dockapps - wmnet - apply debian patches, use autotools

11 views
Skip to first unread message

Andreas Metzler

unread,
Aug 15, 2025, 12:22:15 PMAug 15
to wmake...@googlegroups.com
Hello,

I have generated a patch series from the patchset applied in the Debian
patches and added one to move away from xmkmf to autotools.

cu Andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
0001-Fix-FTBFS-on-alpha-ia64-hppa.patch
0002-Fix-drawing-problems-with-partially-covered-window.patch
0003-Translate-comments-from-previuous-patch-to-English.patch
0004-Add-command-line-option-to-choose-X-display-to-use.patch
0005-Escape-hyphens-in-manual-page.patch
0006-Fix-arrow-direction-to-match-manpage.patch
0007-spelling-fixes.patch
0008-Drop-compat-code-for-linux-llbc5.patch
0009-Use-GNU-auto-instead-of-xmkmf.patch
signature.asc

Carlos R. Mafra

unread,
Aug 15, 2025, 1:37:33 PMAug 15
to wmake...@googlegroups.com
Thanks. I added a prefix wmnet: to all your commits.

However, to my surprise I could not update the repo due to the current
situation of the internet in the UK,

https://repo.or.cz/uk-blocked.html

I will think of what to do next. Maybe I'll have to pay for a VPN :)
> --
> You received this message because you are subscribed to the Google Groups "Window Maker Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wmaker-dev+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/wmaker-dev/aJ9erT04q7hQJdVU%40argenau.bebt.de.

> From dc17f19bd73f65c2153e394edb70551a945d051b Mon Sep 17 00:00:00 2001
> From: Andreas Metzler <amet...@bebt.de>
> Date: Fri, 15 Aug 2025 11:08:56 +0200
> Subject: [PATCH 1/9] Fix FTBFS on alpha ia64 hppa
>
> signal_action.sa_restorer is not available there
> Original authors: Bart Warmerdam <ba...@xs4all.nl,
> LaMont Jones <lam...@smallone.fc.hp.com>
> https://bugs.debian.org/103274 https://bugs.debian.org/39246
> ---
> wmnet/wmnet.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/wmnet/wmnet.c b/wmnet/wmnet.c
> index 9873663..4ba5f18 100644
> --- a/wmnet/wmnet.c
> +++ b/wmnet/wmnet.c
> @@ -341,11 +341,13 @@ void setup_wmnet(int argc, char **argv) {
>
> signal_action.sa_handler = got_signal;
> sigemptyset(&signal_action.sa_mask);
> signal_action.sa_flags = (SA_NOCLDSTOP|SA_RESTART);
> #ifdef linux
> +#if !defined(__alpha) && !defined(__hppa__) && !defined(__ia64__) // Alpha doen't have this structure member
> signal_action.sa_restorer = NULL;
> +#endif
> #endif
> if ((sigaction(SIGCHLD, &signal_action, NULL) == -1) ||
> (sigaction(SIGINT, &signal_action, NULL) == -1) ||
> (sigaction(SIGTERM, &signal_action, NULL) == -1)) {
> fprintf(stderr,"wmnet: couldn't set signal handler\n");
> --
> 2.50.1
>

> From 010c568f1abc7d081baf68fadf6708f8f4a7377c Mon Sep 17 00:00:00 2001
> From: Andreas Metzler <amet...@bebt.de>
> Date: Fri, 15 Aug 2025 11:12:02 +0200
> Subject: [PATCH 2/9] Fix drawing problems with partially covered window.
>
> Original author: Trilobit <tr...@gmx.net>
> Bug-Debian: https://bugs.debian.org/221770
> ---
> wmnet/wmnet.c | 29 +++++++++++++++++++++++------
> wmnet/wmnet.h | 1 +
> 2 files changed, 24 insertions(+), 6 deletions(-)
>
> diff --git a/wmnet/wmnet.c b/wmnet/wmnet.c
> index 4ba5f18..c996fb0 100644
> --- a/wmnet/wmnet.c
> +++ b/wmnet/wmnet.c
> @@ -426,10 +426,12 @@ void setupX(void) {
> if (specified_state == -1) specified_state = NormalState;
> }
>
> root_window = DefaultRootWindow(dpy);
> createWin(&main_window);
> + /*Trilobit anlegen eines buffers als pixmap*/
> + buffer_pixmap=XCreatePixmap(dpy, root_window, 64, 64, DefaultDepth(dpy, screen));
>
> color.red = color.green = color.blue = 12000;
> XAllocColor(dpy, DefaultColormap(dpy, screen), &color);
> darkgrey_pixel = color.pixel;
>
> @@ -475,12 +477,17 @@ void setupX(void) {
> XStoreName(dpy, main_window, "wmnet");
> XShapeCombineRectangles(dpy, *visible_window, ShapeBounding, 4, 4, &bound, 1, ShapeBounding, 0);
> XSelectInput(dpy, *visible_window, (ExposureMask|ButtonPressMask));
> XMapSubwindows(dpy, *visible_window);
>
> + /*Trilobit initialisieren des Buffers:*/
> + XSetForeground(dpy, graphics_context, darkgrey_pixel);
> + XFillRectangle(dpy, buffer_pixmap, graphics_context, GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT);
> +
> }
>
> +/*************************** anfang zu verändern ************/
> /* Utility function to create a window for setupX() */
> void createWin(Window *win) {
> XClassHint classHint;
> XSetWindowAttributes windowAttrib;
> *win = XCreateSimpleWindow(dpy, root_window, 10, 10, 64, 64, 0, 0, 0);
> @@ -522,12 +529,14 @@ void redraw(XExposeEvent *ee) {
>
> XSetForeground(dpy, graphics_context, grey_pixel);
> XSetBackground(dpy, graphics_context, black_pixel);
> XCopyPlane(dpy, arrow, *visible_window, graphics_context, 7, 0, 7, 9, 53, 5, 1);
> XCopyPlane(dpy, arrow, *visible_window, graphics_context, 0, 0, 7, 9, 46, 5, 1);
> + /*Trilobit ganz billig, einfach buffer zurückschreiben:*/
> + XCopyArea(dpy, buffer_pixmap, *visible_window, graphics_context, GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y);
> }
> -
> +/******************* ende zu verändern *********************/
>
> /* Main loop that is called every delaytime. This calls stat_gather() and updateSpeedometer() when needed
> * and takes care of the displaying and scrolling the graph */
> void tock(void) {
> unsigned long since;
> @@ -570,31 +579,35 @@ void tock(void) {
> if (t == 7) updateSpeedometer(rate_rx, rate_tx);
>
> /* blank var is just for stopping executing the X* funcs when the disp is all black */
> if ((y == GRAPH_Y_BOTTOM && yy == GRAPH_Y_UPPER) && (diffbytes_in + diffbytes_out) == 0) blank++; else blank = 0;
> if (blank < (GRAPH_WIDTH + 1) ) {
> - XCopyArea(dpy, *visible_window, *visible_window, graphics_context, GRAPH_X + 1,
> + XCopyArea(dpy, buffer_pixmap, buffer_pixmap, graphics_context, GRAPH_X + 1,
> GRAPH_Y, GRAPH_WIDTH - 1, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y);
> XSetForeground(dpy, graphics_context, darkgrey_pixel);
> - XDrawLine(dpy, *visible_window, graphics_context, GRAPH_X_RIGHT, y, GRAPH_X_RIGHT, yy);
> + XDrawLine(dpy, buffer_pixmap, graphics_context, GRAPH_X_RIGHT, y, GRAPH_X_RIGHT, yy);
> if (( (yy == GRAPH_Y_UPPER && diffbytes_out > 0 && rate_rx > rate_tx) || (rate_rx >= rate_tx && yy != GRAPH_Y_UPPER)) ) {
> drawColoredLine(GRAPH_Y_UPPER, yy, tx_pixel);
> }
> if ( y != GRAPH_Y_BOTTOM || diffbytes_in > 0) {
> drawColoredLine(GRAPH_Y_BOTTOM, y, rx_pixel);
> }
> if (( (yy == GRAPH_Y_UPPER && diffbytes_out > 0) || (rate_rx < rate_tx && yy != GRAPH_Y_UPPER)) ) {
> drawColoredLine(GRAPH_Y_UPPER, yy, tx_pixel);
> }
> - }
>
> + /* Trilobit nachdem buffer zurechtgebastelt, den kram ins fenster kopieren: */
> + XCopyArea(dpy, buffer_pixmap, *visible_window, graphics_context, GRAPH_X,
> + GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y);
> + }/*END if blank*/
> +/************************* ende zu verändern *******************/
>
> diffbytes_in = diffbytes_out = 0;
> timelast = timenow;
> }
>
> - if (!stat_gather()) { /* Anything change? */
> + if (!stat_gather()) { /* Anything change? erneuert nur die Pfeilanzeigen */
> current_rx = rx;
> current_tx = tx;
> XSetBackground(dpy, graphics_context, black_pixel);
> if(current_tx == True) {
> XSetForeground(dpy, graphics_context, tx_pixel[HIGH_INTENSITY]);
> @@ -676,22 +689,26 @@ int updateSpeedometer(int rxRate, int txRate) {
> return(0);
>
> }
>
>
> +/*************************** anfang zu verändern ***************/
> /* called from within tock to draw the shaded lines making up our bar-graph */
> void drawColoredLine(int y1, int y2, unsigned long *shadecolor) {
> int subline[4], i;
> static unsigned int linebreaks[3] = { 50, 90, 100 };
> subline[0] = y1;
> for(i = 0; i < 3; i++) {
> if (y1 > y2) subline[i+1] = y1 - (((y1 - y2) * linebreaks[i]) / 100);
> else subline[i+1] = y1 + (((y2 - y1) * linebreaks[i]) / 100);
> XSetForeground(dpy, graphics_context, shadecolor[i]);
> - XDrawLine(dpy, *visible_window, graphics_context, GRAPH_X_RIGHT, subline[i], GRAPH_X_RIGHT, subline[i+1]);
> + /*Trilobit alles erstmal in meinen buffer schreiben: */
> + XDrawLine(dpy, buffer_pixmap, graphics_context, GRAPH_X_RIGHT, subline[i], GRAPH_X_RIGHT, subline[i+1]);
> + //XDrawLine(dpy, *visible_window, graphics_context, GRAPH_X_RIGHT, subline[i], GRAPH_X_RIGHT, subline[i+1]);
> }
> }
> +/************************* ende zu verändern *******************/
>
>
> /* Returns in returnarray a 3 value array containing 3 shades (low, normal, and high) of XColor shade.
> * Called from setup_wmnet on startup and never called again.
> */
> diff --git a/wmnet/wmnet.h b/wmnet/wmnet.h
> index 97a4b48..0c1254f 100644
> --- a/wmnet/wmnet.h
> +++ b/wmnet/wmnet.h
> @@ -64,10 +64,11 @@
> /* X Stuff */
> Display *dpy;
> Window root_window, main_window, icon_window, *visible_window;
> Font thefont;
> Pixmap arrow;
> +Pixmap buffer_pixmap; /*Trilobit pixmap als zwischenbuffer*/
> Atom delete_atom;
> int screen, specified_state = -1;
> GC graphics_context;
> unsigned long tx_pixel[3], rx_pixel[3], labelfg_pixel, labelbg_pixel, black_pixel, white_pixel, darkgrey_pixel, grey_pixel;
> typedef int (*parser_func)(void);
> --
> 2.50.1
>

> From b7f6c6e52031aa0982560d35dc9de2ee29a45dd0 Mon Sep 17 00:00:00 2001
> From: Andreas Metzler <amet...@bebt.de>
> Date: Fri, 15 Aug 2025 11:21:27 +0200
> Subject: [PATCH 3/9] Translate comments from previuous patch to English
>
> ---
> wmnet/wmnet.c | 18 ++++++------------
> wmnet/wmnet.h | 2 +-
> 2 files changed, 7 insertions(+), 13 deletions(-)
>
> diff --git a/wmnet/wmnet.c b/wmnet/wmnet.c
> index c996fb0..bec0035 100644
> --- a/wmnet/wmnet.c
> +++ b/wmnet/wmnet.c
> @@ -426,11 +426,11 @@ void setupX(void) {
> if (specified_state == -1) specified_state = NormalState;
> }
>
> root_window = DefaultRootWindow(dpy);
> createWin(&main_window);
> - /*Trilobit anlegen eines buffers als pixmap*/
> + /* generate buffers as pixmap */
> buffer_pixmap=XCreatePixmap(dpy, root_window, 64, 64, DefaultDepth(dpy, screen));
>
> color.red = color.green = color.blue = 12000;
> XAllocColor(dpy, DefaultColormap(dpy, screen), &color);
> darkgrey_pixel = color.pixel;
> @@ -477,17 +477,16 @@ void setupX(void) {
> XStoreName(dpy, main_window, "wmnet");
> XShapeCombineRectangles(dpy, *visible_window, ShapeBounding, 4, 4, &bound, 1, ShapeBounding, 0);
> XSelectInput(dpy, *visible_window, (ExposureMask|ButtonPressMask));
> XMapSubwindows(dpy, *visible_window);
>
> - /*Trilobit initialisieren des Buffers:*/
> + /* initialize buffer */
> XSetForeground(dpy, graphics_context, darkgrey_pixel);
> XFillRectangle(dpy, buffer_pixmap, graphics_context, GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT);
>
> }
>
> -/*************************** anfang zu verändern ************/
> /* Utility function to create a window for setupX() */
> void createWin(Window *win) {
> XClassHint classHint;
> XSetWindowAttributes windowAttrib;
> *win = XCreateSimpleWindow(dpy, root_window, 10, 10, 64, 64, 0, 0, 0);
> @@ -529,14 +528,13 @@ void redraw(XExposeEvent *ee) {
>
> XSetForeground(dpy, graphics_context, grey_pixel);
> XSetBackground(dpy, graphics_context, black_pixel);
> XCopyPlane(dpy, arrow, *visible_window, graphics_context, 7, 0, 7, 9, 53, 5, 1);
> XCopyPlane(dpy, arrow, *visible_window, graphics_context, 0, 0, 7, 9, 46, 5, 1);
> - /*Trilobit ganz billig, einfach buffer zurückschreiben:*/
> + /* write back from buffer */
> XCopyArea(dpy, buffer_pixmap, *visible_window, graphics_context, GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y);
> }
> -/******************* ende zu verändern *********************/
>
> /* Main loop that is called every delaytime. This calls stat_gather() and updateSpeedometer() when needed
> * and takes care of the displaying and scrolling the graph */
> void tock(void) {
> unsigned long since;
> @@ -593,21 +591,20 @@ void tock(void) {
> }
> if (( (yy == GRAPH_Y_UPPER && diffbytes_out > 0) || (rate_rx < rate_tx && yy != GRAPH_Y_UPPER)) ) {
> drawColoredLine(GRAPH_Y_UPPER, yy, tx_pixel);
> }
>
> - /* Trilobit nachdem buffer zurechtgebastelt, den kram ins fenster kopieren: */
> + /* copy buffer to window */
> XCopyArea(dpy, buffer_pixmap, *visible_window, graphics_context, GRAPH_X,
> GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y);
> }/*END if blank*/
> -/************************* ende zu verändern *******************/
>
> diffbytes_in = diffbytes_out = 0;
> timelast = timenow;
> }
>
> - if (!stat_gather()) { /* Anything change? erneuert nur die Pfeilanzeigen */
> + if (!stat_gather()) { /* Anything change? - refresh arrows */
> current_rx = rx;
> current_tx = tx;
> XSetBackground(dpy, graphics_context, black_pixel);
> if(current_tx == True) {
> XSetForeground(dpy, graphics_context, tx_pixel[HIGH_INTENSITY]);
> @@ -689,26 +686,23 @@ int updateSpeedometer(int rxRate, int txRate) {
> return(0);
>
> }
>
>
> -/*************************** anfang zu verändern ***************/
> /* called from within tock to draw the shaded lines making up our bar-graph */
> void drawColoredLine(int y1, int y2, unsigned long *shadecolor) {
> int subline[4], i;
> static unsigned int linebreaks[3] = { 50, 90, 100 };
> subline[0] = y1;
> for(i = 0; i < 3; i++) {
> if (y1 > y2) subline[i+1] = y1 - (((y1 - y2) * linebreaks[i]) / 100);
> else subline[i+1] = y1 + (((y2 - y1) * linebreaks[i]) / 100);
> XSetForeground(dpy, graphics_context, shadecolor[i]);
> - /*Trilobit alles erstmal in meinen buffer schreiben: */
> + /* write to buffer */
> XDrawLine(dpy, buffer_pixmap, graphics_context, GRAPH_X_RIGHT, subline[i], GRAPH_X_RIGHT, subline[i+1]);
> - //XDrawLine(dpy, *visible_window, graphics_context, GRAPH_X_RIGHT, subline[i], GRAPH_X_RIGHT, subline[i+1]);
> }
> }
> -/************************* ende zu verändern *******************/
>
>
> /* Returns in returnarray a 3 value array containing 3 shades (low, normal, and high) of XColor shade.
> * Called from setup_wmnet on startup and never called again.
> */
> diff --git a/wmnet/wmnet.h b/wmnet/wmnet.h
> index 0c1254f..acb7843 100644
> --- a/wmnet/wmnet.h
> +++ b/wmnet/wmnet.h
> @@ -64,11 +64,11 @@
> /* X Stuff */
> Display *dpy;
> Window root_window, main_window, icon_window, *visible_window;
> Font thefont;
> Pixmap arrow;
> -Pixmap buffer_pixmap; /*Trilobit pixmap als zwischenbuffer*/
> +Pixmap buffer_pixmap; /* pixmap used as buffer */
> Atom delete_atom;
> int screen, specified_state = -1;
> GC graphics_context;
> unsigned long tx_pixel[3], rx_pixel[3], labelfg_pixel, labelbg_pixel, black_pixel, white_pixel, darkgrey_pixel, grey_pixel;
> typedef int (*parser_func)(void);
> --
> 2.50.1
>

> From 271353166195626115797232738821b3c513bac4 Mon Sep 17 00:00:00 2001
> From: Andreas Metzler <amet...@bebt.de>
> Date: Fri, 15 Aug 2025 11:23:01 +0200
> Subject: [PATCH 4/9] Add command line option to choose X display to use.
>
> original author: Armin Kretschmer <armin.kr...@vr-web.de>
> ---
> wmnet/wmnet.c | 15 ++++++++++-----
> wmnet/wmnet.h | 1 +
> wmnet/wmnet.man | 3 +++
> 3 files changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/wmnet/wmnet.c b/wmnet/wmnet.c
> index bec0035..3b2a34a 100644
> --- a/wmnet/wmnet.c
> +++ b/wmnet/wmnet.c
> @@ -98,13 +98,13 @@ void setup_wmnet(int argc, char **argv) {
> XColor thecolor;
> struct sigaction signal_action;
> char *txcolorString = NULL, *rxcolorString = NULL, *labelfgcolorString = NULL, *labelbgcolorString = NULL;
> char *parser = NULL;
> #ifdef linux
> - const struct option long_options[19] = {
> + const struct option long_options[20] = {
> #else
> - const struct option long_options[17] = {
> + const struct option long_options[18] = {
> #endif
> {"device", required_argument, NULL, 'W'},
> {"label", required_argument, NULL, 'L'},
> {"labelfg", required_argument, NULL, 'F'},
> {"labelbg", required_argument, NULL, 'B'},
> @@ -122,28 +122,32 @@ void setup_wmnet(int argc, char **argv) {
> {"normalstate", no_argument, NULL, 'n'},
> {"promisc", required_argument, NULL, 'p'},
> {"unpromisc", required_argument, NULL, 'u'},
> {"driver", required_argument, NULL, 'D'},
> {"version", no_argument, NULL, 'v'},
> + {"display", required_argument, NULL, 'X'},
> {0, 0, 0, 0}
> };
>
>
>
> /* Get options */
> #ifdef linux
> - while((c = getopt_long(argc, argv, "W:F:B:L:vp:u:wnle:R:T:r:t:D:d:x:h", long_options, NULL)) != EOF) {
> + while((c = getopt_long(argc, argv, "W:F:B:L:X:vp:u:wnle:R:T:r:t:D:d:x:h", long_options, NULL)) != EOF) {
> #else
> - while((c = getopt_long(argc, argv, "W:F:B:L:vp:u:wnle:r:t:D:d:x:h", long_options, NULL)) != EOF) {
> + while((c = getopt_long(argc, argv, "W:F:B:L:X:vp:u:wnle:r:t:D:d:x:h", long_options, NULL)) != EOF) {
> #endif
> switch(c) {
> case 'v':
> printf("wmnet 1.06\n"
> "Copyright (C) 1998, 2000 Jesse B. Off, Katharine Osborne <ka...@digitalkaos.net>\n"
> "This program is released under the terms of the GNU Public License.\n");
> exit(14);
> break;
> + case 'X':
> + dpy_name = strdup(optarg);
> + break;
> case 'W':
> device = strdup(optarg);
> break;
> case 'D':
> parser = strdup(optarg);
> @@ -278,10 +282,11 @@ void setup_wmnet(int argc, char **argv) {
> printf("wmnet-- v1.06 Katharine Osborne <ka...@digitalkaos.net>\n"
> "http://www.digitalkaos.net/linux/wmnet/\n"
> "-----------------------------------------------------\n"
> " -h, --help this help\n"
> " -v, --version display version information\n"
> + " -X, --display X server to contact\n"
> " -L, --label=LABEL display LABEL on bottom of window\n"
> " -F, --labelfg=COLOR foreground color for the label\n"
> " -B, --labelbg=COLOR background color for the label\n"
> " -e, --execute=COMMAND run COMMAND on click\n"
> #ifdef linux
> @@ -326,11 +331,11 @@ void setup_wmnet(int argc, char **argv) {
> perror("wmnet: chdir()");
> exit(16);
> }
>
> /* Open X Display */
> - if ((dpy = XOpenDisplay(NULL)) == NULL) {
> + if ((dpy = XOpenDisplay(dpy_name)) == NULL) {
> fprintf(stderr,"wmnet: doh...can't connect to X server, giving up\n");
> exit(1);
> }
>
> /* assure ourself for a graceful exit */
> diff --git a/wmnet/wmnet.h b/wmnet/wmnet.h
> index acb7843..2125748 100644
> --- a/wmnet/wmnet.h
> +++ b/wmnet/wmnet.h
> @@ -61,10 +61,11 @@
>
>
>
> /* X Stuff */
> Display *dpy;
> +char *dpy_name = NULL;
> Window root_window, main_window, icon_window, *visible_window;
> Font thefont;
> Pixmap arrow;
> Pixmap buffer_pixmap; /* pixmap used as buffer */
> Atom delete_atom;
> diff --git a/wmnet/wmnet.man b/wmnet/wmnet.man
> index 3a04649..04f5d01 100644
> --- a/wmnet/wmnet.man
> +++ b/wmnet/wmnet.man
> @@ -111,10 +111,13 @@ with the -h switch.
> .TP
> .B -W,--device=\fIDEVICE
> watch statistics for \fIDEVICE \fP. This option is only used for certain
> stat drivers, namely: kmem, devstats, and pppstats. The ipchains and ipfwadm
> stat drivers do not use this parameter.
> +.TP
> +.B \-X,\-\-display=\fDISPLAY
> +X display to use.
> .SH STAT DRIVERS
> wmnet uses different stat drivers to get the stats it needs to monitor your
> network. Exactly what drivers are available is determined at compile time. The
> driver wmnet ultimately uses at runtime is dependent on your system. There
> are 4 drivers specific to Linux and 1 to *BSD. The driver used can be overridden
> --
> 2.50.1
>

> From 3949a93568bfe04e431fdc521ec285215190d1a5 Mon Sep 17 00:00:00 2001
> From: Andreas Metzler <amet...@bebt.de>
> Date: Fri, 15 Aug 2025 11:24:43 +0200
> Subject: [PATCH 5/9] Escape hyphens in manual page
>
> original authors: Sandro Tosi <mo...@debian.org>,
> Andreas Metzler <amet...@debian.org>
> ---
> wmnet/wmnet.man | 90 ++++++++++++++++++++++++-------------------------
> 1 file changed, 45 insertions(+), 45 deletions(-)
>
> diff --git a/wmnet/wmnet.man b/wmnet/wmnet.man
> index 04f5d01..4997a9c 100644
> --- a/wmnet/wmnet.man
> +++ b/wmnet/wmnet.man
> @@ -3,28 +3,28 @@
> .TH wmnet 1x "4 May 2000"
> .SH NAME
> wmnet \- an IP accounting monitoring tool
> .SH SYNOPSIS
> .B wmnet
> -.RB [\| -h,--help \|]
> -.RB [\| -v,--version \|]
> -.RB [\| -T,--txrule=\fINUM \|]
> -.RB [\| -R,--rxrule=\fINUM \|]
> -.RB [\| -l,--logscale \|]
> -.RB [\| -t,--txcolor=\fICOLOR \|]
> -.RB [\| -r,--rxcolor=\fICOLOR \|]
> -.RB [\| -d\ \fIDELAY \|]
> -.RB [\| -x,--maxrate=\fIBYTES \|]
> -.RB [\| -F,--labelfg=\fICOLOR \|]
> -.RB [\| -B,--labelbg=\fICOLOR \|]
> -.RB [\| -L,--label=\fILABEL \|]
> -.RB [\| -e,--execute=\fICOMMAND \|]
> -.RB [\| -p,--promisc=\fIDEVICE \|]
> -.RB [\| -u,--unpromisc=\fIDEVICE \|]
> -.RB [\| -w,--withdrawn\ |\ -n,--normalstate \|]
> -.RB [\| -D,--driver=\fIDRIVER \|]
> -.RB [\| -W,--device=\fIDEVICE \|]
> +.RB [\| \-h,\-\-help \|]
> +.RB [\| \-v,\-\-version \|]
> +.RB [\| \-T,\-\-txrule=\fINUM \|]
> +.RB [\| \-R,\-\-rxrule=\fINUM \|]
> +.RB [\| \-l,\-\-logscale \|]
> +.RB [\| \-t,\-\-txcolor=\fICOLOR \|]
> +.RB [\| \-r,\-\-rxcolor=\fICOLOR \|]
> +.RB [\| \-d\ \fIDELAY \|]
> +.RB [\| \-x,\-\-maxrate=\fIBYTES \|]
> +.RB [\| \-F,\-\-labelfg=\fICOLOR \|]
> +.RB [\| \-B,\-\-labelbg=\fICOLOR \|]
> +.RB [\| \-L,\-\-label=\fILABEL \|]
> +.RB [\| \-e,\-\-execute=\fICOMMAND \|]
> +.RB [\| \-p,\-\-promisc=\fIDEVICE \|]
> +.RB [\| \-u,\-\-unpromisc=\fIDEVICE \|]
> +.RB [\| \-w,\-\-withdrawn\ |\ \-n,\-\-normalstate \|]
> +.RB [\| \-D,\-\-driver=\fIDRIVER \|]
> +.RB [\| \-W,\-\-device=\fIDEVICE \|]
> .SH DESCRIPTION
> \fBwmnet\fP polls network statistics and does a few things with
> the data it gets. It has small blinking lights for the rx and tx of IP
> packets, a digital speedometer of your networks current
> speed and a bar graph like xload plotting your throughput. It
> @@ -33,85 +33,85 @@ The speedometer keeps track of the current speed per second and shows
> it in a color corresponding to which of rx or tx that has the highest
> speed at the moment. Also, the graph is drawn in a way that the highest
> speed is drawn on top of the other while the other is in the background.
> .SS OPTIONS
> .TP
> -.B \-h,--help
> +.B \-h,\-\-help
> displays a brief help message
> .TP
> -.B -v,--version
> +.B \-v,\-\-version
> displays version information
> .TP
> -.B \-T,--txrule=\fINUM or NAME
> +.B \-T,\-\-txrule=\fINUM or NAME
> in the case of the ipfwadm driver, this is the accounting rule number
> to monitor for tx. For the ipchains driver, this is the chain name to
> watch.
> .TP
> -.B \-R,--rxrule=\fINUM or NAME
> +.B \-R,\-\-rxrule=\fINUM or NAME
> in the case of the ipfwadm driver, this is the accounting rule number
> to monitor for rx. For the ipchains, this is the chain name to watch.
> .TP
> -.B \-t,--txcolor=\fICOLOR
> +.B \-t,\-\-txcolor=\fICOLOR
> specifies the tx color
> .TP
> -.B \-r,--rxcolor=\fICOLOR
> +.B \-r,\-\-rxcolor=\fICOLOR
> specifies the rx color
> .TP
> -.B \-x,--maxrate=\fIBYTES
> +.B \-x,\-\-maxrate=\fIBYTES
> maximum transfer rate for graph scale. Defaults to 6000, which should
> be in the right area for modem connections. The key is to experiment
> -with this setting and the --logscale option to get the kind of graph
> +with this setting and the \-\-logscale option to get the kind of graph
> that fits your connection type. A general rule of thumb is to set this
> to 4 to 5 times greater than your maximum throughput. The author finds
> -using --logscale and --maxrate=10000000 to work nicely for the entire range
> +using \-\-logscale and \-\-maxrate=10000000 to work nicely for the entire range
> of his dorms ethernet based connection to the internet.
>
> .TP
> -.B \-l,--logscale
> +.B \-l,\-\-logscale
> sets logarithmic scale, which is good for fast connections. This will
> allow, for example, the graph still being informative at extremely low
> speeds (telnet), and extremely fast speeds (local FTP) simultaneously
> without the scale constantly being blank or solid at those respective
> extremes.
> .TP
> -.B -L,--label=\fILABEL
> +.B \-L,\-\-label=\fILABEL
> prints a given text label on the bottom of the window
> .TP
> -.B -F,--labelfg=\fICOLOR
> +.B \-F,\-\-labelfg=\fICOLOR
> specifies the color for the text of the label
> .TP
> -.B -B,--labelbg=\fICOLOR
> +.B \-B,\-\-labelbg=\fICOLOR
> specifies the color for the background of the label text
> .TP
> -.B --withdrawn
> +.B \-\-withdrawn
> .TP
> -.B --normalstate
> +.B \-\-normalstate
> sets the initial state of wmnet. WMnet tries to automatically determine which
> state to start up in by starting up in withdrawn state if a WindowMaker
> defined atom is present, and in normalstate otherwise. This behavior is
> overriden by specifying one of these options.
> .TP
> -.B -e,--execute=\fICOMMAND
> +.B \-e,\-\-execute=\fICOMMAND
> executes \fICOMMAND \fPon a single click from button 1 (left mouse button).
> .TP
> -.B -u,--unpromisc=\fIDEVICE
> +.B \-u,\-\-unpromisc=\fIDEVICE
> .TP
> -.B -p,--promisc=\fIDEVICE
> +.B \-p,\-\-promisc=\fIDEVICE
> put \fIDEVICE \fPin promiscuous mode to start applying accounting rules to all
> network packets on your network segment. You either need to be root or
> have the wmnet binary suid root to use this feature. This option may be
> given more than once on the command line to specify more than one device.
> .TP
> .B \-d \fIDELAY
> delay time for polling /proc/net/ip_account (in
> microseconds). Defaults to 25000, that is 0.025 seconds, or 40 Hz
> .TP
> -.B -D,--driver=\fIDRIVER
> +.B \-D,\-\-driver=\fIDRIVER
> use \fIDRIVER \fP to get the stats we monitor. Compiled in drivers can be listed
> -with the -h switch.
> +with the \-h switch.
> .TP
> -.B -W,--device=\fIDEVICE
> +.B \-W,\-\-device=\fIDEVICE
> watch statistics for \fIDEVICE \fP. This option is only used for certain
> stat drivers, namely: kmem, devstats, and pppstats. The ipchains and ipfwadm
> stat drivers do not use this parameter.
> .TP
> .B \-X,\-\-display=\fDISPLAY
> @@ -119,41 +119,41 @@ X display to use.
> .SH STAT DRIVERS
> wmnet uses different stat drivers to get the stats it needs to monitor your
> network. Exactly what drivers are available is determined at compile time. The
> driver wmnet ultimately uses at runtime is dependent on your system. There
> are 4 drivers specific to Linux and 1 to *BSD. The driver used can be overridden
> -by the --driver option. The available drivers are \fIpppstats, devstats, ipfwadm,
> +by the \-\-driver option. The available drivers are \fIpppstats, devstats, ipfwadm,
> ipchains\fP and \fIkmem\fP.
> .TP
> .B pppstats
> this driver works on Linux 2.0 or Linux 2.1 for ONLY ppp type devices.
> -Specify the \fI--device\fP option for the interface to monitor. By default it
> +Specify the \fI\-\-device\fP option for the interface to monitor. By default it
> uses interface ppp0. Please note, that if the ppp device is not available or active, wmnet
> will continue to try in the hopes that it is only temporarily offline.
> .TP
> .B devstats
> -use this driver on Linux 2.1 kernels for any interface. Pass the \fI--device\fP option
> +use this driver on Linux 2.1 kernels for any interface. Pass the \fI\-\-device\fP option
> for the device you want monitored, otherwise, the default is eth0. This will be available
> for ONLY Linux 2.1 kernels and will always be there on those kernels.
> .TP
> .B ipfwadm
> use this driver on Linux 2.0 kernels compiled with IP accounting. It won't work on Linux 2.1.
> -You'll also need to specify the \fI--txrule\fP and \fI--rxrule\fP options. By default, wmnet uses
> +You'll also need to specify the \fI\-\-txrule\fP and \fI\-\-rxrule\fP options. By default, wmnet uses
> the first two rules it finds.
> .TP
> .B ipchains
> this driver will only work in Linux 2.1 kernels with IP chains compiled in. You'll want to also
> -specify the \fI--txrule\fP and \fI--rxrule\fP options and specify the chain names. By default it
> +specify the \fI\-\-txrule\fP and \fI\-\-rxrule\fP options and specify the chain names. By default it
> uses the chains "acctin" and "acctout"
> There must be at least one rule on the named ipchain, if there is more
> than one rule in the specified chain, it uses the first. The chain
> must not immediately return to the parent chain, it has to pass through a rule first.
> Otherwise, the kernel will not collect the stats we need.
> .TP
> .B kmem
> this driver is available on FreeBSD and OpenBSD systems and must be passed
> -a device through the \fI--device\fP option. By default, it uses ec0 but
> +a device through the \fI\-\-device\fP option. By default, it uses ec0 but
> will accept any valid device name.
> .SH FILES
> .TP
> .I /proc/net/ip_acct /proc/net/dev /proc/net/ipchains
> kernel net accounting information
> --
> 2.50.1
>

> From ef682187e90947c40e0580e8974c27defa25694c Mon Sep 17 00:00:00 2001
> From: Andreas Metzler <amet...@bebt.de>
> Date: Fri, 15 Aug 2025 11:31:48 +0200
> Subject: [PATCH 6/9] Fix arrow direction to match manpage
>
> original author: Matthew Ashton <mat...@pez.ca>
> Bug-Debian: https://bugs.debian.org/106382
> https://bugs.debian.org/105803
> ---
> wmnet/wmnet.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/wmnet/wmnet.c b/wmnet/wmnet.c
> index 3b2a34a..7300786 100644
> --- a/wmnet/wmnet.c
> +++ b/wmnet/wmnet.c
> @@ -611,25 +611,25 @@ void tock(void) {
> current_rx = rx;
> current_tx = tx;
> XSetBackground(dpy, graphics_context, black_pixel);
> if(current_tx == True) {
> XSetForeground(dpy, graphics_context, tx_pixel[HIGH_INTENSITY]);
> - XCopyPlane(dpy, arrow, *visible_window, graphics_context, 7, 0, 7, 9, 53, 5, 1);
> + XCopyPlane(dpy, arrow, *visible_window, graphics_context, 0, 0, 7, 9, 46, 5, 1);
> /* XFillRectangle(dpy, *visible_window, graphics_context, 55, 5, 4, 4); */
> }
> else {
> XSetForeground(dpy, graphics_context, grey_pixel);
> - XCopyPlane(dpy, arrow, *visible_window, graphics_context, 7, 0, 7, 9, 53, 5, 1);
> + XCopyPlane(dpy, arrow, *visible_window, graphics_context, 0, 0, 7, 9, 46, 5, 1);
> }
> if(current_rx == True) {
> XSetForeground(dpy, graphics_context, rx_pixel[HIGH_INTENSITY]);
> - XCopyPlane(dpy, arrow, *visible_window, graphics_context, 0, 0, 7, 9, 46, 5, 1);
> + XCopyPlane(dpy, arrow, *visible_window, graphics_context, 7, 0, 7, 9, 53, 5, 1);
> /* XFillRectangle(dpy, *visible_window, graphics_context, 55, 12, 4, 4); */
> }
> else {
> XSetForeground(dpy, graphics_context, grey_pixel);
> - XCopyPlane(dpy, arrow, *visible_window, graphics_context, 0, 0, 7, 9, 46, 5, 1);
> + XCopyPlane(dpy, arrow, *visible_window, graphics_context, 7, 0, 7, 9, 53, 5, 1);
> }
> }
>
> }
>
> --
> 2.50.1
>

> From 67bb2ca43c6cdd7ba7320933592cc84e4c7502ea Mon Sep 17 00:00:00 2001
> From: Andreas Metzler <amet...@bebt.de>
> Date: Fri, 15 Aug 2025 11:34:09 +0200
> Subject: [PATCH 7/9] spelling fixes
>
> original authors: <mla...@email.cz>, Andreas Metzler <amet...@debian.org>
> ---
> wmnet/wmnet.c | 2 +-
> wmnet/wmnet.man | 6 +++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/wmnet/wmnet.c b/wmnet/wmnet.c
> index 7300786..d4e4a28 100644
> --- a/wmnet/wmnet.c
> +++ b/wmnet/wmnet.c
> @@ -138,11 +138,11 @@ void setup_wmnet(int argc, char **argv) {
> #endif
> switch(c) {
> case 'v':
> printf("wmnet 1.06\n"
> "Copyright (C) 1998, 2000 Jesse B. Off, Katharine Osborne <ka...@digitalkaos.net>\n"
> - "This program is released under the terms of the GNU Public License.\n");
> + "This program is released under the terms of the GNU General Public License.\n");
> exit(14);
> break;
> case 'X':
> dpy_name = strdup(optarg);
> break;
> diff --git a/wmnet/wmnet.man b/wmnet/wmnet.man
> index 4997a9c..25d7f17 100644
> --- a/wmnet/wmnet.man
> +++ b/wmnet/wmnet.man
> @@ -86,11 +86,11 @@ specifies the color for the background of the label text
> .TP
> .B \-\-normalstate
> sets the initial state of wmnet. WMnet tries to automatically determine which
> state to start up in by starting up in withdrawn state if a WindowMaker
> defined atom is present, and in normalstate otherwise. This behavior is
> -overriden by specifying one of these options.
> +overridden by specifying one of these options.
> .TP
> .B \-e,\-\-execute=\fICOMMAND
> executes \fICOMMAND \fPon a single click from button 1 (left mouse button).
> .TP
> .B \-u,\-\-unpromisc=\fIDEVICE
> @@ -159,11 +159,11 @@ will accept any valid device name.
> kernel net accounting information
> .SH AUTHORS
> \fBwmnet\fP was created by \fIJesse B. Off <jo...@iastate.edu>\fP and is
> maintained by \fIKatharine Osborne <ka...@digitalkaos.net>\fP.
>
> -This manpange was originally written by \fIMarcelo Magallon
> +This manpage was originally written by \fIMarcelo Magallon
> <mmag...@debian.org>\fP for the \fIDebian Project\fP, and is GNU
> -Copyright 1998 Marcelo Magallon and later modifed by \fIJesse Off\fP
> +Copyright 1998 Marcelo Magallon and later modified by \fIJesse Off\fP
> and \fIKatharine Osborne\fP for WMnet versions 1.05 and above.
> .SH "SEE ALSO"
> .BR wmaker (1x)
> --
> 2.50.1
>

> From 512855dbbd7ca208016f19da52f360af7068cecb Mon Sep 17 00:00:00 2001
> From: Andreas Metzler <amet...@bebt.de>
> Date: Fri, 15 Aug 2025 11:40:50 +0200
> Subject: [PATCH 8/9] Drop compat code for linux llbc5
>
> ---
> wmnet/Imakefile | 4 ----
> wmnet/drivers.c | 9 ++-------
> 2 files changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/wmnet/Imakefile b/wmnet/Imakefile
> index 460c298..b94d5ca 100644
> --- a/wmnet/Imakefile
> +++ b/wmnet/Imakefile
> @@ -1,14 +1,10 @@
> DEPLIBS = $(DEPXLIB)
> CC = gcc -Wall
>
> #ifdef LinuxArchitecture
> STD_DEFINES = -Dlinux
> -DEFINES = -Dlinux_libc5
> -#if LinuxCLibMajorVersion > 5
> -DEFINES = -Dlinux_libc6
> -#endif
> LOCAL_LIBRARIES = $(XLIB) -lm
> #endif
>
> #if defined (FreeBSDArchitecture) || defined (OpenBSDArchitecture)
> LOCAL_LIBRARIES = $(XLIB) -lm -lkvm
> diff --git a/wmnet/drivers.c b/wmnet/drivers.c
> index 4b798e7..e279b9b 100644
> --- a/wmnet/drivers.c
> +++ b/wmnet/drivers.c
> @@ -38,23 +38,18 @@ int kvm_updateStats(void);
> #endif /* USE_KVM */
>
>
> #ifdef USE_LINUX_PPP
> #include<net/ppp_defs.h>
> -
> -#ifdef linux_libc5
> -# include<linux/if_ppp.h>
> -#else
> -# include<net/if_ppp.h>
> -#endif
> +#include<net/if_ppp.h>
>
> #include<sys/ioctl.h>
> int pppfd;
> int ppp_test(void);
> int updateStats_ppp(void);
> static struct ifpppstatsreq ppp_stats_req;
> -#endif
> +#endif /* USE_LINUX_PPP */
>
> #define ACCOUNT_IN_FOUND 1
> #define ACCOUNT_OUT_FOUND 2
>
> extern char buffer[256];
> --
> 2.50.1
>

> From c9f47bc859a43d896ac8ef6d586a5cd4dd3a745a Mon Sep 17 00:00:00 2001
> From: Andreas Metzler <amet...@bebt.de>
> Date: Fri, 15 Aug 2025 14:07:24 +0200
> Subject: [PATCH 9/9] Use GNU auto* instead of xmkmf
>
> ---
> wmnet/Imakefile | 25 -------------------------
> wmnet/Makefile.am | 13 +++++++++++++
> wmnet/README | 4 +---
> wmnet/autogen.sh | 2 ++
> wmnet/configure.ac | 22 ++++++++++++++++++++++
> wmnet/{wmnet.man => wmnet.1x} | 0
> 6 files changed, 38 insertions(+), 28 deletions(-)
> delete mode 100644 wmnet/Imakefile
> create mode 100644 wmnet/Makefile.am
> create mode 100755 wmnet/autogen.sh
> create mode 100644 wmnet/configure.ac
> rename wmnet/{wmnet.man => wmnet.1x} (100%)
>
> diff --git a/wmnet/Imakefile b/wmnet/Imakefile
> deleted file mode 100644
> index b94d5ca..0000000
> --- a/wmnet/Imakefile
> +++ /dev/null
> @@ -1,25 +0,0 @@
> -DEPLIBS = $(DEPXLIB)
> -CC = gcc -Wall
> -
> -#ifdef LinuxArchitecture
> -STD_DEFINES = -Dlinux
> -LOCAL_LIBRARIES = $(XLIB) -lm
> -#endif
> -
> -#if defined (FreeBSDArchitecture) || defined (OpenBSDArchitecture)
> -LOCAL_LIBRARIES = $(XLIB) -lm -lkvm
> -INSTPGMFLAGS = -s -g kmem -m 2755
> -#endif
> -
> -LINTLIBS = $(LINTXLIB)
> -
> -#if defined (FreeBSDArchitecture) || defined (OpenBSDArchitecture)
> -SRCS = wmnet.c drivers.c getopt.c getopt1.c
> -OBJS = wmnet.o drivers.o getopt.o getopt1.o
> -#else
> -SRCS = wmnet.c drivers.c
> -OBJS = wmnet.o drivers.o
> -#endif
> -
> -
> -ComplexProgramTarget(wmnet)
> diff --git a/wmnet/Makefile.am b/wmnet/Makefile.am
> new file mode 100644
> index 0000000..7dac402
> --- /dev/null
> +++ b/wmnet/Makefile.am
> @@ -0,0 +1,13 @@
> +bin_PROGRAMS = wmnet
> +wmnet_SOURCES = config.h drivers.c \
> + wmnet.c \
> + wmnet.h XPM/arrow.xbm
> +
> +if WMNET_LOCAL_OPTS
> +wmnet_SOURCES += getopt1.c getopt.c getopt.h
> +endif
> +
> +dist_man_MANS = wmnet.1x
> +
> +AM_CFLAGS = $(X11_CFLAGS) $(XEXT_CFLAGS)
> +LIBS += -lm $(X11_LIBS) $(XEXT_LIBS)
> diff --git a/wmnet/README b/wmnet/README
> index b46a310..5c478b3 100644
> --- a/wmnet/README
> +++ b/wmnet/README
> @@ -84,15 +84,13 @@ http://www.digitalkaos.net/linux/wmnet/
>
>
> TO INSTALL from tar.gz:
> tar xfzv wmnet-1.06.tar.gz
> cd wmnet-1.06
> -xmkmf
> +./configure
> make
> -strip wmnet
> make install
> -make install.man
>
> NOTE: you may wanna change config.h to change the compiled in drivers.
>
>
> ideas/comments/bug reports -----> ka...@digitalkaos.net
> diff --git a/wmnet/autogen.sh b/wmnet/autogen.sh
> new file mode 100755
> index 0000000..af8c78c
> --- /dev/null
> +++ b/wmnet/autogen.sh
> @@ -0,0 +1,2 @@
> +#!/bin/sh
> +autoreconf --force --verbose --install
> diff --git a/wmnet/configure.ac b/wmnet/configure.ac
> new file mode 100644
> index 0000000..fef5da6
> --- /dev/null
> +++ b/wmnet/configure.ac
> @@ -0,0 +1,22 @@
> +AC_INIT([wmnet], [1.7], [wmake...@googlegroups.com])
> +AM_INIT_AUTOMAKE([foreign])
> +AC_CONFIG_SRCDIR([configure.ac])
> +AC_PROG_CC
> +AC_CANONICAL_HOST
> +
> +LOCAL_OPTS=n
> +case "$host" in
> + *-freebsd*)
> + LOCAL_OPTS=y
> + ;;
> + *-openbsd*)
> + LOCAL_OPTS=y
> + ;;
> +esac
> +
> +AM_CONDITIONAL([WMNET_LOCAL_OPTS], [test "$LOCAL_OPTS" = "y"])
> +
> +PKG_CHECK_MODULES([X11], [x11])
> +PKG_CHECK_MODULES([XEXT], [xext])
> +AC_CONFIG_FILES([Makefile])
> +AC_OUTPUT
> diff --git a/wmnet/wmnet.man b/wmnet/wmnet.1x
> similarity index 100%
> rename from wmnet/wmnet.man
> rename to wmnet/wmnet.1x
> --
> 2.50.1
>



Reply all
Reply to author
Forward
0 new messages