commit b0f10b5
delthas
·
2023-07-26 12:04:08 +0000 UTC
parent 4565542
Add .desktop entry And install it in make install ;-)
2 files changed,
+26,
-2
M
Makefile
+13,
-2
1@@ -8,15 +8,23 @@ GOFLAGS ?=
2 PREFIX ?= /usr/local
3 BINDIR ?= bin
4 MANDIR ?= share/man
5+APPDIR ?= share/applications
6
7-all: senpai doc/senpai.1 doc/senpai.5
8+all: senpai doc
9
10 senpai:
11 $(GO) build $(GOFLAGS) ./cmd/senpai
12+
13+ifeq (, $(shell which $(SCDOC) 2>/dev/null))
14+$(warning "$(SCDOC) not found, skipping building documentation")
15+doc:
16+else
17+doc: doc/senpai.1 doc/senpai.5
18 doc/senpai.1: doc/senpai.1.scd
19 $(SCDOC) < doc/senpai.1.scd > doc/senpai.1
20 doc/senpai.5: doc/senpai.5.scd
21 $(SCDOC) < doc/senpai.5.scd > doc/senpai.5
22+endif
23
24 clean:
25 $(RM) -rf senpai doc/senpai.1 doc/senpai.5
26@@ -24,12 +32,15 @@ install:
27 mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR)
28 mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
29 mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man5
30+ mkdir -p $(DESTDIR)$(PREFIX)/$(APPDIR)
31 cp -f senpai $(DESTDIR)$(PREFIX)/$(BINDIR)
32 cp -f doc/senpai.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
33 cp -f doc/senpai.5 $(DESTDIR)$(PREFIX)/$(MANDIR)/man5
34+ cp -f contrib/senpai.desktop $(DESTDIR)$(PREFIX)/$(APPDIR)/senpai.desktop
35 uninstall:
36 $(RM) $(DESTDIR)$(PREFIX)/$(BINDIR)/senpai
37 $(RM) $(DESTDIR)$(PREFIX)/$(MANDIR)/man1/senpai.1
38 $(RM) $(DESTDIR)$(PREFIX)/$(MANDIR)/man5/senpai.5
39+ $(RM) $(DESTDIR)$(PREFIX)/$(APPDIR)/senpai.desktop
40
41-.PHONY: all senpai clean install uninstall
42+.PHONY: all senpai doc clean install uninstall
+13,
-0
1@@ -0,0 +1,13 @@
2+[Desktop Entry]
3+Version=1.0
4+Name=senpai
5+
6+GenericName=IRC Client
7+Comment=Chat on IRC with senpai
8+Keywords=Chat;IRC;IM;Messaging
9+Categories=Network;InstantMessaging;Chat;IRCClient;ConsoleOnly
10+
11+Type=Application
12+Icon=utilities-terminal
13+Terminal=true
14+Exec=senpai