Debian Codegraph @

samples/Makefile

raw
1 #
2 -include ../Makefile.conf
3 include ../Makefile.rules
4
5 SAMPLES = auto.master auto.misc auto.net auto.smb
6
7 all: rc.autofs autofs.conf.default autofs.init.conf autofs.service
8
9 rc.autofs: rc.autofs.in
10 sed -e "s|@@sbindir@@|$(sbindir)|g" \
11 -e "s|@@autofslibdir@@|$(autofslibdir)|g" \
12 -e "s|@@autofsconfdir@@|$(autofsconfdir)|g" \
13 -e "s|@@initdir@@|$(initdir)|g" < rc.autofs.in > rc.autofs
14
15 autofs.conf.default: autofs.conf.default.in
16 sed -e "s|@@autofsmapdir@@|$(autofsmapdir)|g" \
17 < autofs.conf.default.in > autofs.conf.default
18
19 autofs.service: autofs.service.in
20 sed -e "s|@@sbindir@@|$(sbindir)|g" \
21 -e "s|@@autofsconfdir@@|$(autofsconfdir)|g" \
22 -e "s|@@autofspiddir@@|$(autofspiddir)|g" \
23 < autofs.service.in > autofs.service
24
25 .PHONY: dirs
26 dirs:
27 install -d -m 755 $(INSTALLROOT)$(autofsmapdir)
28 install -d -m 755 $(INSTALLROOT)$(autofsconfdir)
29 install -d -m 755 $(INSTALLROOT)$(autofslibdir)
30 install -d -m 755 $(INSTALLROOT)$(autofspiddir)
31
32 .PHONY: autofs.init
33 autofs.init:
34 @echo
35 ifneq ($(systemddir),)
36 install -d -m 755 $(INSTALLROOT)$(systemddir)
37 install autofs.service -m 644 $(INSTALLROOT)$(systemddir)/autofs.service
38 else
39 ifneq ($(initdir),)
40 install -d -m 755 $(INSTALLROOT)$(initdir)
41 install rc.autofs -m 755 $(INSTALLROOT)$(initdir)/autofs
42 else
43 if test -d $(INSTALLROOT)/etc/rc.d ; then \
44 install -c rc.autofs -m 755 $(INSTALLROOT)/etc/rc.d ; \
45 fi
46 endif
47 endif
48
49 #
50 # The map directory contains the main autofs configuration ...
51 #
52 CONFIG = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/autofs.conf.orig || echo "-b --suffix=.orig")
53 CEXISTS = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/autofs || echo "no")
54
55 .PHONY: autofs.conf
56 autofs.conf: autofs.conf.default | dirs
57 @echo
58 @echo "Installing autofs default configuation in $(autofsmapdir)"
59 @if test -z "$(CONFIG)" ; \
60 then \
61 install -v autofs.conf.default -m 644 \
62 $(INSTALLROOT)$(autofsmapdir)/autofs.conf.new ; \
63 echo "Found existing backup of configuration file." ; \
64 echo "Installed package default configuration file as \"autofs.conf.new\"." ; \
65 else \
66 install -v autofs.conf.default -m 644 $(CONFIG) \
67 $(INSTALLROOT)$(autofsmapdir)/autofs.conf ; \
68 echo "Installed package default configuration as \"autofs.conf\"." ; \
69 if test -z "$(CEXISTS)" ; \
70 then \
71 echo "Backup of existing configuration made to \"autofs.conf.orig\"." ; \
72 fi ; \
73 fi
74
75 CINIT = $(shell test -e $(INSTALLROOT)$(autofsconfdir)/autofs.orig || echo "-b --suffix=.orig")
76 CIEXISTS = $(shell test -e $(INSTALLROOT)$(autofsconfdir)/autofs || echo "no")
77
78 .PHONY: autofs.sysinit
79 autofs.sysinit: autofs.init.conf | dirs
80 @echo
81 @echo "Installing autofs init configuation in $(autofsconfdir)"
82 @if test -z "$(CINIT)" ; \
83 then \
84 install -v autofs.init.conf -m 644 \
85 $(INSTALLROOT)$(autofsconfdir)/autofs.new ; \
86 echo "Found existing backup of init configuration file." ; \
87 echo "Installed package init configuration file as \"autofs.new\"." ; \
88 else \
89 install -v autofs.init.conf -m 644 $(CINIT) \
90 $(INSTALLROOT)$(autofsconfdir)/autofs ; \
91 echo "Installed package init configuration as \"autofs\"." ; \
92 if test -z "$(CIEXISTS)" ; \
93 then \
94 echo "Backup of existing init configuration made to \"autofs.orig\"." ; \
95 fi ; \
96 fi
97
98 AUTH = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/autofs_ldap_auth.conf.orig || echo "-b --suffix=.orig")
99 AEXISTS = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/autofs_ldap_auth.conf || echo "no")
100
101 .PHONY: autofs_ldap_auth.conf
102 autofs_ldap_auth.conf: | dirs
103 @echo
104 @echo "Installing autofs ldap auth config \"autofs_ldap_auth.conf\" in $(autofsmapdir)"
105 @if test -z "$(AUTH)" ; \
106 then \
107 install -v autofs_ldap_auth.conf -m 600 \
108 $(INSTALLROOT)$(autofsmapdir)/autofs_ldap_auth.conf.new ; \
109 echo "Found existing backup of auth config \"autofs_ldap_auth.conf\"." ; \
110 echo "Installed package auth config as \"autofs_ldap_auth.conf.new\"." ; \
111 else \
112 install -v autofs_ldap_auth.conf -m 600 $(AUTH) \
113 $(INSTALLROOT)$(autofsmapdir)/autofs_ldap_auth.conf ; \
114 echo "Installed package auth config as \"autofs_ldap_auth.conf\"." ; \
115 if test -z "$(SEXISTS)" ; \
116 then \
117 echo "Backup of existing auth config made to \".utofs_ldap_auth.conf.orig\"." ; \
118 fi ; \
119 fi
120
121 MASTER = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/auto.master.orig || echo "-b --suffix=.orig")
122 MEXISTS = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/auto.master || echo "no")
123
124 .PHONY: auto.master
125 auto.master: | dirs
126 @echo
127 @echo "Installing autofs default master map in $(autofsmapdir)"
128 @if test -z "$(MASTER)" ; \
129 then \
130 install -v auto.master -m 644 \
131 $(INSTALLROOT)$(autofsmapdir)/auto.master.new ; \
132 echo "Found existing backup of master map." ; \
133 echo "Installed package default master map as \"auto.master.new\"." ; \
134 else \
135 install -v auto.master -m 644 $(MASTER) \
136 $(INSTALLROOT)$(autofsmapdir)/auto.master ; \
137 echo "Installed package master map as \"auto.master\"." ; \
138 if test -z "$(MEXISTS)" ; \
139 then \
140 echo "Backup of existing map made to \"auto.master.orig\"." ; \
141 fi ; \
142 fi
143
144 MISC = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/auto.misc.orig || echo "-b --suffix=.orig")
145 IEXISTS = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/auto.misc || echo "no")
146
147 .PHONY: auto.misc
148 auto.misc: | dirs
149 @echo
150 @echo "Installing autofs sample map \"auto.misc\" in $(autofsmapdir)"
151 @if test -z "$(MISC)" ; \
152 then \
153 install -v auto.misc -m 644 \
154 $(INSTALLROOT)$(autofsmapdir)/auto.misc.new ; \
155 echo "Found existing backup of sample map \"auto.misc\"." ; \
156 echo "Installed package sample as \"auto.misc.new\"." ; \
157 else \
158 install -v auto.misc -m 644 $(MISC) \
159 $(INSTALLROOT)$(autofsmapdir)/auto.misc ; \
160 echo "Installed package sample map as \"auto.misc\"." ; \
161 if test -z "$(MEXISTS)" ; \
162 then \
163 echo "Backup of existing map made to \"auto.misc.orig\"." ; \
164 fi ; \
165 fi
166
167 NET = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/auto.net.orig || echo "-b --suffix=.orig")
168 NEXISTS = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/auto.net || echo "no")
169
170 .PHONY: auto.net
171 auto.net: | dirs
172 @echo
173 @echo "Installing autofs sample map \"auto.net\" in $(autofsmapdir)"
174 @if test -z "$(NET)" ; \
175 then \
176 install -v auto.net -m 755 \
177 $(INSTALLROOT)$(autofsmapdir)/auto.net.new ; \
178 echo "Found existing backup of sample map \"auto.net\"." ; \
179 echo "Installed package sample as \"auto.net.new\"." ; \
180 else \
181 install -v auto.net -m 755 $(NET) \
182 $(INSTALLROOT)$(autofsmapdir)/auto.net ; \
183 echo "Installed package sample map as \"auto.net\"." ; \
184 if test -z "$(NEXISTS)" ; \
185 then \
186 echo "Backup of existing map made to \"auto.net.orig\"." ; \
187 fi ; \
188 fi
189
190 SMB = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/auto.smb.orig || echo "-b --suffix=.orig")
191 SEXISTS = $(shell test -e $(INSTALLROOT)$(autofsmapdir)/auto.smb || echo "no")
192
193 .PHONY: auto.smb
194 auto.smb: | dirs
195 @echo
196 @echo "Installing autofs sample map \"auto.smb\" in $(autofsmapdir)"
197 @if test -z "$(SMB)" ; \
198 then \
199 install -v auto.smb -m 755 \
200 $(INSTALLROOT)$(autofsmapdir)/auto.smb.new ; \
201 echo "Found existing backup of sample map \"auto.smb\"." ; \
202 echo "Installed package sample as \"auto.smb.new\"." ; \
203 else \
204 install -v auto.smb -m 755 $(SMB) \
205 $(INSTALLROOT)$(autofsmapdir)/auto.smb ; \
206 echo "Installed package sample map as \"auto.smb\"." ; \
207 if test -z "$(SEXISTS)" ; \
208 then \
209 echo "Backup of existing map made to \"auto.smb.orig\"." ; \
210 fi ; \
211 fi
212
213 install: rc.autofs autofs.conf.default dirs autofs.init autofs.service \
214 autofs.conf autofs.sysinit autofs_ldap_auth.conf $(SAMPLES)
215 @echo
216
217 clean:
218 rm -f *.o *.s rc.autofs autofs.conf.default autofs.service
219