]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - etc/Makefile
MFstable/10 r294770:
[FreeBSD/stable/9.git] / etc / Makefile
1 #       from: @(#)Makefile      5.11 (Berkeley) 5/21/91
2 # $FreeBSD$
3
4 .include <bsd.own.mk>
5
6 SUBDIR= \
7         newsyslog.conf.d
8
9 .if ${MK_SENDMAIL} != "no"
10 SUBDIR+=sendmail
11 .endif
12
13 BIN1=   crontab \
14         devd.conf \
15         devfs.conf \
16         ddb.conf \
17         dhclient.conf \
18         disktab \
19         fbtab \
20         gettytab \
21         group \
22         hosts \
23         hosts.allow \
24         hosts.equiv \
25         libalias.conf \
26         libmap.conf \
27         login.access \
28         login.conf \
29         mac.conf \
30         motd \
31         netconfig \
32         network.subr \
33         networks \
34         newsyslog.conf \
35         nsswitch.conf \
36         phones \
37         profile \
38         protocols \
39         rc \
40         rc.bsdextended \
41         rc.firewall \
42         rc.initdiskless \
43         rc.shutdown \
44         rc.subr \
45         remote \
46         rpc \
47         services \
48         shells \
49         sysctl.conf \
50         syslog.conf \
51         termcap.small \
52
53 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
54 BIN1+=  libmap32.conf
55 .endif
56
57 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
58 BIN1+=  etc.${MACHINE}/ttys
59 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
60 BIN1+=  etc.${MACHINE_ARCH}/ttys
61 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
62 BIN1+=  etc.${MACHINE_CPUARCH}/ttys
63 .else
64 .error etc.MACHINE/ttys missing
65 .endif
66
67 OPENBSMDIR=                     ${.CURDIR}/../contrib/openbsm
68 BSM_ETC_OPEN_FILES=             ${OPENBSMDIR}/etc/audit_class \
69                                 ${OPENBSMDIR}/etc/audit_event
70 BSM_ETC_RESTRICTED_FILES=       ${OPENBSMDIR}/etc/audit_control \
71                                 ${OPENBSMDIR}/etc/audit_user
72 BSM_ETC_EXEC_FILES=             ${OPENBSMDIR}/etc/audit_warn
73 BSM_ETC_DIR=                    ${DESTDIR}/etc/security
74
75 # NB: keep these sorted by MK_* knobs
76
77 .if ${MK_AMD} != "no"
78 BIN1+= amd.map
79 .endif
80
81 .if ${MK_APM} != "no"
82 BIN1+= apmd.conf
83 .endif
84
85 .if ${MK_FREEBSD_UPDATE} != "no"
86 BIN1+= freebsd-update.conf
87 .endif
88
89 .if ${MK_FTP} != "no"
90 BIN1+= ftpusers
91 .endif
92
93 .if ${MK_INETD} != "no"
94 BIN1+= inetd.conf
95 .endif
96
97 .if ${MK_LOCATE} != "no"
98 BIN1+=  ${.CURDIR}/../usr.bin/locate/locate/locate.rc
99 .endif
100
101 .if ${MK_LPR} != "no"
102 BIN1+=  hosts.lpd printcap
103 .endif
104
105 .if ${MK_MAIL} != "no"
106 BIN1+=  ${.CURDIR}/../usr.bin/mail/misc/mail.rc
107 .endif
108
109 .if ${MK_NTP} != "no"
110 BIN1+=  ntp.conf
111 .endif
112
113 .if ${MK_OPENSSH} != "no"
114 SSH=    ${.CURDIR}/../crypto/openssh/ssh_config \
115         ${.CURDIR}/../crypto/openssh/sshd_config \
116         ${.CURDIR}/../crypto/openssh/moduli
117 .endif
118 .if ${MK_OPENSSL} != "no"
119 SSL=    ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
120 .endif
121
122 .if ${MK_NS_CACHING} != "no"
123 BIN1+= nscd.conf
124 .endif
125
126 .if ${MK_PORTSNAP} != "no"
127 BIN1+= portsnap.conf
128 .endif
129
130 .if ${MK_PF} != "no"
131 BIN1+= pf.os
132 .endif
133
134 .if ${MK_SENDMAIL} != "no"
135 BIN1+=  rc.sendmail
136 .endif
137
138 .if ${MK_TCSH} != "no"
139 BIN1+= csh.cshrc csh.login csh.logout
140 .endif
141
142 .if ${MK_WIRELESS} != "no"
143 BIN1+= regdomain.xml
144 .endif
145
146 # -rwxr-xr-x root:wheel, for the new cron root:wheel
147 BIN2=   netstart pccard_ether rc.suspend rc.resume
148
149 MTREE=  BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
150 .if ${MK_SENDMAIL} != "no"
151 MTREE+= BSD.sendmail.dist
152 .endif
153 .if ${MK_BIND} != "no"
154 MTREE+= BIND.chroot.dist
155 .if ${MK_BIND_LIBS} != "no"
156 MTREE+= BIND.include.dist
157 .endif
158 .endif
159 .if ${MK_DEBUG_FILES} != "no"
160 MTREE+= BSD.debug.dist
161 .endif
162
163 PPPCNF= ppp.conf
164
165 .if ${MK_SENDMAIL} == "no"
166 ETCMAIL=mailer.conf aliases
167 .else
168 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
169         mailertable.sample aliases
170 .endif
171
172 # Special top level files for FreeBSD
173 FREEBSD=COPYRIGHT
174
175 # Sanitize DESTDIR
176 DESTDIR:=       ${DESTDIR:C://*:/:g}
177
178 afterinstall:
179 .if ${MK_MAN} != "no"
180         ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
181 .endif
182
183 distribute:
184         ${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
185         ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
186
187 .include <bsd.endian.mk>
188 .if ${TARGET_ENDIANNESS} == "1234"
189 CAP_MKDB_ENDIAN?= -l
190 PWD_MKDB_ENDIAN?= -L
191 .elif ${TARGET_ENDIANNESS} == "4321"
192 CAP_MKDB_ENDIAN?= -b
193 PWD_MKDB_ENDIAN?= -B
194 .else
195 CAP_MKDB_ENDIAN?=
196 PWD_MKDB_ENDIAN?=
197 .endif
198
199 .if defined(NO_ROOT)
200 METALOG.add?=   cat -l >> ${METALOG}
201 .endif
202
203 distribution:
204 .if !defined(DESTDIR)
205         @echo "set DESTDIR before running \"make ${.TARGET}\""
206         @false
207 .endif
208         cd ${.CURDIR}; \
209             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
210                 ${BIN1} ${DESTDIR}/etc; \
211             cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
212             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
213                 ${BIN2} ${DESTDIR}/etc; \
214             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
215                 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
216 .if ${MK_BSNMP} != "no"
217         cd ${.CURDIR}; \
218             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
219                 snmpd.config ${DESTDIR}/etc;
220 .endif
221 .if ${MK_AT} == "no"
222         sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
223 .endif
224 .if ${MK_TCSH} == "no"
225         sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
226 .endif
227         pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
228             ${DESTDIR}/etc/master.passwd
229 .if defined(NO_ROOT)
230         ( \
231                 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
232                 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
233                 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
234                 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
235         ) | ${METALOG.add}
236 .endif
237 .if ${MK_BLUETOOTH} != "no"
238         ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
239 .endif
240         ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
241         ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
242         ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
243         ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
244 .if ${MK_PKGBOOTSTRAP} != "no"
245         ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
246 .endif
247         ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
248         ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
249         ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
250         ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
251         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
252             ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
253         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
254             ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
255         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
256             ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
257 .if ${MK_BIND_MTREE} != "no"
258         if [ ! -e ${DESTDIR}/etc/namedb ]; then \
259                 ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
260         fi
261 .endif
262 .if ${MK_BIND_ETC} != "no"
263         ${_+_}cd ${.CURDIR}/namedb; ${MAKE} install
264 .endif
265 .if ${MK_SENDMAIL} != "no"
266         ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
267 .endif
268 .if ${MK_OPENSSH} != "no"
269         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
270             ${SSH} ${DESTDIR}/etc/ssh
271 .endif
272 .if ${MK_OPENSSL} != "no"
273         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
274             ${SSL} ${DESTDIR}/etc/ssl
275 .endif
276 .if ${MK_KERBEROS} != "no"
277         cd ${.CURDIR}/root; \
278             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
279                 dot.k5login ${DESTDIR}/root/.k5login;
280 .endif
281         cd ${.CURDIR}/root; \
282             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
283                 dot.profile ${DESTDIR}/root/.profile; \
284             rm -f ${DESTDIR}/.profile; \
285             ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
286 .if ${MK_TCSH} != "no"
287         cd ${.CURDIR}/root; \
288             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
289                 dot.cshrc ${DESTDIR}/root/.cshrc; \
290             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
291                 dot.login ${DESTDIR}/root/.login; \
292             rm -f ${DESTDIR}/.cshrc; \
293             ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
294 .endif
295         cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
296             ${MTREE} ${DESTDIR}/etc/mtree
297 .if ${MK_PPP} != "no"
298         cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
299             ${PPPCNF} ${DESTDIR}/etc/ppp
300 .endif
301 .if ${MK_MAIL} != "no"
302         cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
303             ${ETCMAIL} ${DESTDIR}/etc/mail
304         if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
305               ! -f ${DESTDIR}/etc/aliases ]; then \
306                 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
307         fi
308 .endif
309         ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
310             ${DESTDIR}/etc/dumpdates
311 .if ${MK_LOCATE} != "no"
312         ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
313             ${DESTDIR}/var/db/locate.database
314 .endif
315         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
316             ${DESTDIR}/var/crash
317         cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
318                 ${FREEBSD} ${DESTDIR}/
319 .if ${MK_BOOT} != "no"
320 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
321         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
322             ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
323             ${DESTDIR}/boot/device.hints
324 .endif
325 .endif
326 .if ${MK_NIS} == "no"
327         sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
328                 ${DESTDIR}/etc/nsswitch.conf
329 .endif
330
331 MTREE_CMD?=     mtree
332
333 MTREES=         mtree/BSD.root.dist             /               \
334                 mtree/BSD.var.dist              /var            \
335                 mtree/BSD.usr.dist              /usr            \
336                 mtree/BSD.include.dist          /usr/include
337 .if ${MK_DEBUG_FILES} != "no"
338 MTREES+=        mtree/BSD.debug.dist            /usr/lib
339 .endif
340 .if ${MK_BIND_LIBS} != "no"
341 MTREES+=        mtree/BIND.include.dist         /usr/include
342 .endif
343 .if ${MK_BIND_MTREE} != "no"
344 MTREES+=        mtree/BIND.chroot.dist          /var/named
345 .endif
346 .if ${MK_GROFF} != "no"
347 MTREES+=        mtree/BSD.groff.dist            /usr
348 .endif
349 .if ${MK_SENDMAIL} != "no"
350 MTREES+=        mtree/BSD.sendmail.dist         /
351 .endif
352 .for mtree in ${LOCAL_MTREE}
353 MTREES+=        ../${mtree}                     /
354 .endfor
355
356 distrib-dirs: ${MTREES:N/*}
357         @set ${MTREES}; \
358         while test $$# -ge 2; do \
359                 m=${.CURDIR}/$$1; \
360                 shift; \
361                 d=${DESTDIR}$$1; \
362                 shift; \
363                 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
364                     -f $$m -p $$d; \
365                 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
366         done; true
367 .if defined(NO_ROOT)
368         @set ${MTREES}; \
369         while test $$# -ge 2; do \
370                 m=${.CURDIR}/$$1; \
371                 shift; \
372                 d=$$1; \
373                 test "$$d" == "/" && d=""; \
374                 d=${DISTBASE}$$d; \
375                 shift; \
376                 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
377                     "sed s#^\.#.$$d# | ${METALOG.add}" ; \
378                 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
379                     ${METALOG.add} ; \
380         done; true
381 .endif
382         ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
383 .if ${MK_MAN} != "no"
384         cd ${DESTDIR}/usr/share/man; \
385         for mandir in man*; do \
386                 ${INSTALL_SYMLINK} ../$$mandir \
387                     ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
388                 ${INSTALL_SYMLINK} ../$$mandir \
389                     ${DESTDIR}/usr/share/man/en.UTF-8/; \
390         done
391 .if ${MK_OPENSSL} != "no"
392         cd ${DESTDIR}/usr/share/openssl/man; \
393         for mandir in man*; do \
394                 ${INSTALL_SYMLINK} ../$$mandir \
395                     ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
396         done
397 .endif
398         set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
399         while [ $$# -gt 0 ] ; do \
400                 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
401                 if [ "${MK_OPENSSL}" != "no" ]; then \
402                         ${INSTALL_SYMLINK} "$$2" \
403                             "${DESTDIR}/usr/share/openssl/man/$$1"; \
404                 fi; \
405                 shift; shift; \
406         done
407 .endif
408 .if ${MK_NLS} != "no"
409         set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
410         while [ $$# -gt 0 ] ; do \
411                 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
412                 shift; shift; \
413         done
414 .endif
415
416 etc-examples:
417         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
418             ${BIN1} ${BIN2} nsmb.conf opieaccess \
419             ${DESTDIR}/usr/share/examples/etc
420         ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
421             DESTDIR=${DESTDIR}/usr/share/examples
422
423 .include <bsd.prog.mk>