Makefile revision 171427
11195Srgrimes#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
250472Speter# $FreeBSD: head/etc/Makefile 171427 2007-07-13 14:28:10Z imp $
337Srgrimes
4156813Sru.include <bsd.own.mk>
5156813Sru
6156813Sru.if ${MK_SENDMAIL} != "no"
738103SpeterSUBDIR=	sendmail
873251Sgshapiro.endif
938103Speter
1099451SruBIN1=	amd.map apmd.conf auth.conf \
11114780Sdougb	crontab csh.cshrc csh.login csh.logout devd.conf devfs.conf \
12161748Scperciva	dhclient.conf disktab fbtab freebsd-update.conf \
13161748Scperciva	ftpusers gettytab group \
1465532Snectar	hosts hosts.allow hosts.equiv hosts.lpd \
15162674Spiso	inetd.conf libalias.conf login.access login.conf mac.conf motd \
16158266Sume	netconfig network.subr networks newsyslog.conf nsswitch.conf \
17148871Scperciva	portsnap.conf pf.conf pf.os phones profile protocols \
18145693Sbrooks	rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
19145693Sbrooks	rc.sendmail rc.shutdown \
20145184Sglebius	rc.subr remote rpc services shells \
21153430Siedowse	snmpd.config sysctl.conf syslog.conf \
2255230Speter	etc.${MACHINE_ARCH}/ttys \
231734Sjkh	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
2417639Swosch	${.CURDIR}/../usr.bin/mail/misc/mail.rc \
2517639Swosch	${.CURDIR}/../usr.bin/locate/locate/locate.rc
26155210Srwatson
27155210SrwatsonOPENBSMDIR=			${.CURDIR}/../contrib/openbsm
28155210SrwatsonBSM_ETC_OPEN_FILES=		${OPENBSMDIR}/etc/audit_class \
29155210Srwatson				${OPENBSMDIR}/etc/audit_event
30155210SrwatsonBSM_ETC_RESTRICTED_FILES=	${OPENBSMDIR}/etc/audit_control \
31155210Srwatson				${OPENBSMDIR}/etc/audit_user
32155210SrwatsonBSM_ETC_EXEC_FILES=		${OPENBSMDIR}/etc/audit_warn
33155210SrwatsonBSM_ETC_DIR=			${DESTDIR}/etc/security
34155210Srwatson
35156813Sru.if ${MK_LPR} != "no"
36121911SmarkmBIN1+=	printcap
37121911Smarkm.endif
3837Srgrimes
39158115Sume.if ${MK_NS_CACHING} != "no"
40158115SumeBIN1+= cached.conf
41158115Sume.endif
42158115Sume
43156813Sru.if ${MK_OPENSSH} != "no"
4457488SpeterSSH=	${.CURDIR}/../crypto/openssh/ssh_config \
4574837Sgreen	${.CURDIR}/../crypto/openssh/sshd_config \
46124214Sdes	${.CURDIR}/../crypto/openssh/moduli
4757459Smarkm.endif
48156813Sru.if ${MK_OPENSSL} != "no"
4960677SkrisSSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
5060677Skris.endif
5160677Skris
5282521Salex# -rwxr-xr-x root:wheel, for the new cron root:wheel
53108002SgreenBIN2=	netstart pccard_ether rc.suspend rc.resume
54147Srgrimes
5527487SasamiMTREE=	BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
5665168Sasami	BSD.var.dist BSD.x11.dist BSD.x11-4.dist
57156813Sru.if ${MK_SENDMAIL} != "no"
5895144SgshapiroMTREE+=	BSD.sendmail.dist
5995144Sgshapiro.endif
60156813Sru.if ${MK_BIND} != "no"
61135851SdougbMTREE+=	BIND.chroot.dist
62156813Sru.if ${MK_BIND_LIBS} != "no"
63135851SdougbMTREE+=	BIND.include.dist
64135851Sdougb.endif
65135851Sdougb.endif
6699451Sru
6799451SruPPPCNF=	ppp.conf
6899451Sru
69156813Sru.if ${MK_SENDMAIL} == "no"
70117292SgshapiroETCMAIL=mailer.conf aliases
71117292Sgshapiro.else
7264598SgshapiroETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
7364598Sgshapiro	mailertable.sample aliases
74117292Sgshapiro.endif
7537Srgrimes
76263Srgrimes# Special top level files for FreeBSD
7799449SruFREEBSD=COPYRIGHT
78263Srgrimes
79124831Sruafterinstall:
80156813Sru.if ${MK_MAN} != "no"
81124831Sru	cd ${.CURDIR}/../share/man; ${MAKE} makedb
82124831Sru.endif
83124831Sru
844487Sphkdistribute:
85124831Sru	cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
8695327Sobrien	cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
875948Sjkh
88142794Sru.include <bsd.endian.mk>
89142794Sru.if ${TARGET_ENDIANNESS} == "1234"
90152471SruCAP_MKDB_ENDIAN?= -l
91152471SruPWD_MKDB_ENDIAN?= -L
92142794Sru.elif ${TARGET_ENDIANNESS} == "4321"
93152471SruCAP_MKDB_ENDIAN?= -b
94152471SruPWD_MKDB_ENDIAN?= -B
95142794Sru.else
96149515SimpCAP_MKDB_ENDIAN?=
97149515SimpPWD_MKDB_ENDIAN?=
98142794Sru.endif
99142794Sru
1004487Sphkdistribution:
101148282Sru.if !defined(DESTDIR)
102148282Sru	@echo "set DESTDIR before running \"make ${.TARGET}\""
103148282Sru	@false
104148282Sru.endif
10599449Sru	cd ${.CURDIR}; \
106100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
10799451Sru		${BIN1} ${DESTDIR}/etc; \
108142794Sru	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
109100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
11099451Sru		${BIN2} ${DESTDIR}/etc; \
111100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
11299451Sru		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
113148053Sru	    pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
114142838Sru		${DESTDIR}/etc/master.passwd
115121580Semax	cd ${.CURDIR}/bluetooth; ${MAKE} install
116119385Smtm	cd ${.CURDIR}/defaults; ${MAKE} install
117153838Sdfr	cd ${.CURDIR}/gss; ${MAKE} install
11899449Sru	cd ${.CURDIR}/periodic; ${MAKE} install
11999449Sru	cd ${.CURDIR}/rc.d; ${MAKE} install
12099449Sru	cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
12199449Sru	cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
12299449Sru	cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
12399449Sru	cd ${.CURDIR}/pam.d; ${MAKE} install
124155210Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
125155210Srwatson	    ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
126155571Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
127155210Srwatson	    ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
128155210Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
129155210Srwatson	    ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
130156813Sru.if ${MK_I4B} != "no"
13199449Sru	cd ${.CURDIR}/isdn; ${MAKE} install
13277041Sru.endif
133170913Sdougb.if ${MK_BIND_MTREE} != "no"
134170913Sdougb	@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
135170913Sdougb		set -x; \
136170913Sdougb		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
137170913Sdougb	fi
138170913Sdougb.endif
139170913Sdougb.if ${MK_BIND_ETC} != "no"
140170913Sdougb	cd ${.CURDIR}/namedb; ${MAKE} install
141170913Sdougb.endif
142156813Sru.if ${MK_SENDMAIL} != "no"
14399449Sru	cd ${.CURDIR}/sendmail; ${MAKE} distribution
14473251Sgshapiro.endif
145156813Sru.if ${MK_OPENSSH} != "no"
146100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
14799451Sru	    ${SSH} ${DESTDIR}/etc/ssh
14857488Speter.endif
149156813Sru.if ${MK_OPENSSL} != "no"
150100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
15199451Sru	    ${SSL} ${DESTDIR}/etc/ssl
15260677Skris.endif
153156813Sru.if ${MK_KERBEROS} != "no"
15499449Sru	cd ${.CURDIR}/root; \
155100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
156120709Sphk		dot.k5login ${DESTDIR}/root/.k5login;
157120709Sphk.endif
158120709Sphk	cd ${.CURDIR}/root; \
159120709Sphk	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
16099451Sru		dot.cshrc ${DESTDIR}/root/.cshrc; \
161100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
16299451Sru		dot.login ${DESTDIR}/root/.login; \
163100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
16499451Sru		dot.profile ${DESTDIR}/root/.profile; \
16599451Sru	    rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
16699451Sru	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
16799451Sru	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
168100872Sru	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
1691731Sjkh	    ${MTREE} ${DESTDIR}/etc/mtree
170119058Sobrien	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
1716177Samurai	    ${PPPCNF} ${DESTDIR}/etc/ppp
172100872Sru	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
17364598Sgshapiro	    ${ETCMAIL} ${DESTDIR}/etc/mail
17464629Sgshapiro	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
17564629Sgshapiro	      ! -f ${DESTDIR}/etc/aliases ]; then \
17664629Sgshapiro		set -x; \
17764629Sgshapiro		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
17864629Sgshapiro	fi
179100872Sru	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
18037Srgrimes	    ${DESTDIR}/etc/dumpdates
181100872Sru	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
182147Srgrimes	    ${DESTDIR}/var/db/locate.database
183100872Sru	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
1841759Sjkh	    ${DESTDIR}/var/crash
185100872Sru	cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
18699451Sru		${FREEBSD} ${DESTDIR}/
187171427Simp.if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
188126977Sru	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
189126977Sru	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
190126977Sru	    ${DESTDIR}/boot/device.hints
191171427Simp.endif
19237Srgrimes
193147Srgrimesdistrib-dirs:
194127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
195127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
196127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
197127339Sdes	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
1987129Srgrimes		-p ${DESTDIR}/usr/include
199156813Sru.if ${MK_BIND_LIBS} != "no"
200135875Sdougb	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
201135875Sdougb	    -p ${DESTDIR}/usr/include
202135875Sdougb.endif
203156813Sru.if ${MK_BIND_MTREE} != "no"
204135875Sdougb	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
205135875Sdougb	    -p ${DESTDIR}/var/named
206135875Sdougb.endif
207156813Sru.if ${MK_SENDMAIL} != "no"
20895144Sgshapiro	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
20995144Sgshapiro.endif
210410Srgrimes	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
21177993Sache	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
21277993Sache	cd ${DESTDIR}/usr/share/man; \
21377993Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
21477993Sache	while [ $$# -gt 0 ] ; \
21577993Sache	do \
21677993Sache		rm -rf "$$1"; \
21777993Sache		ln -s "$$2" "$$1"; \
21877993Sache		shift; shift; \
21977993Sache	done
220110663Sache	cd ${DESTDIR}/usr/share/openssl/man; \
221110663Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
222110663Sache	while [ $$# -gt 0 ] ; \
223110663Sache	do \
224110663Sache		rm -rf "$$1"; \
225110663Sache		ln -s "$$2" "$$1"; \
226110663Sache		shift; shift; \
227110663Sache	done
228110655Snectar	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
22911635Sache	cd ${DESTDIR}/usr/share/nls; \
23077999Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
23111635Sache	while [ $$# -gt 0 ] ; \
23211635Sache	do \
23311635Sache		rm -rf "$$1"; \
23411635Sache		ln -s "$$2" "$$1"; \
23511635Sache		shift; shift; \
23677999Sache	done
237147Srgrimes
23848185Ssheldonhetc-examples:
239100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
24099451Sru	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
24199451Sru	    ${DESTDIR}/usr/share/examples/etc
242119385Smtm	cd ${.CURDIR}/defaults; ${MAKE} install \
243119385Smtm	    DESTDIR=${DESTDIR}/usr/share/examples
24448185Ssheldonh
24537Srgrimes.include <bsd.prog.mk>
246