2 # Copyright (C) 2000-2015 Kern Sibbald
3 # License: BSD 2-Clause; see file LICENSE-FOSS
5 # This file is used as the template to create the
6 # Makefile for the Solaris specific installation.
8 # 15 November 2001 -- Kern Sibbald
10 # for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
15 INSTALL_PROGRAM = @INSTALL_PROGRAM@
20 install: install-autostart
22 install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir
26 @echo "FreeBSD platform installation"
27 $(INSTALL_PROGRAM) -m 744 bacula-fd /etc/rc.bacula-fd
28 @-today="`date +%Y%m%d%H%M`"; \
29 grep -q /etc/rc.bacula-fd /etc/rc.local; \
30 if [ $$? -eq 0 ]; then \
31 echo "/etc/rc.local already patched"; \
33 rm -f /etc/rc.local.$$today; \
34 cp -p /etc/rc.local /etc/rc.local.$$today; \
35 ( echo "Start the Bacula File daemon. Do not remove the 'TAG_BACULA_FD' text"; \
36 echo "if [ -x /etc/rc.bacula-fd ]; then # TAG_BACULA_FD"; \
37 echo " /etc/rc.bacula-fd start # TAG_BACULA_FD"; \
38 echo "fi # TAG_BACULA_FD"; \
45 @echo "FreeBSD platform installation"
46 $(INSTALL_PROGRAM) -m 744 bacula-sd /etc/rc.bacula-sd
47 @-today="`date +%Y%m%d%H%M`"; \
48 grep -q /etc/rc.bacula-sd /etc/rc.local; \
49 if [ $$? -eq 0 ]; then \
50 echo "/etc/rc.local already patched"; \
52 rm -f /etc/rc.local.$$today; \
53 cp -p /etc/rc.local /etc/rc.local.$$today; \
54 ( echo "Start the Bacula Storage daemon. Do not remove the 'TAG_BACULA_SD' text"; \
55 echo "if [ -x /etc/rc.bacula-fd ]; then # TAG_BACULA_SD"; \
56 echo " /etc/rc.bacula-fd start # TAG_BACULA_SD"; \
57 echo "fi # TAG_BACULA_SD"; \
62 install-autostart-dir:
63 @echo "FreeBSD platform installation"
64 $(INSTALL_PROGRAM) -m 744 bacula-dir /etc/rc.bacula-dir
65 @-today="`date +%Y%m%d%H%M`"; \
66 grep -q /etc/rc.bacula-dir /etc/rc.local; \
67 if [ $$? -eq 0 ]; then \
68 echo "/etc/rc.local already patched"; \
70 rm -f /etc/rc.local.$$today; \
71 cp -p /etc/rc.local /etc/rc.local.$$today; \
72 ( echo "Start the Bacula Director. Do not remove the 'TAG_BACULA_DIR' text"; \
73 echo "if [ -x /etc/rc.bacula-dir ]; then # TAG_BACULA_DIR"; \
74 echo " /etc/rc.bacula-dir start # TAG_BACULA_DIR"; \
75 echo "fi # TAG_BACULA_DIR"; \
81 uninstall: uninstall-autostart
83 uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir
85 uninstall-autostart-fd:
86 @echo "FreeBSD platform uninstall"
87 rm -f /etc/rc.bacula-fd
88 @-today="`date +%Y%m%d%H%M`"; \
89 for f in /etc/rc.local ; do \
90 grep -q '# TAG_BACULA_FD' $$f; \
91 if [ $$? -eq 0 ]; then \
92 echo "removing Bacula lines from $$f"; \
94 cp -p $$f $$f.$$today; \
95 $(SED) -e '/TAG_BACULA_FD/d;' \
96 < $$f.$$today > $$f; \
102 uninstall-autostart-sd:
103 @echo "FreeBSD platform uninstall"
104 rm -f /etc/rc.bacula-sd
105 @-today="`date +%Y%m%d%H%M`"; \
106 for f in /etc/rc.local ; do \
107 grep -q '# TAG_BACULA_SD' $$f; \
108 if [ $$? -eq 0 ]; then \
109 echo "removing Bacula lines from $$f"; \
111 cp -p $$f $$f.$$today; \
112 $(SED) -e '/TAG_BACULA_SD/d;' \
113 < $$f.$$today > $$f; \
118 uninstall-autostart-dir:
119 @echo "FreeBSD platform uninstall"
120 rm -f /etc/rc.bacula-dir
121 @-today="`date +%Y%m%d%H%M`"; \
122 for f in /etc/rc.local ; do \
123 grep -q '# TAG_BACULA_DIR' $$f; \
124 if [ $$? -eq 0 ]; then \
125 echo "removing Bacula lines from $$f"; \
127 cp -p $$f $$f.$$today; \
128 $(SED) -e '/TAG_BACULA_DIR/d;' \
129 < $$f.$$today > $$f; \
138 @rm -f bacula-sd bacula-fd bacula-dir
139 @rm -f Makefile bacula-*.spec
142 @rm -f bacula-sd bacula-fd bacula-dir
143 @rm -f Makefile bacula-*.spec