[packages/gpm] Rel 2; Fixes from upstream

arekm arekm at pld-linux.org
Mon Mar 2 16:11:51 CET 2026


commit 49b90d2e6a559e33e01a7fa3ad6ef81eac7bb892
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Mar 2 16:11:36 2026 +0100

    Rel 2; Fixes from upstream

 branch.sh           | 32 +++++++++++++++++++++++++
 format-string.patch | 11 ---------
 gcc10.patch         | 39 ------------------------------
 glibc.patch         | 69 -----------------------------------------------------
 gpm-DESTDIR.patch   |  8 +++----
 gpm-ncursesw.patch  | 12 +++++-----
 gpm.spec            | 19 +++++++--------
 7 files changed, 50 insertions(+), 140 deletions(-)
---
diff --git a/gpm.spec b/gpm.spec
index cb6dccc..d906a0b 100644
--- a/gpm.spec
+++ b/gpm.spec
@@ -14,17 +14,19 @@ Summary(tr.UTF-8):	Genel amaçlı fare desteği
 Summary(uk.UTF-8):	Сервер роботи з мишою для консолі Linux
 Name:		gpm
 Version:	1.20.7
-Release:	1
+Release:	2
 Epoch:		1
 License:	GPL v2+
 Group:		Daemons
-Source0:	http://www.nico.schottelius.org/software/gpm/archives/%{name}-%{version}.tar.lzma
+Source0:	https://www.nico.schottelius.org/software/gpm/archives/%{name}-%{version}.tar.lzma
 # Source0-md5:	fa8a6fe09826896625ca557ac5e42ed7
 Source1:	%{name}.init
 Source2:	%{name}.sysconfig
 Source3:	http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
 # Source3-md5:	893cf1468604523c6e9f9257a5671688
 Source4:	%{name}.service
+Patch100:	gpm-git.patch
+# Patch100-md5:	d1f3262c8be4c268e5879d4288a3402d
 Patch0:		%{name}-info.patch
 Patch1:		%{name}-DESTDIR.patch
 Patch2:		%{name}-gawk.patch
@@ -32,10 +34,7 @@ Patch3:		%{name}-nodebug.patch
 Patch4:		%{name}-dont_display_stupid_error_messages.patch
 Patch5:		%{name}-ncursesw.patch
 Patch6:		close-fds.patch
-Patch7:		format-string.patch
-Patch8:		glibc.patch
-Patch9:		gcc10.patch
-URL:		http://www.nico.schottelius.org/software/gpm/
+URL:		https://www.nico.schottelius.org/software/gpm/
 BuildRequires:	autoconf >= 2.61
 BuildRequires:	automake
 BuildRequires:	bison
@@ -234,16 +233,14 @@ Pliki trybu GPM dla Emacsa.
 
 %prep
 %setup -q
+%patch -P100 -p1
 %patch -P0 -p1
 %patch -P1 -p1
 %patch -P2 -p1
-%{!?debug:%patch3 -p1}
+%{!?debug:%patch -P3 -p1}
 %patch -P4 -p1
 %patch -P5 -p1
 %patch -P6 -p1
-%patch -P7 -p1
-%patch -P8 -p1
-%patch -P9 -p1
 
 %{__sed} -i -e '1s#/usr/bin/awk#/bin/awk#' doc/manpager
 
@@ -262,7 +259,7 @@ Pliki trybu GPM dla Emacsa.
 
 %{__make} \
 	LDFLAGS="%{rpmcflags} %{rpmldflags}" \
-	DEFS="-DHAVE_CONFIG_H -D_GNU_SOURCE"
+	DEFS="-std=gnu17 -DHAVE_CONFIG_H -D_GNU_SOURCE"
 
 %install
 rm -rf $RPM_BUILD_ROOT
diff --git a/branch.sh b/branch.sh
new file mode 100755
index 0000000..6c3b639
--- /dev/null
+++ b/branch.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+set -e
+url=https://github.com/telmich/gpm.git
+package=gpm
+tag=1.20.7
+branch=master
+out=$package-git.patch
+repo=$package.git
+
+# use filterdiff, etc to exclude bad chunks from diff
+filter() {
+	cat
+}
+
+if [ ! -d $repo ]; then
+	git clone --bare $url -b $branch $repo
+fi
+
+cd $repo
+	git fetch origin +$branch:$branch +refs/tags/$tag:refs/tags/$tag
+	git log -p --date=default --reverse $tag..$branch | filter > ../$out.tmp
+cd ..
+
+if cmp -s $out{,.tmp}; then
+	echo >&2 "No new diffs..."
+	rm -f $out.tmp
+	exit 0
+fi
+mv -f $out{.tmp,}
+
+../md5 $package.spec
+../dropin $out
diff --git a/format-string.patch b/format-string.patch
deleted file mode 100644
index 76f4734..0000000
--- a/format-string.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- gpm-1.20.6/src/lib/report-lib.c~	2012-12-12 13:45:18.744097221 +0100
-+++ gpm-1.20.6/src/lib/report-lib.c	2012-12-12 13:45:49.834096126 +0100
-@@ -47,7 +47,7 @@
-                            log_level = LOG_CRIT; break;
-    }
- #ifdef HAVE_VSYSLOG
--   syslog(log_level, string);
-+   syslog(log_level, "%s", string);
-    vsyslog(log_level, text, ap);
- #else
-    fprintf(stderr,"%s[%s(%d)]:\n",string,file,line);
diff --git a/gcc10.patch b/gcc10.patch
deleted file mode 100644
index 3db4b98..0000000
--- a/gcc10.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From f04f24dd5ca5c1c13608b144ab66e2ccd47f106a Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox at gentoo.org>
-Date: Sun, 19 Jan 2020 19:53:41 +0000
-Subject: [PATCH] src/headers/daemon.h: avoid redefinition of
- 'last_selection_time'
-
-Noticed build failure on gcc-10 as:
-
-```
-gcc  -L/home/slyfox/dev/git/gpm/src  -o gpm mice.o ... report.o tools.o   -lm
-ld: twiddler.o:gpm/src/headers/daemon.h:183:
-  multiple definition of `last_selection_time'; mice.o:gpm/src/headers/daemon.h:183: first defined here
-ld: synaptics.o:git/gpm/src/headers/daemon.h:183:
-  multiple definition of `last_selection_time'; mice.o:git/gpm/src/headers/daemon.h:183: first defined here
-```
-
-gcc-10 will change the default from -fcommon to fno-common:
-https://gcc.gnu.org/PR85678.
-
-The error also happens if CFLAGS=-fno-common passed explicitly.
-
-Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
----
- src/headers/daemon.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/headers/daemon.h b/src/headers/daemon.h
-index a8936ad..24a1a97 100644
---- a/src/headers/daemon.h
-+++ b/src/headers/daemon.h
-@@ -180,7 +180,7 @@ extern struct mouse_features  mouse_table[3],
- extern Gpm_Type         mice[];
- extern Gpm_Type         *repeated_type;
- 
--time_t                  last_selection_time;
-+extern time_t           last_selection_time;
- 
- 
- 
diff --git a/glibc.patch b/glibc.patch
deleted file mode 100644
index d87fe3f..0000000
--- a/glibc.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From b350aee4ea5785a75cb6ad770f6b768c506ebb70 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier at gentoo.org>
-Date: Mon, 14 Mar 2016 15:39:54 -0400
-Subject: [PATCH] fix building w/newer glibc
-
-Linux C libraries are looking to disentangle sysmacros.h from the
-sys/types.h include, so make sure we pull in the header when it is
-found.
----
- src/daemon/open_console.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff -urNp -x '*.orig' gpm-1.20.7.org/src/daemon/open_console.c gpm-1.20.7/src/daemon/open_console.c
---- gpm-1.20.7.org/src/daemon/open_console.c	2012-10-26 23:21:38.000000000 +0200
-+++ gpm-1.20.7/src/daemon/open_console.c	2023-12-02 17:21:16.152842561 +0100
-@@ -21,8 +21,13 @@
- 
- #include <fcntl.h>                  /* open and co.      */
- #include <sys/stat.h>               /* stat()            */
-+#include <sys/types.h>              /* major()           */
- #include <sys/ioctl.h>              /* ioctl             */
- 
-+#ifdef HAVE_SYS_SYSMACROS_H
-+#include <sys/sysmacros.h>          /* major() w/newer glibc */
-+#endif
-+
- /* Linux specific (to be outsourced in gpm2 */
- #include <linux/serial.h>           /* for serial console check */
- #include <asm/ioctls.h>            /* for serial console check */
-diff -urNp -x '*.orig' gpm-1.20.7.org/src/prog/display-buttons.c gpm-1.20.7/src/prog/display-buttons.c
---- gpm-1.20.7.org/src/prog/display-buttons.c	2012-10-26 23:21:38.000000000 +0200
-+++ gpm-1.20.7/src/prog/display-buttons.c	2023-12-02 17:21:16.152842561 +0100
-@@ -36,6 +36,7 @@
- #include <stdio.h>            /* printf()             */
- #include <time.h>             /* time()               */
- #include <errno.h>            /* errno                */
-+#include <sys/select.h>       /* fd_set and FD_*      */
- #include <gpm.h>              /* gpm information      */
- 
- /* display resulting data */
-diff -urNp -x '*.orig' gpm-1.20.7.org/src/prog/display-coords.c gpm-1.20.7/src/prog/display-coords.c
---- gpm-1.20.7.org/src/prog/display-coords.c	2012-10-26 23:21:38.000000000 +0200
-+++ gpm-1.20.7/src/prog/display-coords.c	2023-12-02 17:21:16.152842561 +0100
-@@ -37,6 +37,7 @@
- #include <stdio.h>            /* printf()             */
- #include <time.h>             /* time()               */
- #include <errno.h>            /* errno                */
-+#include <sys/select.h>       /* fd_set and FD_*      */
- #include <gpm.h>              /* gpm information      */
- 
- /* display resulting data */
-diff -urNp -x '*.orig' gpm-1.20.7.org/src/prog/gpm-root.y gpm-1.20.7/src/prog/gpm-root.y
---- gpm-1.20.7.org/src/prog/gpm-root.y	2012-10-26 23:21:38.000000000 +0200
-+++ gpm-1.20.7/src/prog/gpm-root.y	2023-12-02 17:21:16.153842574 +0100
-@@ -1196,12 +1196,8 @@ int main(int argc, char **argv)
-                                                         LOG_DAEMON : LOG_USER);
-    /* reap your zombies */
-    childaction.sa_handler=reap_children;
--#if defined(__GLIBC__)
--   __sigemptyset(&childaction.sa_mask);
--#else /* __GLIBC__ */
--   childaction.sa_mask=0;
--#endif /* __GLIBC__ */
--   childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
-+   sigemptyset(&childaction.sa_mask);
-+   childaction.sa_flags=0;
-    sigaction(SIGCHLD,&childaction,NULL);
- 
-    /*....................................... Connect and get your buffer */
diff --git a/gpm-DESTDIR.patch b/gpm-DESTDIR.patch
index c42fe36..d5a9db8 100644
--- a/gpm-DESTDIR.patch
+++ b/gpm-DESTDIR.patch
@@ -1,8 +1,8 @@
---- gpm-1.20.5.orig/src/Makefile.in	2008-06-19 11:05:56.876688999 +0200
-+++ gpm-1.20.5/src/Makefile.in	2008-06-19 12:39:06.242379899 +0200
-@@ -113,9 +113,7 @@
+--- gpm-1.20.7/src/Makefile.in~	2026-03-02 16:04:10.000000000 +0100
++++ gpm-1.20.7/src/Makefile.in	2026-03-02 16:05:22.370050417 +0100
+@@ -115,9 +115,7 @@ install:	check
  	if test "x at SHLIB@" != "x" ; then \
- 		$(INSTALL_DATA) -m 644 lib/libgpm.so. at abi_full@ $(libdir)/libgpm.so. at abi_full@	;	\
+ 		$(INSTALL_DATA) -m 755 lib/libgpm.so. at abi_full@ $(libdir)/libgpm.so. at abi_full@	;	\
  		cd $(libdir) && $(LN_S) -f libgpm.so. at abi_full@ libgpm.so. at abi_lev@ 					;	\
 -      echo "WARNING: We installed a lib, you should now call ldconfig" 						; 	\
 -      echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so. at abi_full@" 								;	\
diff --git a/gpm-ncursesw.patch b/gpm-ncursesw.patch
index bf217b0..411f1a7 100644
--- a/gpm-ncursesw.patch
+++ b/gpm-ncursesw.patch
@@ -1,19 +1,19 @@
---- gpm-1.20.7/configure.ac.footer.old	2009-09-25 20:21:34.000000000 +0200
-+++ gpm-1.20.7/configure.ac.footer	2009-09-25 20:24:05.000000000 +0200
-@@ -113,14 +113,14 @@
+--- gpm-1.20.7/configure.ac.footer~	2026-03-02 16:05:40.000000000 +0100
++++ gpm-1.20.7/configure.ac.footer	2026-03-02 16:06:32.969499291 +0100
+@@ -117,14 +117,14 @@ No|no|N|n) SHARED_LIBS=-lc ;;
  *)
      SAVELIBS=$LIBS
      LIBS=
 -    for i in tinfo ncurses termcap termlib; do
-+    for i in ncursesw termcap termlib; do
++    for i in tinfow ncursesw tinfo ncurses termcap termlib; do
          if test x$LIBS = x; then
              AC_CHECK_LIB($i, tputs)
          else :; fi
      done
      TERMLIBS=$LIBS
      LIBS=
--    for i in ncurses curses; do
-+    for i in ncursesw curses; do
+-    for i in ncurses curses ncursesw; do
++    for i in ncursesw ncurses curses; do
          if test x$LIBS = x; then
              AC_CHECK_LIB($i, wgetch,,,$TERMLIBS)
          else :; fi
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gpm.git/commitdiff/49b90d2e6a559e33e01a7fa3ad6ef81eac7bb892



More information about the pld-cvs-commit mailing list