Makefile revision 183268
11195Srgrimes#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
250472Speter# $FreeBSD: head/etc/Makefile 183268 2008-09-22 15:37:47Z sam $
337Srgrimes
4156813Sru.include <bsd.own.mk>
5156813Sru
6156813Sru.if ${MK_SENDMAIL} != "no"
738103SpeterSUBDIR=	sendmail
873251Sgshapiro.endif
938103Speter
10183242SsamBIN1=	auth.conf \
11114780Sdougb	crontab csh.cshrc csh.login csh.logout 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 \
18145693Sbrooks	rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
19145693Sbrooks	rc.sendmail rc.shutdown \
20183242Ssam	rc.subr remote rpc services shells \
21183242Ssam	sysctl.conf syslog.conf \
22183242Ssam	etc.${MACHINE_ARCH}/ttys
23155210Srwatson
24155210SrwatsonOPENBSMDIR=			${.CURDIR}/../contrib/openbsm
25155210SrwatsonBSM_ETC_OPEN_FILES=		${OPENBSMDIR}/etc/audit_class \
26155210Srwatson				${OPENBSMDIR}/etc/audit_event
27155210SrwatsonBSM_ETC_RESTRICTED_FILES=	${OPENBSMDIR}/etc/audit_control \
28155210Srwatson				${OPENBSMDIR}/etc/audit_user
29155210SrwatsonBSM_ETC_EXEC_FILES=		${OPENBSMDIR}/etc/audit_warn
30155210SrwatsonBSM_ETC_DIR=			${DESTDIR}/etc/security
31155210Srwatson
32183242Ssam# NB: keep these sorted by MK_* knobs
33183242Ssam
34183242Ssam.if ${MK_AMD} != "no"
35183242SsamBIN1+= amd.map
36183242Ssam.endif
37183242Ssam
38183242Ssam.if ${MK_APM} != "no"
39183242SsamBIN1+= apmd.conf
40183242Ssam.endif
41183242Ssam
42183242Ssam.if ${MK_BSNMP} != "no"
43183242SsamBIN1+= snmpd.config
44183242Ssam.endif
45183242Ssam
46183242Ssam.if ${MK_FREEBSD_UPDATE} != "no"
47183242SsamBIN1+= freebsd-update.conf
48183242Ssam.endif
49183242Ssam
50183242Ssam.if ${MK_LOCATE} != "no"
51183242SsamBIN1+=	${.CURDIR}/../usr.bin/locate/locate/locate.rc
52183242Ssam.endif
53183242Ssam
54156813Sru.if ${MK_LPR} != "no"
55183242SsamBIN1+=	hosts.lpd printcap
56121911Smarkm.endif
5737Srgrimes
58183242Ssam.if ${MK_MAIL} != "no"
59183242SsamBIN1+=	${.CURDIR}/../usr.bin/mail/misc/mail.rc
60158115Sume.endif
61158115Sume
62183242Ssam.if ${MK_MAN} != "no"
63183242SsamBIN1+=	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config
64183242Ssam.endif
65183242Ssam
66156813Sru.if ${MK_OPENSSH} != "no"
6757488SpeterSSH=	${.CURDIR}/../crypto/openssh/ssh_config \
6874837Sgreen	${.CURDIR}/../crypto/openssh/sshd_config \
69124214Sdes	${.CURDIR}/../crypto/openssh/moduli
7057459Smarkm.endif
71156813Sru.if ${MK_OPENSSL} != "no"
7260677SkrisSSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
7360677Skris.endif
7460677Skris
75183242Ssam.if ${MK_NS_CACHING} != "no"
76183242SsamBIN1+= nscd.conf
77183242Ssam.endif
78183242Ssam
79183242Ssam.if ${MK_PORTSNAP} != "no"
80183242SsamBIN1+= portsnap.conf
81183242Ssam.endif
82183242Ssam
83183242Ssam.if ${MK_PF} != "no"
84183242SsamBIN1+= pf.os
85183242Ssam.endif
86183242Ssam
87183268Ssam.if ${MK_WIRELESS} != "no"
88183268SsamBIN1+= regdomain.xml
89183268Ssam.endif
90183268Ssam
9182521Salex# -rwxr-xr-x root:wheel, for the new cron root:wheel
92108002SgreenBIN2=	netstart pccard_ether rc.suspend rc.resume
93147Srgrimes
9427487SasamiMTREE=	BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
9565168Sasami	BSD.var.dist BSD.x11.dist BSD.x11-4.dist
96156813Sru.if ${MK_SENDMAIL} != "no"
9795144SgshapiroMTREE+=	BSD.sendmail.dist
9895144Sgshapiro.endif
99156813Sru.if ${MK_BIND} != "no"
100135851SdougbMTREE+=	BIND.chroot.dist
101156813Sru.if ${MK_BIND_LIBS} != "no"
102135851SdougbMTREE+=	BIND.include.dist
103135851Sdougb.endif
104135851Sdougb.endif
10599451Sru
10699451SruPPPCNF=	ppp.conf
10799451Sru
108156813Sru.if ${MK_SENDMAIL} == "no"
109117292SgshapiroETCMAIL=mailer.conf aliases
110117292Sgshapiro.else
11164598SgshapiroETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
11264598Sgshapiro	mailertable.sample aliases
113117292Sgshapiro.endif
11437Srgrimes
115263Srgrimes# Special top level files for FreeBSD
11699449SruFREEBSD=COPYRIGHT
117263Srgrimes
118124831Sruafterinstall:
119156813Sru.if ${MK_MAN} != "no"
120173135Syar	${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
121124831Sru.endif
122124831Sru
1234487Sphkdistribute:
124173135Syar	${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
125173135Syar	${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
1265948Sjkh
127142794Sru.include <bsd.endian.mk>
128142794Sru.if ${TARGET_ENDIANNESS} == "1234"
129152471SruCAP_MKDB_ENDIAN?= -l
130152471SruPWD_MKDB_ENDIAN?= -L
131142794Sru.elif ${TARGET_ENDIANNESS} == "4321"
132152471SruCAP_MKDB_ENDIAN?= -b
133152471SruPWD_MKDB_ENDIAN?= -B
134142794Sru.else
135149515SimpCAP_MKDB_ENDIAN?=
136149515SimpPWD_MKDB_ENDIAN?=
137142794Sru.endif
138142794Sru
1394487Sphkdistribution:
140148282Sru.if !defined(DESTDIR)
141148282Sru	@echo "set DESTDIR before running \"make ${.TARGET}\""
142148282Sru	@false
143148282Sru.endif
14499449Sru	cd ${.CURDIR}; \
145100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
14699451Sru		${BIN1} ${DESTDIR}/etc; \
147142794Sru	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
148100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
14999451Sru		${BIN2} ${DESTDIR}/etc; \
150100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
15199451Sru		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
152148053Sru	    pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
153142838Sru		${DESTDIR}/etc/master.passwd
154183242Ssam.if ${MK_BLUETOOTH} != "no"
155173135Syar	${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
156183242Ssam.endif
157173135Syar	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
158173135Syar	${_+_}cd ${.CURDIR}/gss; ${MAKE} install
159173135Syar	${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
160173135Syar	${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
161173135Syar	${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
162173135Syar	${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
163173135Syar	${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
164173135Syar	${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
165155210Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
166155210Srwatson	    ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
167155571Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
168155210Srwatson	    ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
169155210Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
170155210Srwatson	    ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
171170913Sdougb.if ${MK_BIND_MTREE} != "no"
172170913Sdougb	@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
173170913Sdougb		set -x; \
174170913Sdougb		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
175170913Sdougb	fi
176170913Sdougb.endif
177170913Sdougb.if ${MK_BIND_ETC} != "no"
178173135Syar	${_+_}cd ${.CURDIR}/namedb; ${MAKE} install
179170913Sdougb.endif
180156813Sru.if ${MK_SENDMAIL} != "no"
181173135Syar	${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
18273251Sgshapiro.endif
183156813Sru.if ${MK_OPENSSH} != "no"
184100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
18599451Sru	    ${SSH} ${DESTDIR}/etc/ssh
18657488Speter.endif
187156813Sru.if ${MK_OPENSSL} != "no"
188100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
18999451Sru	    ${SSL} ${DESTDIR}/etc/ssl
19060677Skris.endif
191156813Sru.if ${MK_KERBEROS} != "no"
19299449Sru	cd ${.CURDIR}/root; \
193100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
194120709Sphk		dot.k5login ${DESTDIR}/root/.k5login;
195120709Sphk.endif
196120709Sphk	cd ${.CURDIR}/root; \
197120709Sphk	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
19899451Sru		dot.cshrc ${DESTDIR}/root/.cshrc; \
199100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
20099451Sru		dot.login ${DESTDIR}/root/.login; \
201100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
20299451Sru		dot.profile ${DESTDIR}/root/.profile; \
20399451Sru	    rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
20499451Sru	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
20599451Sru	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
206100872Sru	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
2071731Sjkh	    ${MTREE} ${DESTDIR}/etc/mtree
208183242Ssam.if ${MK_PPP} != "no"
209119058Sobrien	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
2106177Samurai	    ${PPPCNF} ${DESTDIR}/etc/ppp
211183242Ssam.endif
212183242Ssam.if ${MK_MAIL} != "no"
213100872Sru	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
21464598Sgshapiro	    ${ETCMAIL} ${DESTDIR}/etc/mail
21564629Sgshapiro	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
21664629Sgshapiro	      ! -f ${DESTDIR}/etc/aliases ]; then \
21764629Sgshapiro		set -x; \
21864629Sgshapiro		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
21964629Sgshapiro	fi
220183242Ssam.endif
221100872Sru	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
22237Srgrimes	    ${DESTDIR}/etc/dumpdates
223100872Sru	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
224147Srgrimes	    ${DESTDIR}/var/db/locate.database
225100872Sru	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
2261759Sjkh	    ${DESTDIR}/var/crash
227100872Sru	cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
22899451Sru		${FREEBSD} ${DESTDIR}/
229171427Simp.if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
230126977Sru	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
231126977Sru	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
232126977Sru	    ${DESTDIR}/boot/device.hints
233171427Simp.endif
23437Srgrimes
235147Srgrimesdistrib-dirs:
236127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
237127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
238127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
239127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
2407129Srgrimes		-p ${DESTDIR}/usr/include
241156813Sru.if ${MK_BIND_LIBS} != "no"
242135875Sdougb	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
243135875Sdougb	    -p ${DESTDIR}/usr/include
244135875Sdougb.endif
245156813Sru.if ${MK_BIND_MTREE} != "no"
246135875Sdougb	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
247135875Sdougb	    -p ${DESTDIR}/var/named
248135875Sdougb.endif
249156813Sru.if ${MK_SENDMAIL} != "no"
25095144Sgshapiro	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
25195144Sgshapiro.endif
252410Srgrimes	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
25377993Sache	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
25477993Sache	cd ${DESTDIR}/usr/share/man; \
25577993Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
25677993Sache	while [ $$# -gt 0 ] ; \
25777993Sache	do \
25877993Sache		rm -rf "$$1"; \
25977993Sache		ln -s "$$2" "$$1"; \
26077993Sache		shift; shift; \
26177993Sache	done
262110663Sache	cd ${DESTDIR}/usr/share/openssl/man; \
263110663Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
264110663Sache	while [ $$# -gt 0 ] ; \
265110663Sache	do \
266110663Sache		rm -rf "$$1"; \
267110663Sache		ln -s "$$2" "$$1"; \
268110663Sache		shift; shift; \
269110663Sache	done
270110655Snectar	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
27111635Sache	cd ${DESTDIR}/usr/share/nls; \
27277999Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
27311635Sache	while [ $$# -gt 0 ] ; \
27411635Sache	do \
27511635Sache		rm -rf "$$1"; \
27611635Sache		ln -s "$$2" "$$1"; \
27711635Sache		shift; shift; \
27877999Sache	done
279147Srgrimes
28048185Ssheldonhetc-examples:
281100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
28299451Sru	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
28399451Sru	    ${DESTDIR}/usr/share/examples/etc
284173135Syar	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
285119385Smtm	    DESTDIR=${DESTDIR}/usr/share/examples
28648185Ssheldonh
28737Srgrimes.include <bsd.prog.mk>
288