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