]> thyrsus.com Git - showkey.git/commitdiff
Repackaged.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 1 Aug 2002 10:04:06 +0000 (10:04 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 1 Aug 2002 10:04:06 +0000 (10:04 +0000)
Makefile
README
showkey.c

index 4d7cc88429a1f4cc28075fdc8a7535809cf81dd5..7dfa9bc0173b96b2fb27715deb5530e5cff1862b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,43 @@
-#
-# Makefile for the showkey utility
-#
-CFLAGS = -g
+# showkey -- keystroke echoer
 
-all: showkey
+# Note: When the version changes, you also have to change the RPM spec file.
+VERS=1.2
+
+CFLAGS = -O
 
 showkey: showkey.c
+       $(CC) -DREVISION=$(VERS) showkey.c -o showkey
+
+showkey.1: showkey.xml
+       xmlto man showkey.xml 
 
-SOURCES = READ.ME showkey.1 Makefile showkey.c showkey.lsm
+clean:
+       rm -f showkey showkey.o splashscreen.h showkey.1 *.rpm *.tar.gz
 
-showkey.tar: $(SOURCES)
-       tar -cvf showkey.tar $(SOURCES)
-showkey.tar.gz: showkey.tar
-       gzip showkey.tar
+install: showkey.1
+       cp showkey /usr/bin/showkey
+       cp showkey.1 /usr/share/man/man1
 
-showkey.shar: $(SOURCES)
-       shar $(SOURCES) >showkey.shar
+uninstall:
+       rm /usr/bin/showkey
+       rm /usr/share/man/man1/showkey.1
 
-clean:
-       rm -f showkey showkey.tar showkey.tar.gz showkey.shar
+SOURCES = READ.ME Makefile showkey.c showkey.xml showkey.lsm showkey.spec
+
+showkey-$(VERS).tar.gz: $(SOURCES) showkey.1
+       @ls $(SOURCES) showkey.1 | sed s:^:showkey-$(VERS)/: >MANIFEST
+       @(cd ..; ln -s showkey showkey-$(VERS))
+       (cd ..; tar -czvf showkey/showkey-$(VERS).tar.gz `cat showkey/MANIFEST`)
+       @(cd ..; rm showkey-$(VERS))
+
+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 .
diff --git a/README b/README
index 0beee4e8ff498600a6a3979f14f9f04551326252..d80b66538fafd63bf7642c5d8e92cc13a79b55ef 100644 (file)
--- a/README
+++ b/README
@@ -8,7 +8,5 @@ This is one of these silly little utilities that you never think you'll need
 until some unexpected situation pops up and you have to have it.  Then you
 get to be mugged by the details of tty-interface code, yippee.  Never again!
 
-Runs under System V or Linux.  Could be POSIXified almost trivially.
-
-You may find updates and related resources via WWW
-at http://www.tuxedo.org/~esr/home.html.
+You may find updates and related resources via WWW at
+<http://www.tuxedo.org/~esr/>.
index dfb4c977ac82034be30e30797c5fc5340c6a6e4c..d22847636f0ec1e9811bb8bda250c42bbc5b18fc 100644 (file)
--- a/showkey.c
+++ b/showkey.c
@@ -4,7 +4,8 @@
  * Invoke this (no arguments needed) to see keycap-to-keystrokes mappings.
  *
  * by Eric S. Raymond <esr@snark.thyrsus.com>, 1 Nov 88
- * fix for little-endian machines 21 Oct 1996.
+ * - fix for little-endian machines 21 Oct 1996.
+ * - cleanup and modern packaging (version 1.3), 1 Aug 2002.
  */
 #include <stdio.h>
 #include <termio.h>