Makefile revision 186249
1#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
2# $FreeBSD: head/etc/Makefile 186249 2008-12-17 19:12:30Z thompsa $
3
4.include <bsd.own.mk>
5
6.if ${MK_SENDMAIL} != "no"
7SUBDIR=	sendmail
8.endif
9
10BIN1=	auth.conf \
11	crontab devd.conf devfs.conf \
12	ddb.conf dhclient.conf disktab fbtab \
13	ftpusers gettytab group \
14	hosts hosts.allow hosts.equiv \
15	inetd.conf libalias.conf login.access login.conf mac.conf motd \
16	netconfig network.subr networks newsyslog.conf nsswitch.conf \
17	phones profile protocols \
18	rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
19	rc.sendmail rc.shutdown \
20	rc.subr remote rpc services shells \
21	sysctl.conf syslog.conf \
22	etc.${MACHINE_ARCH}/ttys
23
24OPENBSMDIR=			${.CURDIR}/../contrib/openbsm
25BSM_ETC_OPEN_FILES=		${OPENBSMDIR}/etc/audit_class \
26				${OPENBSMDIR}/etc/audit_event
27BSM_ETC_RESTRICTED_FILES=	${OPENBSMDIR}/etc/audit_control \
28				${OPENBSMDIR}/etc/audit_user
29BSM_ETC_EXEC_FILES=		${OPENBSMDIR}/etc/audit_warn
30BSM_ETC_DIR=			${DESTDIR}/etc/security
31
32# NB: keep these sorted by MK_* knobs
33
34.if ${MK_AMD} != "no"
35BIN1+= 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.if ${MK_TCSH} != "no"
88BIN1+= csh.cshrc csh.login csh.logout
89.endif
90
91.if ${MK_WIRELESS} != "no"
92BIN1+= regdomain.xml
93.endif
94
95# -rwxr-xr-x root:wheel, for the new cron root:wheel
96BIN2=	netstart pccard_ether rc.suspend rc.resume
97
98MTREE=	BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
99	BSD.var.dist BSD.x11.dist BSD.x11-4.dist
100.if ${MK_SENDMAIL} != "no"
101MTREE+=	BSD.sendmail.dist
102.endif
103.if ${MK_BIND} != "no"
104MTREE+=	BIND.chroot.dist
105.if ${MK_BIND_LIBS} != "no"
106MTREE+=	BIND.include.dist
107.endif
108.endif
109
110PPPCNF=	ppp.conf
111
112.if ${MK_SENDMAIL} == "no"
113ETCMAIL=mailer.conf aliases
114.else
115ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
116	mailertable.sample aliases
117.endif
118
119# Special top level files for FreeBSD
120FREEBSD=COPYRIGHT
121
122afterinstall:
123.if ${MK_MAN} != "no"
124	${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
125.endif
126
127distribute:
128	${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
129	${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
130
131.include <bsd.endian.mk>
132.if ${TARGET_ENDIANNESS} == "1234"
133CAP_MKDB_ENDIAN?= -l
134PWD_MKDB_ENDIAN?= -L
135.elif ${TARGET_ENDIANNESS} == "4321"
136CAP_MKDB_ENDIAN?= -b
137PWD_MKDB_ENDIAN?= -B
138.else
139CAP_MKDB_ENDIAN?=
140PWD_MKDB_ENDIAN?=
141.endif
142
143distribution:
144.if !defined(DESTDIR)
145	@echo "set DESTDIR before running \"make ${.TARGET}\""
146	@false
147.endif
148	cd ${.CURDIR}; \
149	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
150		${BIN1} ${DESTDIR}/etc; \
151	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
152	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
153		${BIN2} ${DESTDIR}/etc; \
154	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
155		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
156.if ${MK_TCSH} == "no"
157	sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
158.endif
159	pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
160	    ${DESTDIR}/etc/master.passwd
161.if ${MK_BLUETOOTH} != "no"
162	${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
163.endif
164	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
165	${_+_}cd ${.CURDIR}/devd; ${MAKE} install
166	${_+_}cd ${.CURDIR}/gss; ${MAKE} install
167	${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
168	${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
169	${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
170	${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
171	${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
172	${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
173	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
174	    ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
175	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
176	    ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
177	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
178	    ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
179.if ${MK_BIND_MTREE} != "no"
180	@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
181		set -x; \
182		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
183	fi
184.endif
185.if ${MK_BIND_ETC} != "no"
186	${_+_}cd ${.CURDIR}/namedb; ${MAKE} install
187.endif
188.if ${MK_SENDMAIL} != "no"
189	${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
190.endif
191.if ${MK_OPENSSH} != "no"
192	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
193	    ${SSH} ${DESTDIR}/etc/ssh
194.endif
195.if ${MK_OPENSSL} != "no"
196	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
197	    ${SSL} ${DESTDIR}/etc/ssl
198.endif
199.if ${MK_KERBEROS} != "no"
200	cd ${.CURDIR}/root; \
201	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
202		dot.k5login ${DESTDIR}/root/.k5login;
203.endif
204	cd ${.CURDIR}/root; \
205	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
206		dot.profile ${DESTDIR}/root/.profile; \
207	    rm -f ${DESTDIR}/.profile; \
208	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
209.if ${MK_TCSH} != "no"
210	cd ${.CURDIR}/root; \
211	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
212		dot.cshrc ${DESTDIR}/root/.cshrc; \
213	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
214		dot.login ${DESTDIR}/root/.login; \
215	    rm -f ${DESTDIR}/.cshrc; \
216	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
217.endif
218	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
219	    ${MTREE} ${DESTDIR}/etc/mtree
220.if ${MK_PPP} != "no"
221	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
222	    ${PPPCNF} ${DESTDIR}/etc/ppp
223.endif
224.if ${MK_MAIL} != "no"
225	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
226	    ${ETCMAIL} ${DESTDIR}/etc/mail
227	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
228	      ! -f ${DESTDIR}/etc/aliases ]; then \
229		set -x; \
230		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
231	fi
232.endif
233	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
234	    ${DESTDIR}/etc/dumpdates
235	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
236	    ${DESTDIR}/var/db/locate.database
237	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
238	    ${DESTDIR}/var/crash
239	cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
240		${FREEBSD} ${DESTDIR}/
241.if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
242	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
243	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
244	    ${DESTDIR}/boot/device.hints
245.endif
246
247distrib-dirs:
248	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
249	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
250	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
251	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
252		-p ${DESTDIR}/usr/include
253.if ${MK_BIND_LIBS} != "no"
254	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
255	    -p ${DESTDIR}/usr/include
256.endif
257.if ${MK_BIND_MTREE} != "no"
258	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
259	    -p ${DESTDIR}/var/named
260.endif
261.if ${MK_SENDMAIL} != "no"
262	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
263.endif
264	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
265	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
266	cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* .
267	cd ${DESTDIR}/usr/share/man; \
268	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
269	while [ $$# -gt 0 ] ; \
270	do \
271		rm -rf "$$1"; \
272		ln -s "$$2" "$$1"; \
273		shift; shift; \
274	done
275	cd ${DESTDIR}/usr/share/openssl/man; \
276	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
277	while [ $$# -gt 0 ] ; \
278	do \
279		rm -rf "$$1"; \
280		ln -s "$$2" "$$1"; \
281		shift; shift; \
282	done
283	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
284	cd ${DESTDIR}/usr/share/nls; \
285	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
286	while [ $$# -gt 0 ] ; \
287	do \
288		rm -rf "$$1"; \
289		ln -s "$$2" "$$1"; \
290		shift; shift; \
291	done
292
293etc-examples:
294	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
295	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
296	    ${DESTDIR}/usr/share/examples/etc
297	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
298	    DESTDIR=${DESTDIR}/usr/share/examples
299
300.include <bsd.prog.mk>
301