forked from Amar1729/homebrew-formulae
-
Notifications
You must be signed in to change notification settings - Fork 0
/
showkey.rb
52 lines (41 loc) · 1.15 KB
/
showkey.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class Showkey < Formula
desc "A simple keystroke visualizer"
version "1.8"
homepage "http://catb.org/esr/showkey/"
url "http://www.catb.org/~esr/showkey/showkey-#{version}.tar.gz"
sha256 "31b6b064976a34d7d8e7a254db0397ba2dc50f1bb6e283038b17c48a358d50d3"
patch :DATA
def install
system "make"
system "make", "PREFIX=#{prefix}", "install"
end
test do
system "true"
end
end
__END__
diff --git a/Makefile b/Makefile
index fcdea61..b3736e7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
# showkey -- keystroke echoer
+PREFIX=/usr
+
VERS=1.8
showkey: showkey.c
@@ -19,12 +21,14 @@ splint:
splint +posixlib +charintliteral +charint showkey.c
install: showkey.1
- cp showkey /usr/bin/showkey
- cp showkey.1 /usr/share/man/man1
+ mkdir -p $(DESTDIR)$(PREFIX)/bin
+ cp showkey $(DESTDIR)$(PREFIX)/bin/showkey
+ mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
+ cp showkey.1 $(DESTDIR)$(PREFIX)/share/man/man1
uninstall:
- rm /usr/bin/showkey
- rm /usr/share/man/man1/showkey.1
+ rm $(DESTDIR)$(PREFIX)/bin/showkey
+ rm $(DESTDIR)$(PREFIX)/share/man/man1/showkey.1
SOURCES = README COPYING NEWS control Makefile showkey.c showkey.xml