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