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