]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/openbsd/Makefile.in
Backport copyright changes
[bacula/bacula] / bacula / platforms / openbsd / Makefile.in
1 #
2 # Copyright (C) Kern Sibbald 2001-2015
3 # License: BSD 2-Clause
4
5 # This file is used as the template to create the
6 # Makefile for the Solaris specific installation.
7 #
8 #  15 November 2001 -- Kern Sibbald
9 #
10 #  for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
11 #
12
13 VPATH = @srcdir@
14 INSTALL = @INSTALL@
15 INSTALL_PROGRAM = @INSTALL_PROGRAM@
16 SED = /usr/bin/sed
17
18 nothing:
19
20 install: install-autostart
21
22 install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir
23
24         
25 install-autostart-fd:
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"; \
32         else \
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"; \
39             ) >> /etc/rc.local; \
40             echo ""; \
41         fi
42
43
44 install-autostart-sd:
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"; \
51         else \
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"; \
58             ) >> /etc/rc.local; \
59             echo ""; \
60         fi
61
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"; \
69         else \
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"; \
76             ) >> /etc/rc.local; \
77             echo ""; \
78         fi
79
80
81 uninstall: uninstall-autostart
82
83 uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir
84
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"; \
93                     rm -f $$f.$$today; \
94                     cp -p $$f $$f.$$today; \
95                     $(SED) -e '/TAG_BACULA_FD/d;' \
96                             < $$f.$$today > $$f; \
97                     chmod 644 $$f; \
98             fi; \
99         done
100
101
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"; \
110                     rm -f $$f.$$today; \
111                     cp -p $$f $$f.$$today; \
112                     $(SED) -e '/TAG_BACULA_SD/d;' \
113                             < $$f.$$today > $$f; \
114                     chmod 644 $$f; \
115             fi; \
116         done
117
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"; \
126                     rm -f $$f.$$today; \
127                     cp -p $$f $$f.$$today; \
128                     $(SED) -e '/TAG_BACULA_DIR/d;' \
129                             < $$f.$$today > $$f; \
130                     chmod 644 $$f; \
131             fi; \
132         done
133
134 clean:
135         @rm -f 1 2 3
136
137 distclean: clean
138         @rm -f bacula-sd bacula-fd bacula-dir
139         @rm -f Makefile bacula-*.spec
140
141 devclean: clean
142         @rm -f bacula-sd bacula-fd bacula-dir
143         @rm -f Makefile bacula-*.spec