Makefile revision 193635
11195Srgrimes#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
250472Speter# $FreeBSD: head/etc/Makefile 193635 2009-06-07 13:26:57Z edwin $
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 \
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
66193635Sedwin.if ${MK_NTP} != "no"
67193635SedwinBIN1+=	ntp.conf
68193635Sedwin.endif
69193635Sedwin
70156813Sru.if ${MK_OPENSSH} != "no"
7157488SpeterSSH=	${.CURDIR}/../crypto/openssh/ssh_config \
7274837Sgreen	${.CURDIR}/../crypto/openssh/sshd_config \
73124214Sdes	${.CURDIR}/../crypto/openssh/moduli
7457459Smarkm.endif
75156813Sru.if ${MK_OPENSSL} != "no"
7660677SkrisSSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
7760677Skris.endif
7860677Skris
79183242Ssam.if ${MK_NS_CACHING} != "no"
80183242SsamBIN1+= nscd.conf
81183242Ssam.endif
82183242Ssam
83183242Ssam.if ${MK_PORTSNAP} != "no"
84183242SsamBIN1+= portsnap.conf
85183242Ssam.endif
86183242Ssam
87183242Ssam.if ${MK_PF} != "no"
88183242SsamBIN1+= pf.os
89183242Ssam.endif
90183242Ssam
91184343Ssam.if ${MK_TCSH} != "no"
92184343SsamBIN1+= csh.cshrc csh.login csh.logout
93184343Ssam.endif
94184343Ssam
95183268Ssam.if ${MK_WIRELESS} != "no"
96183268SsamBIN1+= regdomain.xml
97183268Ssam.endif
98183268Ssam
9982521Salex# -rwxr-xr-x root:wheel, for the new cron root:wheel
100108002SgreenBIN2=	netstart pccard_ether rc.suspend rc.resume
101147Srgrimes
10227487SasamiMTREE=	BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
10365168Sasami	BSD.var.dist BSD.x11.dist BSD.x11-4.dist
104156813Sru.if ${MK_SENDMAIL} != "no"
10595144SgshapiroMTREE+=	BSD.sendmail.dist
10695144Sgshapiro.endif
107156813Sru.if ${MK_BIND} != "no"
108135851SdougbMTREE+=	BIND.chroot.dist
109156813Sru.if ${MK_BIND_LIBS} != "no"
110135851SdougbMTREE+=	BIND.include.dist
111135851Sdougb.endif
112135851Sdougb.endif
11399451Sru
11499451SruPPPCNF=	ppp.conf
11599451Sru
116156813Sru.if ${MK_SENDMAIL} == "no"
117117292SgshapiroETCMAIL=mailer.conf aliases
118117292Sgshapiro.else
11964598SgshapiroETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
12064598Sgshapiro	mailertable.sample aliases
121117292Sgshapiro.endif
12237Srgrimes
123263Srgrimes# Special top level files for FreeBSD
12499449SruFREEBSD=COPYRIGHT
125263Srgrimes
126124831Sruafterinstall:
127156813Sru.if ${MK_MAN} != "no"
128173135Syar	${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
129124831Sru.endif
130124831Sru
1314487Sphkdistribute:
132173135Syar	${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
133173135Syar	${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
1345948Sjkh
135142794Sru.include <bsd.endian.mk>
136142794Sru.if ${TARGET_ENDIANNESS} == "1234"
137152471SruCAP_MKDB_ENDIAN?= -l
138152471SruPWD_MKDB_ENDIAN?= -L
139142794Sru.elif ${TARGET_ENDIANNESS} == "4321"
140152471SruCAP_MKDB_ENDIAN?= -b
141152471SruPWD_MKDB_ENDIAN?= -B
142142794Sru.else
143149515SimpCAP_MKDB_ENDIAN?=
144149515SimpPWD_MKDB_ENDIAN?=
145142794Sru.endif
146142794Sru
1474487Sphkdistribution:
148148282Sru.if !defined(DESTDIR)
149148282Sru	@echo "set DESTDIR before running \"make ${.TARGET}\""
150148282Sru	@false
151148282Sru.endif
15299449Sru	cd ${.CURDIR}; \
153100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
15499451Sru		${BIN1} ${DESTDIR}/etc; \
155142794Sru	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
156100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
15799451Sru		${BIN2} ${DESTDIR}/etc; \
158100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
159184343Ssam		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
160184343Ssam.if ${MK_TCSH} == "no"
161184443Smp	sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
162184343Ssam.endif
163184343Ssam	pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
164184343Ssam	    ${DESTDIR}/etc/master.passwd
165183242Ssam.if ${MK_BLUETOOTH} != "no"
166173135Syar	${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
167183242Ssam.endif
168173135Syar	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
169186249Sthompsa	${_+_}cd ${.CURDIR}/devd; ${MAKE} install
170173135Syar	${_+_}cd ${.CURDIR}/gss; ${MAKE} install
171173135Syar	${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
172173135Syar	${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
173173135Syar	${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
174173135Syar	${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
175173135Syar	${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
176173135Syar	${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
177155210Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
178155210Srwatson	    ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
179155571Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
180155210Srwatson	    ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
181155210Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
182155210Srwatson	    ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
183170913Sdougb.if ${MK_BIND_MTREE} != "no"
184170913Sdougb	@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
185170913Sdougb		set -x; \
186170913Sdougb		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
187170913Sdougb	fi
188170913Sdougb.endif
189170913Sdougb.if ${MK_BIND_ETC} != "no"
190173135Syar	${_+_}cd ${.CURDIR}/namedb; ${MAKE} install
191170913Sdougb.endif
192156813Sru.if ${MK_SENDMAIL} != "no"
193173135Syar	${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
19473251Sgshapiro.endif
195156813Sru.if ${MK_OPENSSH} != "no"
196100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
19799451Sru	    ${SSH} ${DESTDIR}/etc/ssh
19857488Speter.endif
199156813Sru.if ${MK_OPENSSL} != "no"
200100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
20199451Sru	    ${SSL} ${DESTDIR}/etc/ssl
20260677Skris.endif
203156813Sru.if ${MK_KERBEROS} != "no"
20499449Sru	cd ${.CURDIR}/root; \
205100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
206120709Sphk		dot.k5login ${DESTDIR}/root/.k5login;
207120709Sphk.endif
208120709Sphk	cd ${.CURDIR}/root; \
209120709Sphk	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
210184343Ssam		dot.profile ${DESTDIR}/root/.profile; \
211184343Ssam	    rm -f ${DESTDIR}/.profile; \
212184343Ssam	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
213184343Ssam.if ${MK_TCSH} != "no"
214184343Ssam	cd ${.CURDIR}/root; \
215184343Ssam	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
21699451Sru		dot.cshrc ${DESTDIR}/root/.cshrc; \
217100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
21899451Sru		dot.login ${DESTDIR}/root/.login; \
219184343Ssam	    rm -f ${DESTDIR}/.cshrc; \
220184343Ssam	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
221184343Ssam.endif
222100872Sru	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
2231731Sjkh	    ${MTREE} ${DESTDIR}/etc/mtree
224183242Ssam.if ${MK_PPP} != "no"
225119058Sobrien	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
2266177Samurai	    ${PPPCNF} ${DESTDIR}/etc/ppp
227183242Ssam.endif
228183242Ssam.if ${MK_MAIL} != "no"
229100872Sru	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
23064598Sgshapiro	    ${ETCMAIL} ${DESTDIR}/etc/mail
23164629Sgshapiro	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
23264629Sgshapiro	      ! -f ${DESTDIR}/etc/aliases ]; then \
23364629Sgshapiro		set -x; \
23464629Sgshapiro		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
23564629Sgshapiro	fi
236183242Ssam.endif
237100872Sru	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
23837Srgrimes	    ${DESTDIR}/etc/dumpdates
239100872Sru	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
240147Srgrimes	    ${DESTDIR}/var/db/locate.database
241100872Sru	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
2421759Sjkh	    ${DESTDIR}/var/crash
243100872Sru	cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
24499451Sru		${FREEBSD} ${DESTDIR}/
245171427Simp.if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
246126977Sru	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
247126977Sru	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
248126977Sru	    ${DESTDIR}/boot/device.hints
249171427Simp.endif
25037Srgrimes
251147Srgrimesdistrib-dirs:
252127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
253127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
254127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
255127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
2567129Srgrimes		-p ${DESTDIR}/usr/include
257156813Sru.if ${MK_BIND_LIBS} != "no"
258135875Sdougb	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
259135875Sdougb	    -p ${DESTDIR}/usr/include
260135875Sdougb.endif
261156813Sru.if ${MK_BIND_MTREE} != "no"
262135875Sdougb	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
263135875Sdougb	    -p ${DESTDIR}/var/named
264135875Sdougb.endif
265156813Sru.if ${MK_SENDMAIL} != "no"
26695144Sgshapiro	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
26795144Sgshapiro.endif
268410Srgrimes	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
26977993Sache	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
270183698Sdes	cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* .
27177993Sache	cd ${DESTDIR}/usr/share/man; \
27277993Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
27377993Sache	while [ $$# -gt 0 ] ; \
27477993Sache	do \
27577993Sache		rm -rf "$$1"; \
27677993Sache		ln -s "$$2" "$$1"; \
27777993Sache		shift; shift; \
27877993Sache	done
279110663Sache	cd ${DESTDIR}/usr/share/openssl/man; \
280110663Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
281110663Sache	while [ $$# -gt 0 ] ; \
282110663Sache	do \
283110663Sache		rm -rf "$$1"; \
284110663Sache		ln -s "$$2" "$$1"; \
285110663Sache		shift; shift; \
286110663Sache	done
287110655Snectar	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
28811635Sache	cd ${DESTDIR}/usr/share/nls; \
28977999Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
29011635Sache	while [ $$# -gt 0 ] ; \
29111635Sache	do \
29211635Sache		rm -rf "$$1"; \
29311635Sache		ln -s "$$2" "$$1"; \
29411635Sache		shift; shift; \
29577999Sache	done
296147Srgrimes
29748185Ssheldonhetc-examples:
298100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
29999451Sru	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
30099451Sru	    ${DESTDIR}/usr/share/examples/etc
301173135Syar	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
302119385Smtm	    DESTDIR=${DESTDIR}/usr/share/examples
30348185Ssheldonh
30437Srgrimes.include <bsd.prog.mk>
305