aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/gpm
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/gpm')
-rw-r--r--recipes/gpm/gpm-1.20.1/configure.patch35
-rw-r--r--recipes/gpm/gpm-1.20.1/gpm-OPEN_MAX.patch46
-rw-r--r--recipes/gpm/gpm-1.20.1/init32
-rw-r--r--recipes/gpm/gpm-1.20.1/no-docs.patch16
-rw-r--r--recipes/gpm/gpm_1.20.1.bb38
5 files changed, 167 insertions, 0 deletions
diff --git a/recipes/gpm/gpm-1.20.1/configure.patch b/recipes/gpm/gpm-1.20.1/configure.patch
new file mode 100644
index 0000000000..8088fba8cc
--- /dev/null
+++ b/recipes/gpm/gpm-1.20.1/configure.patch
@@ -0,0 +1,35 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- gpm-1.20.1/./configure.in~configure
++++ gpm-1.20.1/./configure.in
+@@ -3,8 +3,9 @@
+ dnl Process this file with autoconf to produce a configure script.
+ dnl written jan/1997 - T.E.Dickey <dickey@clark.net>
+
+-AC_INIT(src/gpm.c)
+-AC_PREREQ(2.12)
++AC_INIT
++AC_CONFIG_SRCDIR([src/gpm.c])
++AC_PREREQ(2.57)
+ AC_CONFIG_HEADER(src/headers/config.h)
+
+ release=1.20.1
+@@ -82,7 +83,7 @@
+ fi
+
+ ITZ_SYS_ELF
+-if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then
++if test ${itz_cv_sys_elf} = yes && test x${ac_cv_c_compiler_gnu} = xyes ; then
+ SHLIB=libgpm.so
+ else
+ SHLIB=
+@@ -132,4 +133,5 @@
+
+ dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir")
+ dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir")
+-AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm)
++AC_CONFIG_FILES([Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm])
++AC_OUTPUT
diff --git a/recipes/gpm/gpm-1.20.1/gpm-OPEN_MAX.patch b/recipes/gpm/gpm-1.20.1/gpm-OPEN_MAX.patch
new file mode 100644
index 0000000000..6fa86e1168
--- /dev/null
+++ b/recipes/gpm/gpm-1.20.1/gpm-OPEN_MAX.patch
@@ -0,0 +1,46 @@
+Index: gpm-1.20.1/src/prog/gpm-root.y
+===================================================================
+--- gpm-1.20.1.orig/src/prog/gpm-root.y
++++ gpm-1.20.1/src/prog/gpm-root.y
+@@ -44,7 +44,6 @@
+ #include <sys/stat.h> /* fstat() */
+ #include <sys/utsname.h> /* uname() */
+ #include <termios.h> /* winsize */
+-#include <linux/limits.h> /* OPEN_MAX */
+ #include <linux/vt.h> /* VT_ACTIVATE */
+ #include <linux/keyboard.h> /* K_SHIFT */
+ #include <utmp.h>
+@@ -525,7 +524,9 @@ int f_bgcmd(int mode, DrawItem *self, in
+ open("/dev/null",O_RDONLY); /* stdin */
+ open(consolename,O_WRONLY); /* stdout */
+ dup(1); /* stderr */
+- for (i=3;i<OPEN_MAX; i++) close(i);
++ int open_max = sysconf(_SC_OPEN_MAX);
++ if (open_max == -1) open_max = 1024;
++ for (i=3;i<open_max; i++) close(i);
+ execl("/bin/sh","sh","-c",self->arg,(char *)NULL);
+ exit(1); /* shouldn't happen */
+ default: return 0;
+Index: gpm-1.20.1/src/special.c
+===================================================================
+--- gpm-1.20.1.orig/src/special.c
++++ gpm-1.20.1/src/special.c
+@@ -25,7 +25,6 @@
+
+ /* This file is compiled conditionally, see the Makefile */
+
+-#include <linux/limits.h> /* for OPEN_MAX */
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -155,7 +154,9 @@ int processSpecial(Gpm_Event *event)
+ open(GPM_NULL_DEV,O_RDONLY); /* stdin */
+ open(option.consolename,O_WRONLY); /* stdout */
+ dup(1); /* stderr */
+- for (i=3;i<OPEN_MAX; i++) close(i);
++ int open_max = sysconf(_SC_OPEN_MAX);
++ if (open_max == -1) open_max = 1024;
++ for (i=3;i<open_max; i++) close(i);
+ execl("/bin/sh","sh","-c",command,(char *)NULL);
+ exit(1); /* shouldn't happen */
+
diff --git a/recipes/gpm/gpm-1.20.1/init b/recipes/gpm/gpm-1.20.1/init
new file mode 100644
index 0000000000..f90fce9fc0
--- /dev/null
+++ b/recipes/gpm/gpm-1.20.1/init
@@ -0,0 +1,32 @@
+#! /bin/sh
+
+# Grab the common functions
+#. /etc/init.d/functions
+
+# FIXME:
+# Add a configuration file for GPM here
+
+test -x /usr/sbin/gpm || exit 0
+
+case "$1" in
+ start)
+ if [ ! -p /dev/gpmdata ]; then
+ mkfifo /dev/gpmdata
+ fi
+
+ echo "Starting GPM:"
+ start-stop-daemon -S -x /usr/sbin/gpm -- -R -m /dev/psaux -t ps2
+ ;;
+ stop)
+ echo "Stopping GPM:"
+ start-stop-daemon -K -x /usr/sbin/gpm
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ usage /etc/init.d/gpm
+esac
+
+exit 0
diff --git a/recipes/gpm/gpm-1.20.1/no-docs.patch b/recipes/gpm/gpm-1.20.1/no-docs.patch
new file mode 100644
index 0000000000..d7fd7fe234
--- /dev/null
+++ b/recipes/gpm/gpm-1.20.1/no-docs.patch
@@ -0,0 +1,16 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- gpm-1.20.1/Makefile.in~no-docs 2002-12-24 23:57:16.000000000 +0100
++++ gpm-1.20.1/Makefile.in 2004-03-26 00:39:38.000000000 +0100
+@@ -19,7 +19,7 @@
+ # user-overridable flags, but it's also all the implicit rule looks at.
+ # missing ?
+
+-SUBDIRS = src doc contrib
++SUBDIRS = src
+
+ ### simple, but effective rules
+
diff --git a/recipes/gpm/gpm_1.20.1.bb b/recipes/gpm/gpm_1.20.1.bb
new file mode 100644
index 0000000000..5b278b7cee
--- /dev/null
+++ b/recipes/gpm/gpm_1.20.1.bb
@@ -0,0 +1,38 @@
+DESCRIPTION = "GPM (General Purpose Mouse) is a mouse server \
+for the console and xterm, with sample clients included \
+(emacs, etc)."
+SECTION = "console/utils"
+LICENSE = "GPL"
+DEPENDS = "ncurses"
+
+PR = "r3"
+PARALLEL_MAKE = ""
+
+SRC_URI = "ftp://arcana.linux.it/pub/gpm/gpm-${PV}.tar.bz2 \
+ file://configure.patch;patch=1 \
+ file://no-docs.patch;patch=1 \
+ file://gpm-OPEN_MAX.patch;patch=1 \
+ file://init"
+
+inherit autotools update-rc.d
+
+INITSCRIPT_NAME = "gpm"
+INITSCRIPT_PARAMS = "defaults"
+
+export LIBS = "-lm"
+
+do_configure_prepend () {
+ cp aclocal.m4 acinclude.m4
+}
+
+do_stage () {
+ install -m 0644 src/headers/gpm.h ${STAGING_INCDIR}/
+ oe_libinstall -so -a -C src/lib libgpm ${STAGING_LIBDIR}
+}
+
+do_install () {
+ oe_runmake 'ROOT=${D}' install
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/gpm
+ cd ${D}${libdir} && ln -sf libgpm.so.1.19.0 libgpm.so.1
+}