commit b72ae5d
Runxi Yu
·
2024-07-26 00:00:00 +0000 UTC
parent db524fb
Makefile: Use install(1) rather than cp(1) for installing If the user uses a restrictive umask, the files copied via cp(1) would not be world-executable. Most of the time I install to /usr/local/bin as root, which causes the installed binaries to be not executable by normal users. By default, install(1) uses -rwxr-xr-x, which solves this. Signed-off-by: Runxi Yu <me@runxiyu.org>
1 files changed,
+9,
-12
M
Makefile
M
Makefile
+9,
-12
1@@ -3,6 +3,7 @@
2
3 GO ?= go
4 RM ?= rm
5+INSTALL ?= install
6 SCDOC ?= scdoc
7 GIT ?= git
8 GOFLAGS ?=
9@@ -41,23 +42,19 @@ res/icon.48.png: res/icon.svg
10 clean:
11 $(RM) -rf senpai doc/senpai.1 doc/senpai.5
12 install:
13- mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR)
14- mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
15- mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man5
16- mkdir -p $(DESTDIR)$(PREFIX)/$(APPDIR)
17- mkdir -p $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/48x48/apps
18- mkdir -p $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/scalable/apps
19- cp -f senpai $(DESTDIR)$(PREFIX)/$(BINDIR)
20- cp -f doc/senpai.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
21- cp -f doc/senpai.5 $(DESTDIR)$(PREFIX)/$(MANDIR)/man5
22- cp -f contrib/senpai.desktop $(DESTDIR)$(PREFIX)/$(APPDIR)/senpai.desktop
23- cp -f res/icon.48.png $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/48x48/apps/senpai.png
24- cp -f res/icon.svg $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/scalable/apps/senpai.svg
25+ $(INSTALL) -D -T senpai $(DESTDIR)$(PREFIX)/$(BINDIR)/senpai
26+ $(INSTALL) -D -T -m644 doc/senpai.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1/senpai.1
27+ $(INSTALL) -D -T -m644 doc/senpai.5 $(DESTDIR)$(PREFIX)/$(MANDIR)/man5/senpai.5
28+ $(INSTALL) -D -T -m644 contrib/senpai.desktop $(DESTDIR)$(PREFIX)/$(APPDIR)/senpai.desktop
29+ $(INSTALL) -D -T -m644 res/icon.48.png $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/48x48/apps/senpai.png
30+ $(INSTALL) -D -T -m644 res/icon.svg $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/scalable/apps/senpai.svg
31 uninstall:
32 $(RM) $(DESTDIR)$(PREFIX)/$(BINDIR)/senpai
33 $(RM) $(DESTDIR)$(PREFIX)/$(MANDIR)/man1/senpai.1
34 $(RM) $(DESTDIR)$(PREFIX)/$(MANDIR)/man5/senpai.5
35 $(RM) $(DESTDIR)$(PREFIX)/$(APPDIR)/senpai.desktop
36+ $(RM) $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/48x48/apps/senpai.png
37+ $(RM) $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/scalable/apps/senpai.svg
38
39 emoji:
40 curl -sSfL -o emoji.json "https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json"