forked from graysky2/profile-sync-daemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.archlinux
56 lines (46 loc) · 1.91 KB
/
Makefile.archlinux
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
VERSION = 5.34
PN = profile-sync-daemon
PREFIX ?= /usr
CONFDIR = /etc
CRONDIR = /etc/cron.hourly
INITDIR = /usr/lib/systemd/system
BINDIR = $(PREFIX)/bin
DOCDIR = $(PREFIX)/share/doc/$(PN)-$(VERSION)
MANDIR = $(PREFIX)/share/man/man1
RM = rm
Q = @
all:
$(Q)echo -e '\033[1;32mSetting version\033[0m'
$(Q)sed -i -e 's/@VERSION@/'$(VERSION)'/' common/$(PN)
install-bin:
$(Q)echo -e '\033[1;32mInstalling main script, initd and config...\033[0m'
install -Dm644 common/psd.conf "$(DESTDIR)$(CONFDIR)/psd.conf"
install -Dm644 init/psd.service "$(DESTDIR)$(INITDIR)/psd.service"
install -Dm644 init/psd-resync.service "$(DESTDIR)$(INITDIR)/psd-resync.service"
install -Dm644 init/psd-resync.timer "$(DESTDIR)$(INITDIR)/psd-resync.timer"
install -Dm755 common/$(PN) "$(DESTDIR)$(BINDIR)/$(PN)"
ln -s $(PN) "$(DESTDIR)$(BINDIR)/psd"
install-man:
$(Q)echo -e '\033[1;32mInstalling manpage...\033[0m'
install -Dm644 doc/psd.1 "$(DESTDIR)$(MANDIR)/psd.1"
gzip -9 "$(DESTDIR)$(MANDIR)/psd.1"
ln -s psd.1.gz "$(DESTDIR)$(MANDIR)/$(PN).1.gz"
install-cron:
$(Q)echo -e '\033[1;32mInstalling cronjob...\033[0m'
install -Dm755 common/psd.cron.hourly "$(DESTDIR)$(CRONDIR)/psd-update"
install: install-bin install-man
install-with-cron: install
$(Q)echo -e '\033[1;32mInstalling cronjob...\033[0m'
install -Dm755 common/psd.cron.hourly "$(DESTDIR)$(CRONDIR)/psd-update"
uninstall:
$(Q)$(RM) "$(DESTDIR)$(INITDIR)/psd.service"
$(Q)$(RM) "$(DESTDIR)$(INITDIR)/psd-resync.service"
$(Q)$(RM) "$(DESTDIR)$(INITDIR)/psd-resync.timer"
$(Q)$(RM) "$(DESTDIR)$(BINDIR)/$(PN)"
$(Q)$(RM) "$(DESTDIR)$(BINDIR)/psd"
$(Q)$(RM) "$(DESTDIR)$(MANDIR)/$(PN).1.gz"
$(Q)$(RM) "$(DESTDIR)$(MANDIR)/psd.1.gz"
$(Q)if [ -f "$(DESTDIR)$(CRONDIR)/psd-update" ]; then $(RM) "$(DESTDIR)$(CRONDIR)/psd-update"; fi
$(Q)echo -e '\033[1;33mIf you want to remove your config as well, run: "make uninstall-conf"\033[0m'
uninstall-conf:
$(RM) "$(DESTDIR)$(CONFDIR)/psd.conf"