aboutsummaryrefslogtreecommitdiff
path: root/etc/Makefile.am
blob: f7f9e16c38703fb14f3795e93c88c53de180a447 (plain)
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
EXTRA_DIST = backupninja.conf.in cron.d/backupninja.in \
        logrotate.d/backupninja.in

GENERATED_FILES = backupninja.conf cron.d/backupninja logrotate.d/backupninja

CLEANFILES = $(GENERATED_FILES)

nobase_sysconf_DATA = $(GENERATED_FILES)

edit = sed \
    -e "s,@BASH\@,$(BASH),g" \
    -e "s,@CFGDIR\@,$(CFGDIR),g" \
    -e "s,@sysconfdir\@,$(sysconfdir),g" \
    -e "s,@localstatedir\@,$(localstatedir),g" \
    -e "s,@pkgdatadir\@,$(pkgdatadir),g" \
    -e "s,@pkglibdir\@,$(pkglibdir),g" \
    -e "s,@sbindir\@,$(sbindir),g" \
    -e "s,@exec_prefix\@,$(exec_prefix),g" \
    -e "s,@prefix\@,$(prefix),g"

cron.d/backupninja: cron.d/backupninja.in
	rm -f cron.d/backupninja
	$(edit) cron.d/backupninja.in > cron.d/backupninja
	chmod 644 cron.d/backupninja

logrotate.d/backupninja: logrotate.d/backupninja.in
	rm -f logrotate.d/backupninja
	$(edit) logrotate.d/backupninja.in > logrotate.d/backupninja
	chmod ugo+x logrotate.d/backupninja

backupninja.conf: backupninja.conf.in
	rm -f backupninja.conf
	$(edit) backupninja.conf.in > backupninja.conf

install-data-hook:
	mkdir $(DESTDIR)/$(sysconfdir)/backup.d
	chmod 0770 $(DESTDIR)/$(sysconfdir)/backup.d