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