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