From 5cd3cf5f8f21c95a3526479c132cf95e74ed286a Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 21 Mar 2018 20:11:21 +0000
Subject: gpm: update to 1.20.7-8

---
 abs/core/gpm/PKGBUILD                      | 21 +++++------
 abs/core/gpm/__changelog                   |  1 +
 abs/core/gpm/gpm-1.20.7-glibc-2.26-1.patch | 58 ++++++++++++++++++++++++++++++
 abs/core/gpm/gpm.install                   | 16 ---------
 abs/core/gpm/gpm.sh                        |  2 +-
 5 files changed, 71 insertions(+), 27 deletions(-)
 create mode 100644 abs/core/gpm/__changelog
 create mode 100644 abs/core/gpm/gpm-1.20.7-glibc-2.26-1.patch
 delete mode 100644 abs/core/gpm/gpm.install

diff --git a/abs/core/gpm/PKGBUILD b/abs/core/gpm/PKGBUILD
index cb2cd9b..37fd76e 100644
--- a/abs/core/gpm/PKGBUILD
+++ b/abs/core/gpm/PKGBUILD
@@ -1,24 +1,21 @@
-# $Id: PKGBUILD 197717 2013-10-28 22:26:50Z eric $
+# $Id$
 # Maintainer: Eric Bélanger <eric@archlinux.org>
 
 pkgname=gpm
 pkgver=1.20.7
-pkgrel=4
+pkgrel=8
 pkgdesc="A mouse server for the console and xterm"
-arch=('i686' 'x86_64')
+arch=('x86_64')
 url="http://www.nico.schottelius.org/software/gpm/"
 license=('GPL')
-depends=('bash')
+depends=('bash' 'procps-ng')
 options=('!makeflags')
-install=gpm.install
-source=(http://www.nico.schottelius.org/software/gpm/archives/${pkgname}-${pkgver}.tar.lzma \
-        gpm.sh gpm.service)
-sha1sums=('8d9f3655c80ce7667d31ede2a100b44986480369'
-          '88fe5ff10916c68a87abc8418a56eb0073f69fa9'
-          'f9bde96eb9c78da9f225bcf40822647f6592cf23')
+source=(http://www.nico.schottelius.org/software/gpm/archives/${pkgname}-${pkgver}.tar.lzma
+        gpm.sh gpm.service gpm-1.20.7-glibc-2.26-1.patch)
 
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
+  patch -p1 < ${srcdir}/gpm-1.20.7-glibc-2.26-1.patch || return 1
   ./autogen.sh
   ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin
   make
@@ -35,3 +32,7 @@ package() {
   ln -s libgpm.so.2.* libgpm.so
   chmod 755 "${pkgdir}"/usr/lib/libgpm.so.*
 }
+md5sums=('fa8a6fe09826896625ca557ac5e42ed7'
+         'd73dd7e579192a58e5af72be206ce3c8'
+         '452cd869cfcc2fd9678f59b3757e4f83'
+         'b3554e7a64402f87dd72473727dcd32e')
diff --git a/abs/core/gpm/__changelog b/abs/core/gpm/__changelog
new file mode 100644
index 0000000..f81c49f
--- /dev/null
+++ b/abs/core/gpm/__changelog
@@ -0,0 +1 @@
+PKGBUILD: add gpm-1.20.7-glibc-2.26-1.patch
diff --git a/abs/core/gpm/gpm-1.20.7-glibc-2.26-1.patch b/abs/core/gpm/gpm-1.20.7-glibc-2.26-1.patch
new file mode 100644
index 0000000..6f63c27
--- /dev/null
+++ b/abs/core/gpm/gpm-1.20.7-glibc-2.26-1.patch
@@ -0,0 +1,58 @@
+diff -Naur gpm-1.20.7-orig/src/daemon/open_console.c gpm-1.20.7/src/daemon/open_console.c
+--- gpm-1.20.7-orig/src/daemon/open_console.c	2012-10-26 21:21:38.000000000 +0000
++++ gpm-1.20.7/src/daemon/open_console.c	2017-08-08 17:58:15.176232558 +0000
+@@ -23,6 +23,10 @@
+ #include <sys/stat.h>               /* stat()            */
+ #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 -Naur gpm-1.20.7-orig/src/prog/gpm-root.y gpm-1.20.7/src/prog/gpm-root.y
+--- gpm-1.20.7-orig/src/prog/gpm-root.y	2012-10-26 21:21:38.000000000 +0000
++++ gpm-1.20.7/src/prog/gpm-root.y	2017-08-08 18:00:36.442898559 +0000
+@@ -443,6 +443,7 @@
+ }
+ 
+ /*---------------------------------------------------------------------*/
++#if 0
+ static int f_debug_one(FILE *f, Draw *draw)
+ {
+    DrawItem *ip;
+@@ -465,6 +466,7 @@
+ #undef LINE
+    return 0;
+ }
++#endif
+ 
+ int f_debug(int mode, DrawItem *self, int uid)
+ {
+@@ -960,10 +962,8 @@
+ /*------------*/
+ static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
+ {
+-   int x,y, dumpfd;
++   int dumpfd;
+    char dumpname[20];
+-
+-   x=buffer[2]; y=buffer[3];
+    
+    /* WILL NOT WORK WITH DEVFS! FIXME! */
+    sprintf(dumpname,"/dev/vcsa%i",vc);
+@@ -1196,11 +1196,7 @@
+                                                         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__ */
++   sigemptyset(&childaction.sa_mask);
+    childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
+    sigaction(SIGCHLD,&childaction,NULL);
+ 
diff --git a/abs/core/gpm/gpm.install b/abs/core/gpm/gpm.install
deleted file mode 100644
index 2a1519a..0000000
--- a/abs/core/gpm/gpm.install
+++ /dev/null
@@ -1,16 +0,0 @@
-infodir=/usr/share/info
-file=gpm.info.gz
-
-post_install() {
-  [ -x usr/bin/install-info ] || return 0
-  install-info $infodir/$file $infodir/dir 2> /dev/null
-}
-
-post_upgrade() {
-  post_install $1
-}
-
-pre_remove() {
-  [ -x usr/bin/install-info ] || return 0
-  install-info --delete $infodir/$file $infodir/dir 2> /dev/null
-}
diff --git a/abs/core/gpm/gpm.sh b/abs/core/gpm/gpm.sh
index af35a5f..1aea572 100755
--- a/abs/core/gpm/gpm.sh
+++ b/abs/core/gpm/gpm.sh
@@ -1,3 +1,3 @@
 case $( /usr/bin/tty ) in
-    /dev/tty[0-9]*) [ -n "$(pgrep gpm)" ] && /usr/bin/disable-paste ;;
+    /dev/tty[0-9]*) [ -n "$(pidof -s gpm)" ] && /usr/bin/disable-paste ;;
 esac
-- 
cgit v0.12

