From 5b9f257ee76a5e5d2b2304bb9c20614cecd3f302 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Thu, 29 May 2008 11:51:59 +0000 Subject: [PATCH] Updated to 1.20.3 Fixed init script to comply with LSB standard (#246937) Mass patch cleanup Fixed typo in doc (#446679) --- .cvsignore | 3 +- gpm-1.20.3-close-fds.patch | 13 ++++ gpm-1.20.3-gcc4.3.patch | 10 +++ gpm.init | 123 ++++++++++++++++++++++++------------- gpm.spec | 69 +++++++++------------ sources | 2 +- 6 files changed, 133 insertions(+), 87 deletions(-) create mode 100644 gpm-1.20.3-close-fds.patch create mode 100644 gpm-1.20.3-gcc4.3.patch diff --git a/.cvsignore b/.cvsignore index e4d79e7..df9d9f4 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1 @@ -gpm-1.20.1.tar.gz -gpm.rc +gpm-1.20.3.tar.gz diff --git a/gpm-1.20.3-close-fds.patch b/gpm-1.20.3-close-fds.patch new file mode 100644 index 0000000..d6d4b97 --- /dev/null +++ b/gpm-1.20.3-close-fds.patch @@ -0,0 +1,13 @@ +--- gpm-1.20.3/src/daemon/startup.c.close-fds 2008-05-28 13:18:59.000000000 +0200 ++++ gpm-1.20.3/src/daemon/startup.c 2008-05-28 13:20:13.000000000 +0200 +@@ -143,6 +143,10 @@ void startup(int argc, char **argv) + * 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); + + //return mouse_table[1].fd; /* the second is handled in the main() */ + diff --git a/gpm-1.20.3-gcc4.3.patch b/gpm-1.20.3-gcc4.3.patch new file mode 100644 index 0000000..f32ab81 --- /dev/null +++ b/gpm-1.20.3-gcc4.3.patch @@ -0,0 +1,10 @@ +--- gpm-1.20.3/src/daemon/open_console.c.gcc4.3 2008-05-28 11:12:34.000000000 +0200 ++++ gpm-1.20.3/src/daemon/open_console.c 2008-05-28 11:12:40.000000000 +0200 +@@ -21,7 +21,6 @@ + + #include /* open and co. */ + #include /* stat() */ +-#include /* ioctl */ + + /* Linux specific (to be outsourced in gpm2 */ + #include /* for serial console check */ diff --git a/gpm.init b/gpm.init index 3efa029..97e50b7 100755 --- a/gpm.init +++ b/gpm.init @@ -9,6 +9,19 @@ # pidfile: /var/run/gpm.pid # config: /etc/sysconfig/mouse +### BEGIN INIT INFO +# Provides: gpm +# Required-Start: $syslog $local_fs +# Required-Stop: $syslog $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start and stop gpm daemon +# Description: GPM adds mouse support to text-based Linux applications such \ +# as the Midnight Commander. It also allows mouse-based console \ +# cut-and-paste operations, and includes support for pop-up \ +# menus on the console. +### END INIT INFO + # source function library . /etc/init.d/functions @@ -18,55 +31,77 @@ fi RETVAL=0 +check() { + # Check that we're a privileged user + [ `id -u` = 0 ] || exit 4 + + # Check if acpid is executable + test -x /usr/sbin/gpm || exit 5 +} + start() { - echo -n $"Starting console mouse services: " - if [ -z "$MOUSETYPE" ]; then - MOUSETYPE="exps2" - fi - - if [ -z "$DEVICE" ]; then - DEVICE="/dev/input/mice" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo $"(no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$IMOUSETYPE" ]; then - if [ "$(pidofproc inputattach)" = "" ]; then - modprobe sermouse > /dev/null 2>&1 - /usr/sbin/inputattach -$IMOUSETYPE $DEVICE --daemon - DEVICE="/dev/input/mice" - MOUSETYPE="exps2" + check + + if [ ! -f /var/lock/subsys/gpm ]; then + echo -n $"Starting console mouse services: " + + if [ -z "$MOUSETYPE" ]; then + MOUSETYPE="exps2" fi - fi - - if [ -n "$MOUSETYPE" ]; then - daemon gpm -m $DEVICE -t $MOUSETYPE $OPTIONS - else - daemon gpm -m $DEVICE $OPTIONS + + if [ -z "$DEVICE" ]; then + DEVICE="/dev/input/mice" + fi + + if [ "$MOUSETYPE" = "none" ]; then + echo $"(no mouse is configured)" + exit 0 + fi + + if [ "$MOUSETYPE" = "Microsoft" ]; then + MOUSETYPE=ms + fi + + if [ -n "$IMOUSETYPE" ]; then + if [ "$(pidofproc inputattach)" = "" ]; then + modprobe sermouse > /dev/null 2>&1 + /usr/sbin/inputattach -$IMOUSETYPE $DEVICE --daemon + DEVICE="/dev/input/mice" + MOUSETYPE="exps2" + fi + fi + + if [ -n "$MOUSETYPE" ]; then + daemon /usr/sbin/gpm -m $DEVICE -t $MOUSETYPE $OPTIONS + else + daemon /usr/sbin/gpm -m $DEVICE $OPTIONS + fi + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gpm + echo fi - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gpm + return $RETVAL } stop() { + + check + echo -n $"Shutting down console mouse services: " - killproc gpm + killproc /usr/sbin/gpm if [ -n "$IMOUSETYPE" ]; then killproc inputattach fi RETVAL=$? - - echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/gpm + echo + return $RETVAL +} + +restart() { + stop + start } case "$1" in @@ -76,14 +111,16 @@ case "$1" in stop) stop ;; - restart|reload) - stop - start + force-reload|reload) + echo "$0: Unimplemented feature." + RETVAL=3 + ;; + restart) + restart ;; condrestart) if [ -f /var/lock/subsys/gpm ]; then - stop - start + restart fi ;; status) @@ -91,8 +128,8 @@ case "$1" in RETVAL=$? ;; *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - exit 1 + echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}" + RETVAL=2 esac exit $RETVAL diff --git a/gpm.spec b/gpm.spec index eb8f885..5dadc7f 100644 --- a/gpm.spec +++ b/gpm.spec @@ -1,35 +1,23 @@ Summary: A mouse server for the Linux console. Name: gpm -Version: 1.20.1 -Release: 90%{?dist} +Version: 1.20.3 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Daemons Source: http://ftp.linux.it/pub/People/rubini/gpm/%{name}-%{version}.tar.gz Source1: gpm.init Source2: inputattach.c -Patch1: gpm-evdev-cumulative.patch -Patch2: gpm-1.20.1-math.patch -Patch3: gpm-1.20.1-weak-wgetch.patch -Patch4: gpm-1.20.1-nodebug.patch -Patch5: gpm-1.20.1-gpmopen.patch -Patch6: gpm-1.20.1-idie.patch -Patch16: gpm-1.20.1-subscript.patch -Patch17: gpm-1.20.1-input.patch -Patch18: gpm-1.20.1-consolename.patch -Patch19: gpm-1.20.1-multilib.patch -Patch20: gpm-1.20.1-no-console-error.patch -Patch21: gpm-1.20.1-lib-silent.patch -Patch22: gpm-1.20.1-close-fds.patch -Patch23: gpm-1.20.1-aligned-sleep.patch -Patch24: gpm-1.20.1-deadsocket.patch -Patch25: gpm-1.20.1-default-handler.patch -Patch26: gpm-1.20.1-va_list.patch -Patch27: gpm-1.20.1-openmax.patch +Patch1: gpm-1.20.1-multilib.patch +Patch2: gpm-1.20.1-lib-silent.patch +Patch3: gpm-1.20.3-gcc4.3.patch +Patch4: gpm-1.20.3-close-fds.patch +Patch5: gpm-1.20.1-doc.patch +Patch6: gpm-1.20.1-weak-wgetch.patch Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info Requires: bash >= 2.0 # this defines the library version that this package builds. -%define LIBVER 1.19.0 +%define LIBVER 1.20.0 BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildPrereq: sed gawk texinfo bison ncurses-devel autoconf @@ -40,7 +28,6 @@ also provides console cut-and-paste operations using the mouse and includes a program to allow pop-up menus to appear at the click of a mouse button. - %package devel Requires: %{name} = %{version}-%{release} Summary: A mouse server for the Linux console. @@ -56,27 +43,17 @@ mouse button. %prep %setup -q -%patch1 -p1 -b .evdev -%patch2 -p1 -b .math -%patch3 -p1 -b .weak-wgetch -%patch4 -p1 -b .nodebug -%patch5 -p1 -b .gpmopen -%patch6 -p1 -b .idie -%patch16 -p1 -b .subscript -%patch17 -p1 -b .input -%patch18 -p1 -b .consolename -%patch19 -p1 -b .multilib -%patch20 -p1 -b .no-console-error -%patch21 -p1 -b .lib-silent -%patch22 -p1 -b .close-fds -%patch23 -p1 -b .aligned-sleep -%patch24 -p1 -b .deadsocket -%patch25 -p1 -b .default-handler -%patch26 -p1 -b .va_list -%patch27 -p1 -b .openmax +%patch1 -p1 -b .multilib +%patch2 -p1 -b .lib-silent +%patch3 -p1 -b .gcc4.3 +%patch4 -p1 -b .close-fds +%patch5 -p1 -b .doc +%patch6 -p1 -b .weak-wgetch + %build rm -f configure +rm -f src/prog/open_console.o autoconf CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ @@ -136,6 +113,8 @@ rm -f $RPM_BUILD_ROOT/usr/bin/hltest rm -f $RPM_BUILD_ROOT/usr/bin/mouse-test rm -rf $RPM_BUILD_ROOT/%{_mandir} rm -f $RPM_BUILD_ROOT/usr/sbin/inputattach +rm -f $RPM_BUILD_ROOT/usr/bin/display-buttons +rm -f $RPM_BUILD_ROOT/usr/bin/display-coords %endif %clean @@ -175,6 +154,8 @@ fi %{_bindir}/gpm-root %{_bindir}/hltest %{_bindir}/mouse-test +%{_bindir}/display-coords +%{_bindir}/display-buttons %{_mandir}/man1/mev.1* %{_mandir}/man1/gpm-root* %{_mandir}/man7/gpm-types* @@ -193,6 +174,12 @@ fi %{_libdir}/libgpm.so %changelog +* Thu May 29 2008 Zdenek Prikryl - 1.20.3-1 +- Updated to 1.20.3 +- Fixed init script to comply with LSB standard (#246937) +- Mass patch cleanup +- Fixed typo in doc (#446679) + * Wed Feb 20 2008 Fedora Release Engineering - 1.20.1-90 - Autorebuild for GCC 4.3 @@ -460,7 +447,7 @@ fi - Don't crash if we can't open /dev/console (Happens with some devfs enabled kernels) -* Tue Jan 23 2001 Trond Eivind Glomsrød +* Tue Jan 23 2001 Trond Eivind Glomsr�d - fix bug in i18n of initscript * Tue Jan 23 2001 Preston Brown diff --git a/sources b/sources index 0109447..c585849 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -632a8fa8a6613027e407ee3e7a54cf13 gpm-1.20.1.tar.gz +212251312c7db0396974f25d86d4ae6c gpm-1.20.3.tar.gz