Makefile revision 205335
11195Srgrimes#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
250472Speter# $FreeBSD: head/etc/Makefile 205335 2010-03-19 15:53:02Z ed $
337Srgrimes
4156813Sru.include <bsd.own.mk>
5156813Sru
6156813Sru.if ${MK_SENDMAIL} != "no"
738103SpeterSUBDIR=	sendmail
873251Sgshapiro.endif
938103Speter
10183242SsamBIN1=	auth.conf \
11184343Ssam	crontab devd.conf devfs.conf \
12183242Ssam	ddb.conf dhclient.conf disktab fbtab \
13161748Scperciva	ftpusers gettytab group \
14183242Ssam	hosts hosts.allow hosts.equiv \
15162674Spiso	inetd.conf libalias.conf login.access login.conf mac.conf motd \
16158266Sume	netconfig network.subr networks newsyslog.conf nsswitch.conf \
17183242Ssam	phones profile protocols \
18200028Sume	rc rc.bsdextended rc.firewall rc.initdiskless \
19145693Sbrooks	rc.sendmail rc.shutdown \
20183242Ssam	rc.subr remote rpc services shells \
21204820Sed	sysctl.conf syslog.conf termcap.small
22155210Srwatson
23199249Sed.if exists(${.CURDIR}/etc.${MACHINE}/ttys)
24199249SedBIN1+=	etc.${MACHINE}/ttys
25199249Sed.else
26199249SedBIN1+=	etc.${MACHINE_ARCH}/ttys
27199249Sed.endif
28199249Sed
29155210SrwatsonOPENBSMDIR=			${.CURDIR}/../contrib/openbsm
30155210SrwatsonBSM_ETC_OPEN_FILES=		${OPENBSMDIR}/etc/audit_class \
31155210Srwatson				${OPENBSMDIR}/etc/audit_event
32155210SrwatsonBSM_ETC_RESTRICTED_FILES=	${OPENBSMDIR}/etc/audit_control \
33155210Srwatson				${OPENBSMDIR}/etc/audit_user
34155210SrwatsonBSM_ETC_EXEC_FILES=		${OPENBSMDIR}/etc/audit_warn
35155210SrwatsonBSM_ETC_DIR=			${DESTDIR}/etc/security
36155210Srwatson
37183242Ssam# NB: keep these sorted by MK_* knobs
38183242Ssam
39183242Ssam.if ${MK_AMD} != "no"
40183242SsamBIN1+= amd.map
41183242Ssam.endif
42183242Ssam
43183242Ssam.if ${MK_APM} != "no"
44183242SsamBIN1+= apmd.conf
45183242Ssam.endif
46183242Ssam
47183242Ssam.if ${MK_BSNMP} != "no"
48183242SsamBIN1+= snmpd.config
49183242Ssam.endif
50183242Ssam
51183242Ssam.if ${MK_FREEBSD_UPDATE} != "no"
52183242SsamBIN1+= freebsd-update.conf
53183242Ssam.endif
54183242Ssam
55183242Ssam.if ${MK_LOCATE} != "no"
56183242SsamBIN1+=	${.CURDIR}/../usr.bin/locate/locate/locate.rc
57183242Ssam.endif
58183242Ssam
59156813Sru.if ${MK_LPR} != "no"
60183242SsamBIN1+=	hosts.lpd printcap
61121911Smarkm.endif
6237Srgrimes
63183242Ssam.if ${MK_MAIL} != "no"
64183242SsamBIN1+=	${.CURDIR}/../usr.bin/mail/misc/mail.rc
65158115Sume.endif
66158115Sume
67183242Ssam.if ${MK_MAN} != "no"
68183242SsamBIN1+=	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config
69183242Ssam.endif
70183242Ssam
71193635Sedwin.if ${MK_NTP} != "no"
72193635SedwinBIN1+=	ntp.conf
73193635Sedwin.endif
74193635Sedwin
75156813Sru.if ${MK_OPENSSH} != "no"
7657488SpeterSSH=	${.CURDIR}/../crypto/openssh/ssh_config \
7774837Sgreen	${.CURDIR}/../crypto/openssh/sshd_config \
78124214Sdes	${.CURDIR}/../crypto/openssh/moduli
7957459Smarkm.endif
80156813Sru.if ${MK_OPENSSL} != "no"
8160677SkrisSSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
8260677Skris.endif
8360677Skris
84183242Ssam.if ${MK_NS_CACHING} != "no"
85183242SsamBIN1+= nscd.conf
86183242Ssam.endif
87183242Ssam
88183242Ssam.if ${MK_PORTSNAP} != "no"
89183242SsamBIN1+= portsnap.conf
90183242Ssam.endif
91183242Ssam
92183242Ssam.if ${MK_PF} != "no"
93183242SsamBIN1+= pf.os
94183242Ssam.endif
95183242Ssam
96184343Ssam.if ${MK_TCSH} != "no"
97184343SsamBIN1+= csh.cshrc csh.login csh.logout
98184343Ssam.endif
99184343Ssam
100183268Ssam.if ${MK_WIRELESS} != "no"
101183268SsamBIN1+= regdomain.xml
102183268Ssam.endif
103183268Ssam
10482521Salex# -rwxr-xr-x root:wheel, for the new cron root:wheel
105108002SgreenBIN2=	netstart pccard_ether rc.suspend rc.resume
106147Srgrimes
107196767SflzMTREE=	BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
108156813Sru.if ${MK_SENDMAIL} != "no"
10995144SgshapiroMTREE+=	BSD.sendmail.dist
11095144Sgshapiro.endif
111156813Sru.if ${MK_BIND} != "no"
112135851SdougbMTREE+=	BIND.chroot.dist
113156813Sru.if ${MK_BIND_LIBS} != "no"
114135851SdougbMTREE+=	BIND.include.dist
115135851Sdougb.endif
116135851Sdougb.endif
11799451Sru
11899451SruPPPCNF=	ppp.conf
11999451Sru
120156813Sru.if ${MK_SENDMAIL} == "no"
121117292SgshapiroETCMAIL=mailer.conf aliases
122117292Sgshapiro.else
12364598SgshapiroETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
12464598Sgshapiro	mailertable.sample aliases
125117292Sgshapiro.endif
12637Srgrimes
127263Srgrimes# Special top level files for FreeBSD
12899449SruFREEBSD=COPYRIGHT
129263Srgrimes
130124831Sruafterinstall:
131156813Sru.if ${MK_MAN} != "no"
132173135Syar	${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
133124831Sru.endif
134124831Sru
1354487Sphkdistribute:
136173135Syar	${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
137173135Syar	${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
1385948Sjkh
139142794Sru.include <bsd.endian.mk>
140142794Sru.if ${TARGET_ENDIANNESS} == "1234"
141152471SruCAP_MKDB_ENDIAN?= -l
142152471SruPWD_MKDB_ENDIAN?= -L
143142794Sru.elif ${TARGET_ENDIANNESS} == "4321"
144152471SruCAP_MKDB_ENDIAN?= -b
145152471SruPWD_MKDB_ENDIAN?= -B
146142794Sru.else
147149515SimpCAP_MKDB_ENDIAN?=
148149515SimpPWD_MKDB_ENDIAN?=
149142794Sru.endif
150142794Sru
1514487Sphkdistribution:
152148282Sru.if !defined(DESTDIR)
153148282Sru	@echo "set DESTDIR before running \"make ${.TARGET}\""
154148282Sru	@false
155148282Sru.endif
15699449Sru	cd ${.CURDIR}; \
157100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
15899451Sru		${BIN1} ${DESTDIR}/etc; \
159142794Sru	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
160100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
16199451Sru		${BIN2} ${DESTDIR}/etc; \
162100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
163184343Ssam		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
164205329Sed.if ${MK_AT} == "no"
165205335Sed	sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
166205329Sed.endif
167184343Ssam.if ${MK_TCSH} == "no"
168184443Smp	sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
169184343Ssam.endif
170184343Ssam	pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
171184343Ssam	    ${DESTDIR}/etc/master.passwd
172183242Ssam.if ${MK_BLUETOOTH} != "no"
173173135Syar	${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
174183242Ssam.endif
175173135Syar	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
176186249Sthompsa	${_+_}cd ${.CURDIR}/devd; ${MAKE} install
177173135Syar	${_+_}cd ${.CURDIR}/gss; ${MAKE} install
178173135Syar	${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
179173135Syar	${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
180173135Syar	${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
181173135Syar	${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
182173135Syar	${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
183173135Syar	${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
184155210Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
185155210Srwatson	    ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
186155571Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
187155210Srwatson	    ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
188155210Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
189155210Srwatson	    ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
190170913Sdougb.if ${MK_BIND_MTREE} != "no"
191170913Sdougb	@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
192170913Sdougb		set -x; \
193170913Sdougb		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
194170913Sdougb	fi
195170913Sdougb.endif
196170913Sdougb.if ${MK_BIND_ETC} != "no"
197173135Syar	${_+_}cd ${.CURDIR}/namedb; ${MAKE} install
198170913Sdougb.endif
199156813Sru.if ${MK_SENDMAIL} != "no"
200173135Syar	${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
20173251Sgshapiro.endif
202156813Sru.if ${MK_OPENSSH} != "no"
203100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
20499451Sru	    ${SSH} ${DESTDIR}/etc/ssh
20557488Speter.endif
206156813Sru.if ${MK_OPENSSL} != "no"
207100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
20899451Sru	    ${SSL} ${DESTDIR}/etc/ssl
20960677Skris.endif
210156813Sru.if ${MK_KERBEROS} != "no"
21199449Sru	cd ${.CURDIR}/root; \
212100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
213120709Sphk		dot.k5login ${DESTDIR}/root/.k5login;
214120709Sphk.endif
215120709Sphk	cd ${.CURDIR}/root; \
216120709Sphk	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
217184343Ssam		dot.profile ${DESTDIR}/root/.profile; \
218184343Ssam	    rm -f ${DESTDIR}/.profile; \
219184343Ssam	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
220184343Ssam.if ${MK_TCSH} != "no"
221184343Ssam	cd ${.CURDIR}/root; \
222184343Ssam	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
22399451Sru		dot.cshrc ${DESTDIR}/root/.cshrc; \
224100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
22599451Sru		dot.login ${DESTDIR}/root/.login; \
226184343Ssam	    rm -f ${DESTDIR}/.cshrc; \
227184343Ssam	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
228184343Ssam.endif
229100872Sru	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
2301731Sjkh	    ${MTREE} ${DESTDIR}/etc/mtree
231183242Ssam.if ${MK_PPP} != "no"
232119058Sobrien	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
2336177Samurai	    ${PPPCNF} ${DESTDIR}/etc/ppp
234183242Ssam.endif
235183242Ssam.if ${MK_MAIL} != "no"
236100872Sru	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
23764598Sgshapiro	    ${ETCMAIL} ${DESTDIR}/etc/mail
23864629Sgshapiro	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
23964629Sgshapiro	      ! -f ${DESTDIR}/etc/aliases ]; then \
24064629Sgshapiro		set -x; \
24164629Sgshapiro		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
24264629Sgshapiro	fi
243183242Ssam.endif
244100872Sru	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
24537Srgrimes	    ${DESTDIR}/etc/dumpdates
246100872Sru	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
247147Srgrimes	    ${DESTDIR}/var/db/locate.database
248100872Sru	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
2491759Sjkh	    ${DESTDIR}/var/crash
250100872Sru	cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
25199451Sru		${FREEBSD} ${DESTDIR}/
252171427Simp.if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
253126977Sru	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
254126977Sru	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
255126977Sru	    ${DESTDIR}/boot/device.hints
256171427Simp.endif
25737Srgrimes
258147Srgrimesdistrib-dirs:
259127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
260127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
261127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
262127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
2637129Srgrimes		-p ${DESTDIR}/usr/include
264156813Sru.if ${MK_BIND_LIBS} != "no"
265135875Sdougb	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
266135875Sdougb	    -p ${DESTDIR}/usr/include
267135875Sdougb.endif
268156813Sru.if ${MK_BIND_MTREE} != "no"
269135875Sdougb	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
270135875Sdougb	    -p ${DESTDIR}/var/named
271135875Sdougb.endif
272156813Sru.if ${MK_SENDMAIL} != "no"
27395144Sgshapiro	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
27495144Sgshapiro.endif
275410Srgrimes	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
27677993Sache	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
277183698Sdes	cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* .
27877993Sache	cd ${DESTDIR}/usr/share/man; \
27977993Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
28077993Sache	while [ $$# -gt 0 ] ; \
28177993Sache	do \
28277993Sache		rm -rf "$$1"; \
28377993Sache		ln -s "$$2" "$$1"; \
28477993Sache		shift; shift; \
28577993Sache	done
286110663Sache	cd ${DESTDIR}/usr/share/openssl/man; \
287110663Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
288110663Sache	while [ $$# -gt 0 ] ; \
289110663Sache	do \
290110663Sache		rm -rf "$$1"; \
291110663Sache		ln -s "$$2" "$$1"; \
292110663Sache		shift; shift; \
293110663Sache	done
294110655Snectar	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
29511635Sache	cd ${DESTDIR}/usr/share/nls; \
29677999Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
29711635Sache	while [ $$# -gt 0 ] ; \
29811635Sache	do \
29911635Sache		rm -rf "$$1"; \
30011635Sache		ln -s "$$2" "$$1"; \
30111635Sache		shift; shift; \
30277999Sache	done
303147Srgrimes
30448185Ssheldonhetc-examples:
305100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
30699451Sru	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
30799451Sru	    ${DESTDIR}/usr/share/examples/etc
308173135Syar	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
309119385Smtm	    DESTDIR=${DESTDIR}/usr/share/examples
31048185Ssheldonh
31137Srgrimes.include <bsd.prog.mk>
312