]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/systemd/Makefile.in
Retab Makefile.in in platforms/systemd.in
[bacula/bacula] / bacula / platforms / systemd / Makefile.in
1 #
2 # Copyright (C) 2000-2016 Kern Sibbald
3 # License: BSD 2-Clause; see file LICENSE-FOSS
4 #
5 # This file is used as the template to create the
6 # Makefile for the systemd specific installation.
7 #
8 #
9 #  for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
10 #
11
12 INSTALL = @INSTALL@
13 INSTALL_PROGRAM = @INSTALL_PROGRAM@
14 # should be /lib/systemd/system and get be get with
15 # systemctl show | grep UnitPath | cut -d " " -f2
16 SYSTEMD_UNITDIR = @SYSTEMD_UNITDIR@
17 SYSTEMD_TMPFILES = /etc/tmpfiles.d
18
19 nothing:
20
21 install: install-dir install-conf install-autostart
22
23 install-dir:
24         mkdir -p $(DESTDIR)/$(SYSTEMD_UNITDIR) $(DESTDIR)/$(SYSTEMD_TMPFILES)
25
26 install-conf:
27         @$(INSTALL_PROGRAM) -m 644 bacula.conf $(DESTDIR)/$(SYSTEMD_TMPFILES)/bacula.conf
28
29 install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir
30
31 install-service:
32         @$(INSTALL_PROGRAM) -m 644 bacula-fd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)
33         @$(INSTALL_PROGRAM) -m 644 bacula-dir.service $(DESTDIR)/$(SYSTEMD_UNITDIR)
34         @$(INSTALL_PROGRAM) -m 644 bacula-sd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)
35
36 install-autostart-fd:
37         @if test x$(DESTDIR) = x -a  -f $(SYSTEMD_UNITDIR)/bacula-fd.service; then \
38            /bin/systemctl stop bacula-fd.service; \
39            /bin/systemctl disable bacula-fd.service; \
40         fi
41         @$(INSTALL_PROGRAM) -m 644 bacula-fd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-fd.service
42         # set symlinks for script at startup and shutdown
43         @if test x$(DESTDIR) = x ; then \
44            /bin/systemctl enable bacula-fd.service; \
45            /bin/systemctl start bacula-fd.service; \
46         fi
47
48
49 install-autostart-sd:
50         @if test x$(DESTDIR) = x -a  -f $(SYSTEMD_UNITDIR)/bacula-sd.service; then \
51            /bin/systemctl stop bacula-sd.service; \
52            /bin/systemctl disable bacula-sd.service; \
53         fi
54         @$(INSTALL_PROGRAM) -m 644 bacula-sd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-sd.service
55         # set symlinks for script at startup and shutdown
56         @if test x$(DESTDIR) = x ; then \
57            /bin/systemctl enable bacula-sd.service; \
58            /bin/systemctl start bacula-sd.service; \
59         fi
60
61
62 install-autostart-dir:
63         @if test x$(DESTDIR) = x -a  -f $(SYSTEMD_UNITDIR)/bacula-dir.service; then \
64            /bin/systemctl stop bacula-dir.service; \
65            /bin/systemctl disable bacula-dir.service; \
66         fi
67         @$(INSTALL_PROGRAM) -m 644 bacula-dir.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-dir.service
68         # set symlinks for script at startup and shutdown
69         @if test x$(DESTDIR) = x ; then \
70            /bin/systemctl enable bacula-dir.service; \
71            /bin/systemctl start bacula-dir.service; \
72         fi
73
74
75 uninstall: uninstall-autostart uninstall-conf
76
77 uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir
78
79 uninstall-autostart-fd:
80         @if test x$(DESTDIR) = x -a  -f $(SYSTEMD_UNITDIR)/bacula-fd.service; then \
81            /bin/systemctl stop bacula-fd.service; \
82            /bin/systemctl disable bacula-fd.service; \
83         fi
84         @rm -f  $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-fd.service
85
86
87 uninstall-autostart-sd:
88         @if test x$(DESTDIR) = x -a  -f $(SYSTEMD_UNITDIR)/bacula-sd.service; then \
89            /bin/systemctl stop bacula-fd.service; \
90            /bin/systemctl disable bacula-fd.service; \
91         fi
92         @rm -f  $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-sd.service
93
94 uninstall-autostart-dir:
95         @if test x$(DESTDIR) = x -a  -f $(SYSTEMD)/bacula-dir.service; then \
96            /bin/systemctl stop bacula-dir.service; \
97            /bin/systemctl disable bacula-dir.service; \
98         fi
99         @rm -f  $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-dir.service
100
101 uninstall-conf:
102         @rm -f  $(DESTDIR)/$(SYSTEMD_TMPFILES)/bacula.conf
103
104 clean:
105         @rm -f 1 2 3
106
107 distclean: clean
108         @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
109         @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service
110
111 devclean: clean
112         @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
113         @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service