-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (38 loc) · 1.35 KB
/
Makefile
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
prefix=''
filelist := $$(cat MANIFEST)
install: install_bin install_cron install_etc
install_cron:
install -o root -g adm -m 0640 cron/borgbackup $(prefix)/etc/cron.d
install_etc:
test -d $(prefix)/etc/logrotate.d || mkdir -p $(prefix)/etc/logrotate.d
test -d $(prefix)/etc/borg || mkdir -p $(prefix)/etc/borg
install -o root -g adm -m 0640 etc/logrotate.d/borgbackup $(prefix)/etc/logrotate.d
install -o root -g adm -m 0640 etc/patterns $(prefix)/etc/borg
install -o root -g adm -m 0640 etc/version $(prefix)/etc/borg
mkdir --parents --mode=700 /var/log/backup
install_bin:
test -d $(prefix)/root/bin || mkdir -p $(prefix)/root/bin
for file in $(filelist); do \
install -o root -g adm -m 0750 $$file $(prefix)/root/bin ; \
done
uninstall: uninstall_cron uninstall_bin uninstall_etc
uninstall_bin:
for file in $(filelist); do \
rm -f $(prefix)/root/$$file ; \
done
uninstall_etc:
-rm -f $(prefix)/etc/logrotate.d/borgbackup
-rm -rf $(prefix)/etc/borg
uninstall_cron:
-rm -f $(prefix)/etc/cron.d/borgbackup
reinstall: uninstall install
.PHONY: install uninstall reinstall install_cron install_bin install_etc uninstall_etc gitrevchk
gitrevchk:
cd /root/bin
for file in $(filelist); do \
cp /root/$$file bin ;\
done
cp /etc/logrotate.d/borgbackup etc/logrotate.d
cp /etc/borg/patterns etc
cp /etc/borg/version etc
cp /etc/cron.d/borgbackup cron