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