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