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