update to 1.20.7+20200717git.e82d1a6 [release 1.20.7+20200717git.e82d1a6-1mamba;Wed Dec 31 2025]

This commit is contained in:
2025-12-31 17:33:17 +01:00
parent 7537ed2282
commit 63115efd62
20 changed files with 316 additions and 7558 deletions

View File

@@ -1,29 +0,0 @@
--- gpm-1.20.1/src/console.c.org 2006-09-03 10:11:17.000000000 +0200
+++ gpm-1.20.1/src/console.c 2006-09-03 10:14:34.000000000 +0200
@@ -30,6 +30,7 @@
#include <time.h> /* time() */
#include <sys/fcntl.h> /* O_RDONLY */
#include <sys/stat.h> /* mkdir() */
+#include <sys/time.h>
#include <asm/types.h> /* __u32 */
#include <linux/vt.h> /* VT_GETSTATE */
@@ -102,8 +103,17 @@ int is_text_console(void)
/*-------------------------------------------------------------------*/
void wait_text_console(void)
{
+ struct timeval now;
+ int usecs;
do {
- sleep(2);
+ /* sleep to the top of the seconds about 2 seconds from now */
+ gettimeofday(&now, NULL);
+ usecs = 2000000;
+ if (now.tv_usec <= 250000)
+ usecs -= 1000000;
+ usecs += 1000000 - now.tv_usec;
+
+ usleep(usecs);
} while (!is_text_console());
}

View File

@@ -1,14 +0,0 @@
--- gpm-1.20.1/src/startup.c.close-fds 2006-09-22 13:46:19.000000000 +0200
+++ gpm-1.20.1/src/startup.c 2006-09-22 13:46:44.000000000 +0200
@@ -97,6 +97,11 @@
/* is changing to root needed, because of relative paths ? or can we just
* remove and ignore it ?? FIXME */
if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED);
+
+ // close extra fds
+ close(0);
+ close(1);
+ close(2);
atexit(gpm_exited); /* call gpm_exited at the end */
}

View File

@@ -1,18 +0,0 @@
--- gpm-1.20.1/src/lib/liblow.c.orig 2004-10-13 16:34:15.181502369 -0400
+++ gpm-1.20.1/src/lib/liblow.c 2004-10-13 16:34:20.491778415 -0400
@@ -262,13 +262,14 @@
gpm_report(GPM_PR_ERR,"consolename not set");
goto err;
}
+#if 0
/* do we really need this check ? */
if(strncmp(tty,consolename,strlen(consolename)-1)
|| !isdigit(tty[strlen(consolename)-1])) {
gpm_report(GPM_PR_ERR,"strncmp/isdigit/consolename failed");
goto err;
}
-
+#endif
conn->vc=atoi(&tty[strlen(consolename)-1]);
}

View File

@@ -1,17 +0,0 @@
--- gpm-1.20.1/src/gpm.c.deadsocket 2007-03-23 16:59:42.000000000 +0100
+++ gpm-1.20.1/src/gpm.c 2007-03-23 17:10:10.000000000 +0100
@@ -544,7 +544,14 @@
* we can safely use micelist
*/
close(micelist->dev.fd);
+
+ close(ctlfd);
+ FD_CLR(ctlfd, &connSet);
wait_text_console();
+ ctlfd = listen_for_clients();
+ FD_SET(ctlfd, &connSet);
+ maxfd = max(maxfd, ctlfd);
+
/* reopen, reinit (the function is only used if we have one mouse device) */
if ((micelist->dev.fd = open(micelist->device, O_RDWR)) < 0)
gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, micelist->device);

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +0,0 @@
diff -ur gpm-1.20.1.orig/src/headers/config.h.in gpm-1.20.1/src/headers/config.h.in
--- gpm-1.20.1.orig/src/headers/config.h.in 2004-09-04 10:24:11.000000000 -0400
+++ gpm-1.20.1/src/headers/config.h.in 2004-09-04 10:26:02.000000000 -0400
@@ -46,6 +46,12 @@
/* Define if you have the <linux/input.h> header file. */
#undef HAVE_LINUX_INPUT_H
+/* Definedif you have the input_id structure */
+#undef HAVE_INPUT_ID
+
+/* Definedif you have the input_absinfo structure */
+#undef HAVE_INPUT_ABSINFO
+
/* Define if you have the <linux/joystick.h> header file. */
#undef HAVE_LINUX_JOYSTICK_H

View File

@@ -1,11 +0,0 @@
--- gpm-1.20.1/configure.in.math Tue Jun 24 10:52:44 2003
+++ gpm-1.20.1/configure.in Tue Jun 24 10:53:54 2003
@@ -128,7 +128,7 @@
AC_SUBST(lispdir)
CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""'
-LDFLAGS='-L$(srcdir)'
+LDFLAGS='-lm -L$(srcdir)'
dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir")
dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir")

View File

@@ -1,21 +0,0 @@
diff -ru gpm-1.20.1.orig/src/lib/report-lib.c gpm-1.20.1/src/lib/report-lib.c
--- gpm-1.20.1.orig/src/lib/report-lib.c 2005-02-01 15:16:51.000000000 +0100
+++ gpm-1.20.1/src/lib/report-lib.c 2005-02-01 15:41:32.000000000 +0100
@@ -37,9 +37,12 @@
case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break;
case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break;
}
- fprintf(stderr,"%s[%s(%d)]:\n",string,file,line);
- vfprintf(stderr,text,ap);
- fprintf(stderr,"\n");
-
- if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */
+
+ // Patch: print to stderr only OOPS
+ if(stat == GPM_STAT_OOPS) {
+ fprintf(stderr,"%s[%s(%d)]:\n",string,file,line);
+ vfprintf(stderr,text,ap);
+ fprintf(stderr,"\n");
+ exit(1); /* may a lib function call exit ???? */
+ }
}

View File

@@ -1,138 +0,0 @@
diff -Nru gpm-1.20.1.orig/src/report.c gpm-1.20.1/src/report.c
--- gpm-1.20.1.orig/src/report.c 2005-02-01 15:16:51.000000000 +0100
+++ gpm-1.20.1/src/report.c 2005-02-01 15:34:00.000000000 +0100
@@ -70,7 +70,6 @@
void gpm_report(int line, char *file, int stat, char *text, ... )
{
- FILE *console = NULL;
va_list ap;
va_start(ap,text);
@@ -80,23 +79,9 @@
case GPM_RUN_STARTUP:
switch(stat) {
case GPM_STAT_INFO:
-#ifdef HAVE_VSYSLOG
- syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO);
- vsyslog(LOG_INFO | LOG_USER, text, ap);
-#endif
- fprintf(stderr,GPM_STRING_INFO);
- vfprintf(stderr,text,ap);
- fprintf(stderr,"\n");
break;
case GPM_STAT_WARN:
-#ifdef HAVE_VSYSLOG
- syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN);
- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap);
-#endif
- fprintf(stderr,GPM_STRING_WARN);
- vfprintf(stderr,text,ap);
- fprintf(stderr,"\n");
break;
case GPM_STAT_ERR:
@@ -104,9 +89,6 @@
syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR);
vsyslog(LOG_DAEMON | LOG_ERR, text, ap);
#endif
- fprintf(stderr,GPM_STRING_ERR);
- vfprintf(stderr,text,ap);
- fprintf(stderr,"\n");
break;
case GPM_STAT_OOPS:
@@ -114,10 +96,6 @@
syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS);
vsyslog(LOG_DAEMON | LOG_ERR, text, ap);
#endif
- fprintf(stderr,GPM_STRING_OOPS);
- vfprintf(stderr,text,ap);
- fprintf(stderr,"\n");
-
exit(1); /* we should have a oops()-function,but this works,too*/
break;
}
@@ -127,23 +105,9 @@
case GPM_RUN_DAEMON:
switch(stat) {
case GPM_STAT_INFO:
-#ifdef HAVE_VSYSLOG
- syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO);
- vsyslog(LOG_INFO | LOG_USER, text, ap);
-#endif
break;
case GPM_STAT_WARN:
-#ifdef HAVE_VSYSLOG
- syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN);
- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap);
-#endif
- if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) {
- fprintf(console,GPM_STRING_WARN);
- vfprintf(console,text,ap);
- fprintf(console,"\n");
- fclose(console);
- }
break;
case GPM_STAT_ERR:
@@ -151,19 +115,6 @@
syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR);
vsyslog(LOG_DAEMON | LOG_ERR, text, ap);
#endif
- if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) {
- fprintf(console,GPM_STRING_ERR);
- vfprintf(console,text,ap);
- fprintf(console,"\n");
- fclose(console);
- }
-
- if((console = fopen(option.consolename,"a")) != NULL) {
- fprintf(console,GPM_STRING_ERR);
- vfprintf(console,text,ap);
- fprintf(console,"\n");
- fclose(console);
- }
break;
case GPM_STAT_OOPS:
@@ -171,37 +122,10 @@
syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS);
vsyslog(LOG_DAEMON | LOG_ERR, text, ap);
#endif
- fprintf(stderr,GPM_STRING_OOPS);
- vfprintf(stderr,text,ap);
- fprintf(stderr,"\n");
-
_exit(1); /* we are the fork()-child */
break;
}
break; /* running gpm */
-
- /******************** DEBUGGING and CLIENT *****************/
- case GPM_RUN_DEBUG:
- switch(stat) {
- case GPM_STAT_INFO:
- console = stdout;
- fprintf(console,GPM_STRING_INFO); break;
- case GPM_STAT_WARN:
- console = stderr;
- fprintf(console,GPM_STRING_WARN); break;
- case GPM_STAT_ERR:
- console = stderr;
- fprintf(console,GPM_STRING_ERR); break;
- case GPM_STAT_DEBUG:
- console = stderr;
- fprintf(console,GPM_STRING_DEBUG); break;
- case GPM_STAT_OOPS:
- console = stderr;
- fprintf(console,GPM_STRING_OOPS); break;
- }
-
- vfprintf(console,text,ap);
- fprintf(console,"\n");
if(stat == GPM_STAT_OOPS) exit(1);

View File

@@ -1,11 +0,0 @@
--- gpm-1.20.1/src/mice.c.lr 2004-02-15 09:19:48.000000000 +0100
+++ gpm-1.20.1/src/mice.c 2004-02-15 09:22:18.000000000 +0100
@@ -2112,7 +2112,7 @@
for (i=0; i<4; i++)
if (gunze_calib[i] & ~1023) calibok = 0;
if (gunze_calib[0] == gunze_calib[2]) calibok = 0;
- if (gunze_calib[1] == gunze_calib[4]) calibok = 0;
+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0;
fclose(f);
}
if (!calibok) {

View File

@@ -0,0 +1,33 @@
From 43fffd4acd90f8d6947cba869e01cf36bb116b3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 18 Jan 2025 12:27:36 +0100
Subject: [PATCH 3/4] configure: drop broken configure code
Doesn't work on Fedora 41 or 42:
checking where to install Emacs Lisp files... ./configure: eval: line 12626: syntax error near unexpected token `('
./configure: eval: line 12626: `itz_cv_path_site_lisp= mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode 0x133e8adafae87e4>))'
---
configure.ac.footer | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/configure.ac.footer b/configure.ac.footer
index 1e5e4da1e6..5c60a2ec9c 100644
--- a/configure.ac.footer
+++ b/configure.ac.footer
@@ -59,12 +59,7 @@ else
ELISP="emacs/t-mouse.el emacs/t-mouse.elc"
fi
-if test $EMACS != : ; then
- ITZ_PATH_SITE_LISP
- lispdir=${itz_cv_path_site_lisp}
-else
- lispdir='${datadir}/emacs/site-lisp'
-fi
+lispdir='${datadir}/emacs/site-lisp'
# Header-checks
AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h)
--
2.47.1

View File

@@ -0,0 +1,183 @@
From 558f94b786e731e208895588625cee6c46d32468 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 18 Jan 2025 12:16:49 +0100
Subject: [PATCH 2/4] src/daemon: reindent switch statement to avoid compiler
warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Gcc reports that "warning: this if clause does not guard..." for
every break statement squished at the end of the preceding logical
line. This just makes the code hard to read, use normal indentation.
While at it, drop the pointless array. The variable is kept to allow the
option string to be defined on a separate line.
---
src/daemon/cmdline.c | 141 ++++++++++++++++++++++++++++++-------------
1 file changed, 98 insertions(+), 43 deletions(-)
diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c
index 66c8ecc50e..6a89d69ec3 100644
--- a/src/daemon/cmdline.c
+++ b/src/daemon/cmdline.c
@@ -32,58 +32,113 @@
void cmdline(int argc, char **argv)
{
extern struct options option;
- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23";
+ const char *options="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23";
int opt;
- /* initialize for the dual mouse */
+ /* initialize for the dual mouse */
mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */
which_mouse = mouse_table+1; /* use the first */
while ((opt = getopt(argc, argv, options)) != -1) {
switch (opt) {
- case 'a': (which_mouse->opt_accel) = atoi(optarg); break;
- case 'A': opt_aged++;
- if (optarg)
- opt_age_limit = atoi(optarg); break;
- case 'b': (which_mouse->opt_baud) = atoi(optarg); break;
- case 'B': (which_mouse->opt_sequence) = optarg; break;
- case 'd': (which_mouse->opt_delta) = atoi(optarg); break;
- case 'D': option.run_status = GPM_RUN_DEBUG; break;
- case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break;
- case 'h': exit(usage(NULL));
- case 'i': (which_mouse->opt_time)=atoi(optarg); break;
- case 'k': check_kill(); break;
- case 'l': opt_lut = optarg; break;
- case 'm': add_mouse(GPM_ADD_DEVICE,optarg);
- (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/
- case 'M': opt_double++; option.repeater++;
- if (option.repeater_type == 0)
- option.repeater_type = "msc";
- which_mouse=mouse_table+2; break;
- case 'o': add_mouse(GPM_ADD_OPTIONS,optarg);
- gpm_report(GPM_PR_DEBUG,"options: %s",optarg);
- (which_mouse->opt_options) = optarg; break; /* GO AWAY */
- case 'p': opt_ptrdrag = 0; break;
+ case 'a':
+ (which_mouse->opt_accel) = atoi(optarg);
+ break;
+ case 'A':
+ opt_aged++;
+ if (optarg)
+ opt_age_limit = atoi(optarg);
+ break;
+ case 'b':
+ (which_mouse->opt_baud) = atoi(optarg);
+ break;
+ case 'B':
+ (which_mouse->opt_sequence) = optarg;
+ break;
+ case 'd':
+ (which_mouse->opt_delta) = atoi(optarg);
+ break;
+ case 'D':
+ option.run_status = GPM_RUN_DEBUG;
+ break;
+ case 'g':
+ (which_mouse->opt_glidepoint_tap)=atoi(optarg);
+ break;
+ case 'h':
+ exit(usage(NULL));
+ break;
+ case 'i':
+ (which_mouse->opt_time)=atoi(optarg);
+ break;
+ case 'k':
+ check_kill();
+ break;
+ case 'l':
+ opt_lut = optarg;
+ break;
+ case 'm':
+ add_mouse(GPM_ADD_DEVICE,optarg);
+ (which_mouse->opt_dev) = optarg;
+ break; /* GO AWAY!*/
+ case 'M':
+ opt_double++; option.repeater++;
+ if (option.repeater_type == 0)
+ option.repeater_type = "msc";
+ which_mouse=mouse_table+2;
+ break;
+ case 'o':
+ add_mouse(GPM_ADD_OPTIONS,optarg);
+ gpm_report(GPM_PR_DEBUG,"options: %s",optarg);
+ (which_mouse->opt_options) = optarg;
+ break; /* GO AWAY */
+ case 'p':
+ opt_ptrdrag = 0;
+ break;
case 'r':
- /* being called responsiveness, I must take the inverse */
- (which_mouse->opt_scale)=atoi(optarg);
- if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */
- else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break;
+ /* being called responsiveness, I must take the inverse */
+ (which_mouse->opt_scale)=atoi(optarg);
+ if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100)
+ (which_mouse->opt_scale)=100; /* the maximum */
+ else
+ (which_mouse->opt_scale)=100/(which_mouse->opt_scale);
+ break;
case 'R':
- option.repeater++;
- if (optarg) option.repeater_type = optarg;
- else option.repeater_type = "msc"; break;
- case 's': (which_mouse->opt_sample) = atoi(optarg); break;
- case 'S': if (optarg) opt_special = optarg;
- else opt_special=""; break;
- case 't': add_mouse(GPM_ADD_TYPE,optarg);
- (which_mouse->opt_type) = optarg; break; /* GO AWAY */
- case 'u': option.autodetect = 1; break;
- case 'T': opt_test++; break;
- case 'v': printf(GPM_MESS_VERSION "\n"); exit(0);
- case '2': (which_mouse->opt_three) = -1; break;
- case '3': (which_mouse->opt_three) = 1; break;
- default: exit(usage("commandline"));
+ option.repeater++;
+ if (optarg)
+ option.repeater_type = optarg;
+ else
+ option.repeater_type = "msc";
+ break;
+ case 's':
+ (which_mouse->opt_sample) = atoi(optarg);
+ break;
+ case 'S':
+ if (optarg)
+ opt_special = optarg;
+ else
+ opt_special="";
+ break;
+ case 't':
+ add_mouse(GPM_ADD_TYPE,optarg);
+ (which_mouse->opt_type) = optarg;
+ break; /* GO AWAY */
+ case 'u':
+ option.autodetect = 1;
+ break;
+ case 'T':
+ opt_test++;
+ break;
+ case 'v':
+ printf(GPM_MESS_VERSION "\n");
+ exit(0);
+ case '2':
+ (which_mouse->opt_three) = -1;
+ break;
+ case '3':
+ (which_mouse->opt_three) = 1;
+ break;
+ default:
+ exit(usage("commandline"));
}
}
}
--
2.47.1

View File

@@ -0,0 +1,38 @@
From 49908db4943c3718a90b3d5f90b8f4aa622bc358 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 18 Jan 2025 12:09:11 +0100
Subject: [PATCH 1/4] src/daemon: remove obvious use of unitialized data
Previously the code would pseudorandomly omit the error message.
Emit it always.
---
src/daemon/open_console.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/daemon/open_console.c b/src/daemon/open_console.c
index 6dd43e60c7..c84f7c6988 100644
--- a/src/daemon/open_console.c
+++ b/src/daemon/open_console.c
@@ -42,7 +42,7 @@ int open_console(const int mode)
int maj;
int twelve = 12;
struct serial_struct si;
- struct stat sb;
+ struct stat sb = {};
fd = open(option.consolename, mode);
if (fd != -1) {
@@ -50,9 +50,7 @@ int open_console(const int mode)
maj = major(sb.st_rdev);
if (maj != 4 && (maj < 136 || maj > 143)) {
if (ioctl(fd, TIOCLINUX, &twelve) < 0) {
- if (si.line > 0) {
- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON);
- }
+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON);
}
}
} else
--
2.47.1

View File

@@ -1,102 +0,0 @@
#!/bin/bash
#
# gpm -- GPM adds mouse support to text-based Linux applications
#
# chkconfig: 345 98 1
# description: GPM adds mouse support to text-based Linux applications such \
# the Midnight Commander. Is also allows mouse-based console \
# cut-and-paste operations, and includes support for pop-up \
# menus on the console.
# processname: gpm
# pidfile: /var/run/gpm.pid
# config: /etc/sysconfig/mouse
# Copyright (c) 2003-2005 by Silvan Calarco <silvan.calarco@qilinux.it>
# Copyright (c) 2003-2007 by Davide Madrisan <davide.madrisan@qilinux.it>
. /etc/sysconfig/rc
. $rc_functions
NAME=gpm
DAEMON=/usr/sbin/$NAME
DAEMONPID=/var/run/$NAME.pid
DAEMONCONF=/etc/gpm-root.conf
OPTIONS=-R
#MOUSECFG=/etc/sysconfig/mouse
#MOUSEDEVICE=/dev/mouse
[ -x $DAEMON ] || exit 0
[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
KERNELMIN=`uname -r | sed -e 's,[^\.]*\.,,' -e 's,\..*,,'`
RETVAL=0
case "$1" in
start)
echo -n $"Starting console mouse services: "
unset GPM_PARMS
SYNAPTIC_DEV=`cat /proc/bus/input/devices 2>/dev/null | \
sed '/./{H;$!d;};x;/Synaptics/!d' | \
sed -n '/Handlers=/{s,.*\(event[^ ]*\).*,\1,p}'`
[ "$SYNAPTIC_DEV" ] &&
GPM_PARMS="-m /dev/input/$SYNAPTIC_DEV -t evdev"
USB_DEV=`cat /proc/bus/input/devices 2>/dev/null | \
sed '/./{H;$!d;};x;/Phys=usb/!d' | \
sed -n '/Handlers=/{s,.*\(mouse[^ ]*\).*,\1,p}'`
[ "$USB_DEV" ] &&
for usbdev in $USB_DEV; do
GPM_PARMS="${GPM_PARMS:+"$GPM_PARMS -M"} -m /dev/input/$usbdev -t imps2"
done
PS2_DEV=`cat /proc/bus/input/devices 2>/dev/null | \
sed '/./{H;$!d;};x;/Name="PS\/2/!d' | \
sed -n '/Handlers=/{s,.*\(mouse[^ ]*\).*,\1,p}'`
[ "$PS2_DEV" ] &&
GPM_PARMS="${GPM_PARMS:+"$GPM_PARMS -M"} -m /dev/input/$PS2_DEV -t ps2"
IMPS2_DEV=`cat /proc/bus/input/devices 2>/dev/null | \
sed '/./{H;$!d;};x;/Name="Im[^ ]*PS\/2/!d' | \
sed -n '/Handlers=/{s,.*\(mouse[^ ]*\).*,\1,p}'`
[ "$IMPS2_DEV" ] &&
GPM_PARMS="${GPM_PARMS:+"$GPM_PARMS -M"} -m /dev/input/$IMPS2_DEV -t imps2"
if [ "$KERNELMIN" -le 4 ]; then
[ -z "$PS2_DEV" -a -e /dev/psaux ] &&
GPM_PARMS="${GPM_PARMS:+"$GPM_PARMS -M"} -m /dev/psaux -t ps2"
[ "$USB_DEV" ] ||
for usbdev in `find /dev/input/mouse[0-9] 2>/dev/null`; do
GPM_PARMS="${GPM_PARMS:+"$GPM_PARMS -M"} -m $usbdev -t imps2"
done
fi
daemon --pidfile=$DAEMONPID $DAEMON $OPTIONS $GPM_PARMS
RETVAL=$?
evaluate_retval; echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
;;
stop)
echo -n $"Shutting down console mouse services: "
killproc -p $DAEMONPID $DAEMON
RETVAL=$?
evaluate_retval; echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME
;;
restart|reload)
$0 stop
$0 start
;;
condrestart)
[ -e /var/lock/subsys/$NAME ] && $0 restart || :
;;
status)
statusproc $DAEMON
;;
*) echo $"Usage:"" $0 {start|stop|status|restart}"
exit 1
;;
esac
exit $RETVAL

3
gpm-profile.sh Normal file
View File

@@ -0,0 +1,3 @@
case $( /usr/bin/tty ) in
/dev/tty[0-9]*) [ -n "$(pidof -s gpm)" ] && /usr/bin/disable-paste ;;
esac

View File

@@ -1,85 +0,0 @@
# sample configuration file for gpm-root
# edit it to please your taste....
button 1 {
name "ttys"
"" f.nop
"login on a new tty" f.mktty
"" f.nop
"tty 1" f.jptty "1"
"tty 2" f.jptty "2"
"tty 3" f.jptty "3"
"tty 4" f.jptty "4"
"" f.nop
"tty 5" f.jptty "5"
"tty 6" f.jptty "6"
"tty 7" f.jptty "7"
"tty 8" f.jptty "8"
"" f.nop
"more of them..." {
"tty 9" f.jptty "9"
"tty 10" f.jptty "10"
"tty 11" f.jptty "11"
"tty 12" f.jptty "12"
"" f.nop
"tty 13" f.jptty "13"
"tty 14" f.jptty "14"
"tty 15" f.jptty "15"
"tty 16" f.jptty "16"
"" f.nop
"more of them..." {
"tty 17" f.jptty "17"
}
}
}
button 2 {
name "system status"
foreground red
background black
border yellow
head bright yellow
"" f.nop
"%b %d %Y" f.time
"%H:%M" f.time
"" f.nop
"load: " f.load
"free:" f.free
"" f.nop
"report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du"
"print mail headers to tty" f.bgcmd
"grep '^From ' /var/spool/mail/$USER | tail"
}
button 3 {
name "far ttys"
foreground black
background red
border bright yellow
head bright yellow
"tty 9" f.jptty "9"
"tty 10" f.jptty "10"
"tty 11" f.jptty "11"
"tty 12" f.jptty "12"
"" f.nop
"tty 13" f.jptty "13"
"tty 14" f.jptty "14"
"tty 15" f.jptty "15"
"tty 16" f.jptty "16"
"" f.nop
# I use this to halt and reboot the system, but it isn't wise to put it
# in widely accessible boxes.
#
# "----" f.nop
# "" f.nop
# "halt" f.bgcmd "/sbin/shutdown -h now"
# "reboot" f.bgcmd "/sbin/shutdown -r now"
}

5
gpm.path Normal file
View File

@@ -0,0 +1,5 @@
[Unit]
Description=Virtual console mouse server
[Path]
PathExists=/dev/input/mice

13
gpm.service Normal file
View File

@@ -0,0 +1,13 @@
[Unit]
Description=Virtual console mouse server
Requires=systemd-udevd.service
After=systemd-udevd.service
Wants=gpm.path
ConditionPathExists=/dev/input/mice
[Service]
Type=forking
ExecStart=/usr/bin/gpm -m /dev/input/mice -t imps2
[Install]
WantedBy=multi-user.target

107
gpm.spec
View File

@@ -1,41 +1,29 @@
%define gitcommit %(echo %version | cut -d+ -f2 | cut -d. -f2)
Name: gpm
Version: 1.20.7.r38.ge82d1a6
Version: 1.20.7+20200717git.e82d1a6
Release: 1mamba
Summary: A mouse server for the Linux console
Group: System/Servers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.nico.schottelius.org/software/gpm
Source: https://github.com/telmich/gpm.git/master/gpm-%{version}.tar.bz2
#Source: http://www.nico.schottelius.org/software/gpm/archives/gpm-%{version}.tar.bz2
Source1: gpm-initscript
Source2: gpm-root.conf
Source3: mouse-sysconfig
# patch from http://www.geocities.com/dt_or/gpm/patches/
Patch1: %{name}-1.20.1-evdev-cumulative.patch
Patch2: %{name}-1.20.1-math.patch
Patch3: %{name}-1.20.1-subscript.patch
Patch4: %{name}-1.20.1-input.patch
Patch5: %{name}-1.20.1-consolename.patch
Patch6: %{name}-1.20.1-close-fds.patch
Patch7: %{name}-1.20.1-aligned-sleep.patch
Patch8: %{name}-1.20.1-deadsocket.patch
Patch200: %{name}-1.20.1-nomessages.patch
Patch201: %{name}-1.20.1-nolibmessages.patch
Packager: Silvan Calarco <silvan@openmamba.org>
URL: https://www.nico.schottelius.org/software/gpm/
Source: https://github.com/telmich/gpm.git/master@%{gitcommit}/gpm-%{version}.tar.bz2
Source1: gpm.service
Source2: gpm.path
Source3: gpm-profile.sh
Patch0: gpm-1.20.7+20200717git.e82d1a6-drop-broken-configure-code.patch
Patch1: gpm-1.20.7+20200717git.e82d1a6-src-daemon-remove-obvious-use-of-unitialized-data.patch
Patch2: gpm-1.20.7+20200717git.e82d1a6-src-daemon-reindent-switch-statement-to-avoid-compil.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: chkconfig
BuildRequires: glibc-devel
BuildRequires: libncurses-devel
## AUTOBUILDREQ-END
%if "%{stage1}" != "1"
BuildRequires: emacs-nox >= 21.3
BuildRequires: emacs-X11 >= 21.3
%endif
Requires: chkconfig
BuildRequires: emacs-x11 >= 21.3
Requires: libgpm = %{?epoch:%epoch:}%{version}-%{release}
Requires(post): %{__install_info}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Gpm provides mouse support to text-based Linux applications like the emacs editor, the Midnight Commander file management system, and other programs.
@@ -57,35 +45,26 @@ Requires: libgpm = %{?epoch:%epoch:}%{version}-%{release}
Library and header files for developing mouse driven programs.
%prep
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%setup -q
#%patch1 -p1 -b .evdev-cumulative
#%patch2 -p1 -b .math
#%patch3 -p1 -b .subscript
#%patch4 -p1 -b .input
#%patch5 -p1 -b .consolename
#%patch6 -p1 -b .close-fds
#%patch7 -p1 -b .aligned-sleep
#%patch8 -p1 -b .deadsocket
#%patch200 -p1
#%patch201 -p1
%patch 0 -p1 -b .drop-broken-configure-code
%patch 1 -p1 -b .src-daemon-remove-obvious-use-of-unitialized-data
%patch 2 -p1 -b .src-daemon-reindent-switch-statement-to-avoid-compil
./autogen.sh
%build
./autogen.sh
CFLAGS="-D_GNU_SOURCE %{optflags}" \
lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \
%configure --without-curses
export CFLAGS="-D_GNU_SOURCE %{optflags} -std=gnu17"
# note: parallel build does not work
%make -j1
%configure
%make
%install
%makeoldinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp
%makeinstall
install -m755 -D %{S:1} %{buildroot}%{_initrddir}/gpm
install -m644 -D %{S:2} %{buildroot}%{_sysconfdir}/gpm-root.conf
install -m644 -D %{S:3} %{buildroot}%{_sysconfdir}/sysconfig/mouse
install -m644 -D %{SOURCE1} %{buildroot}%{_unitdir}/gpm.service
install -m644 -D %{SOURCE2} %{buildroot}%{_unitdir}/gpm.path
install -m755 -D %{SOURCE3} %{buildroot}%{_sysconfdir}/profile.d/gpm.sh
# fix strange permission
chmod +x %{buildroot}%{_libdir}/libgpm.so.*
@@ -95,31 +74,22 @@ ln -s libgpm.so.2 %{buildroot}%{_libdir}/libgpm.so
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%post
if [ $1 -eq 1 ]; then
/sbin/chkconfig --add gpm 2>/dev/null
fi
%install_info gpm.info
exit 0
%systemd_post gpm.service
:
%preun
if [ $1 -eq 0 ]; then
/sbin/chkconfig --del gpm
[ -e /var/lock/subsys/gpm ] && service gpm stop
fi
%systemd_preun gpm.service
%uninstall_info gpm.info
exit 0
:
%postun
if [ $1 -eq 1 ]; then
service gpm condrestart
fi
exit 0
%post -n libgpm -p /sbin/ldconfig
%postun -n libgpm -p /sbin/ldconfig
%systemd_postun_with_restart gpm.service
:
%files
%defattr(-,root,root)
%{_sysconfdir}/profile.d/gpm.sh
%{_bindir}/display-buttons
%{_bindir}/display-coords
%{_bindir}/disable-paste
@@ -133,15 +103,14 @@ exit 0
%{_datadir}/emacs/site-lisp/t-mouse.el
%{_datadir}/emacs/site-lisp/t-mouse.elc
%endif
%{_initrddir}/gpm
%{_unitdir}/gpm.service
%{_unitdir}/gpm.path
%{_infodir}/gpm.info.*
%{_mandir}/man1/gpm-root.*
%{_mandir}/man1/mev.*
%{_mandir}/man1/mouse-test.*
%{_mandir}/man7/gpm-types.*
%{_mandir}/man8/gpm.*
%config(noreplace) %{_sysconfdir}/gpm-root.conf
%config(noreplace) %{_sysconfdir}/sysconfig/mouse
%files -n libgpm
%defattr(-,root,root)
@@ -158,6 +127,12 @@ exit 0
%doc conf/*.conf
%changelog
* Wed Dec 31 2025 Silvan Calarco <silvan@openmamba.org> 1.20.7+20200717git.e82d1a6-1mamba
- update to 1.20.7+20200717git.e82d1a6
* Wed Dec 31 2025 Automatic Build System <autodist@openmamba.org> 1.20.7.r38.ge82d1a6-2mamba
- automatic rebuild by autodist
* Sat Oct 24 2020 Automatic Build System <autodist@mambasoft.it> 1.20.7.r38.ge82d1a6-1mamba
- automatic version update by autodist

View File

@@ -1,7 +0,0 @@
MOUSETYPE=imps2
XMOUSETYPE=PS/2
FULLNAME="PS/2|Standard"
XEMU3=yes
WHEEL=no
device=psaux
REPEAT_TYPE=