# showkey -- keystroke echoer
-# Note: When the version changes, you also have to change the RPM spec file.
-VERS=1.3
-
-CFLAGS = -O
+VERS=$(shell sed <showkey.spec -n -e '/Version: \(.*\)/s//\1/p')
showkey: showkey.c
$(CC) -DREVISION=$(VERS) showkey.c -o showkey
rm /usr/bin/showkey
rm /usr/share/man/man1/showkey.1
-SOURCES = READ.ME Makefile showkey.c showkey.xml showkey.spec
+SOURCES = README Makefile showkey.c showkey.xml showkey.spec
showkey-$(VERS).tar.gz: $(SOURCES) showkey.1
@ls $(SOURCES) showkey.1 | sed s:^:showkey-$(VERS)/: >MANIFEST
dist: showkey-$(VERS).tar.gz
-RPMROOT=/usr/src/redhat
-RPM = rpm
-RPMFLAGS = -ba
-rpm: dist
- cp showkey-$(VERS).tar.gz $(RPMROOT)/SOURCES;
- cp showkey.spec $(RPMROOT)/SPECS
- cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) showkey.spec
- cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/showkey-$(VERS)*.rpm .
- cp $(RPMROOT)/SRPMS/showkey-$(VERS)*.src.rpm .
* - fix for little-endian machines (version 1.1), 21 Oct 1996.
* - cleanup and modern packaging (version 1.2), 1 Aug 2002.
* - changed to use termios (version 1.3), 26 Aug 2002.
+ * See the RPM spec file changelog for more recent stuff.
*/
#include <stdio.h>
#include <termios.h>
unsigned char c;
unsigned int i, timeouts;
- for (i = SIGHUP; i <= SIGPOLL; i++)
+ for (i = SIGHUP; i <= SIGIO; i++)
(void) signal(c, catcher);
// Get the state of the tty