|
1 | 1 | PREFIX := /usr/local
|
2 |
| -SYSTEMD_HOME := /lib/systemd/system |
| 2 | +SYSTEMD_HOME := $(PREFIX)/lib/systemd/system |
| 3 | + |
3 | 4 | all:
|
| 5 | +.PHONY: all |
4 | 6 |
|
5 | 7 | install:
|
6 |
| - install -d $(DESTDIR)/etc/cron.d |
7 |
| - install -d $(DESTDIR)/etc/cron.daily |
8 |
| - install -d $(DESTDIR)/etc/cron.hourly |
9 |
| - install -d $(DESTDIR)/etc/cron.weekly |
10 |
| - install -d $(DESTDIR)/etc/cron.monthly |
11 |
| - install -m 0644 etc/zfs-auto-snapshot.cron.frequent $(DESTDIR)/etc/cron.d/zfs-auto-snapshot |
12 |
| - install etc/zfs-auto-snapshot.cron.hourly $(DESTDIR)/etc/cron.hourly/zfs-auto-snapshot |
13 |
| - install etc/zfs-auto-snapshot.cron.daily $(DESTDIR)/etc/cron.daily/zfs-auto-snapshot |
14 |
| - install etc/zfs-auto-snapshot.cron.weekly $(DESTDIR)/etc/cron.weekly/zfs-auto-snapshot |
15 |
| - install etc/zfs-auto-snapshot.cron.monthly $(DESTDIR)/etc/cron.monthly/zfs-auto-snapshot |
16 |
| - install -d $(DESTDIR)$(PREFIX)/share/man/man8 |
17 |
| - install src/zfs-auto-snapshot.8 $(DESTDIR)$(PREFIX)/share/man/man8/zfs-auto-snapshot.8 |
18 |
| - install -d $(DESTDIR)$(PREFIX)/sbin |
19 |
| - install src/zfs-auto-snapshot.sh $(DESTDIR)$(PREFIX)/sbin/zfs-auto-snapshot |
| 8 | + install -d $(DESTDIR)$(PREFIX)/sbin $(DESTDIR)$(PREFIX)/share/man/man8 |
| 9 | + install -m 0755 src/zfs-auto-snapshot.sh $(DESTDIR)$(PREFIX)/sbin/zfs-auto-snapshot |
| 10 | + install -m 0422 -t $(DESTDIR)$(PREFIX)/share/man/man8 src/zfs-auto-snapshot.8 |
| 11 | + install -m 0422 -t $(DESTDIR)$(SYSTEMD_HOME) \ |
| 12 | + timers/zfs-auto-snapshot-daily.service \ |
| 13 | + timers/zfs-auto-snapshot-daily.timer \ |
| 14 | + timers/zfs-auto-snapshot-frequent.service \ |
| 15 | + timers/zfs-auto-snapshot-frequent.timer \ |
| 16 | + timers/zfs-auto-snapshot-hourly.service \ |
| 17 | + timers/zfs-auto-snapshot-hourly.timer \ |
| 18 | + timers/zfs-auto-snapshot-monthly.service \ |
| 19 | + timers/zfs-auto-snapshot-monthly.timer \ |
| 20 | + timers/zfs-auto-snapshot-weekly.service \ |
| 21 | + timers/zfs-auto-snapshot-weekly.timer \ |
| 22 | + timers/zfs-auto-snapshot.target |
| 23 | +.PHONY: install |
20 | 24 |
|
21 |
| -systemd: |
22 |
| - install -d $(DESTDIR)$(PREFIX)$(SYSTEMD_HOME) |
23 |
| - install timers/zfs-auto-snapshot-frequent.service $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-frequent.service |
24 |
| - install timers/zfs-auto-snapshot-frequent.timer $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-frequent.timer |
25 |
| - install timers/zfs-auto-snapshot-hourly.service $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-hourly.service |
26 |
| - install timers/zfs-auto-snapshot-hourly.timer $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-hourly.timer |
27 |
| - install timers/zfs-auto-snapshot-daily.service $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-daily.service |
28 |
| - install timers/zfs-auto-snapshot-daily.timer $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-daily.timer |
29 |
| - install timers/zfs-auto-snapshot-weekly.service $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-weekly.service |
30 |
| - install timers/zfs-auto-snapshot-weekly.timer $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-weekly.timer |
31 |
| - install timers/zfs-auto-snapshot-monthly.service $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-monthly.service |
32 |
| - install timers/zfs-auto-snapshot-monthly.timer $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-monthly.timer |
33 |
| - install timers/zfs-auto-snapshot.target $(DESTDIR)$(PREFIX)$(SYSTEMD_HOME)/zfs-auto-snapshot.target |
34 |
| - install -d $(DESTDIR)$(PREFIX)/share/man/man8 |
35 |
| - install src/zfs-auto-snapshot.8 $(DESTDIR)$(PREFIX)/share/man/man8/zfs-auto-snapshot.8 |
36 |
| - install -d $(DESTDIR)$(PREFIX)/sbin |
37 |
| - install src/zfs-auto-snapshot.sh $(DESTDIR)$(PREFIX)/sbin/zfs-auto-snapshot |
38 |
| - systemctl enable zfs-auto-snapshot.target |
39 |
| - systemctl daemon-reload |
40 |
| - systemctl start zfs-auto-snapshot.target |
| 25 | +enable: |
| 26 | + systemctl enable --now zfs-auto-snapshot.target |
| 27 | +.PHONY: enable |
0 commit comments