summarylogtreecommitdiffstats
path: root/0001-Honour-PREFIX-and-DESTDIR-and-don-t-restart-when-ins.patch
blob: f82fa3607f39b5b61abe43f5636e6d671379ca3b (plain)
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
52
53
54
55
56
57
58
59
60
61
62
From 9da5e55b5e43dcb6c9d7cabaa3745d7b266fcbce Mon Sep 17 00:00:00 2001
From: Olivier Mehani <shtrom@ssji.net>
Date: Tue, 2 May 2017 21:17:14 +1000
Subject: [PATCH] Honour PREFIX and DESTDIR, and don't restart when installing

This makes packaging easier.

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
---
 Makefile  | 20 ++++++++++++--------
 README.md |  5 +++--
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 5a53d22..ac28ac2 100644
--- a/Makefile
+++ b/Makefile
@@ -6,13 +6,17 @@
 
 # 2. Needs to check whether to restart IBus or SCIM deamon
 
-install:
-	sudo cp x-shortcode-unicode-emoji.mim /usr/share/m17n
-	sudo chmod 644 /usr/share/m17n/x-shortcode-unicode-emoji.mim
+DESTDIR?=
+PREFIX?=/usr
+
+# For Ubuntu 12.04 and ArchLinux
+IBUSOPTS?=-drx
 
-	sudo cp x-shortcode-unicode-emoji.png /usr/share/m17n/icons
-	sudo chmod 644 /usr/share/m17n/icons/x-shortcode-unicode-emoji.png
+INSTALL?=install
+
+install:
+	$(INSTALL) -D -m 0644 x-shortcode-unicode-emoji.mim $(DESTDIR)$(PREFIX)/share/m17n/x-shortcode-unicode-emoji.mim
+	$(INSTALL) -D -m 0644 x-shortcode-unicode-emoji.png $(DESTDIR)$(PREFIX)/share/m17n/icons/x-shortcode-unicode-emoji.png
 
-# For Ubuntu 12.04
-#	ibus-daemon -drx
-	ibus-daemon
+restart:
+	ibus-daemon $(IBUSOPTS)
diff --git a/README.md b/README.md
index bbb458f..0abbfb5 100644
--- a/README.md
+++ b/README.md
@@ -18,8 +18,9 @@ Requirements
 Install in Ubuntu 12.04
 -------------------
 1. Clone this repository
-2. Install the custom input method : `make install`
-3. Launch `ibus-setup` then add `shortname-unicode-emoji (m17n)` input method 
+2. Install the custom input method : `sudo make install`
+3. Restart the ibus daemon : `make restart`
+4. Launch `ibus-setup` then add `shortname-unicode-emoji (m17n)` input method
 
 Example
 -------------------
-- 
2.12.2