2 # This file is used as the template to create the
3 # Makefile for the systemd specific installation.
6 # for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
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@
17 install: install-dir install-autostart
19 install-dir: $(DESTDIR)/$(SYSTEMD_UNITDIR)
20 mkdir -p $(DESTDIR)/$(SYSTEMD_UNITDIR)
22 install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir
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; \
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; \
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; \
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; \
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; \
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; \
64 uninstall: uninstall-autostart
66 uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir
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; \
73 @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-fd.service
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; \
81 @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-sd.service
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; \
88 @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-dir.service
94 @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
95 @rm -f bacula-sd.service bacula-fd.service bacula-dir.service
98 @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
99 @rm -f bacula-sd.service bacula-fd.service bacula-dir.service