Makefile revision 243101
1#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
2# $FreeBSD: head/etc/Makefile 243101 2012-11-15 20:37:38Z eadler $
3
4.include <bsd.own.mk>
5
6.if ${MK_SENDMAIL} != "no"
7SUBDIR=	sendmail
8.endif
9
10BIN1=	crontab \
11	devd.conf \
12	devfs.conf \
13	ddb.conf \
14	dhclient.conf \
15	disktab \
16	fbtab \
17	ftpusers \
18	gettytab \
19	group \
20	hosts \
21	hosts.allow \
22	hosts.equiv \
23	inetd.conf \
24	libalias.conf \
25	login.access \
26	login.conf \
27	mac.conf \
28	motd \
29	netconfig \
30	network.subr \
31	networks \
32	newsyslog.conf \
33	nsswitch.conf \
34	phones \
35	profile \
36	protocols \
37	rc \
38	rc.bsdextended \
39	rc.firewall \
40	rc.initdiskless \
41	rc.sendmail \
42	rc.shutdown \
43	rc.subr \
44	remote \
45	rpc \
46	services \
47	shells \
48	sysctl.conf \
49	syslog.conf \
50	termcap.small
51
52.if exists(${.CURDIR}/etc.${MACHINE}/ttys)
53BIN1+=	etc.${MACHINE}/ttys
54.elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
55BIN1+=	etc.${MACHINE_ARCH}/ttys
56.elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
57BIN1+=	etc.${MACHINE_CPUARCH}/ttys
58.else
59.error etc.MACHINE/ttys missing
60.endif
61
62OPENBSMDIR=			${.CURDIR}/../contrib/openbsm
63BSM_ETC_OPEN_FILES=		${OPENBSMDIR}/etc/audit_class \
64				${OPENBSMDIR}/etc/audit_event
65BSM_ETC_RESTRICTED_FILES=	${OPENBSMDIR}/etc/audit_control \
66				${OPENBSMDIR}/etc/audit_user
67BSM_ETC_EXEC_FILES=		${OPENBSMDIR}/etc/audit_warn
68BSM_ETC_DIR=			${DESTDIR}/etc/security
69
70# NB: keep these sorted by MK_* knobs
71
72.if ${MK_AMD} != "no"
73BIN1+= amd.map
74.endif
75
76.if ${MK_APM} != "no"
77BIN1+= apmd.conf
78.endif
79
80.if ${MK_BSNMP} != "no"
81BIN1+= snmpd.config
82.endif
83
84.if ${MK_FREEBSD_UPDATE} != "no"
85BIN1+= freebsd-update.conf
86.endif
87
88.if ${MK_LOCATE} != "no"
89BIN1+=	${.CURDIR}/../usr.bin/locate/locate/locate.rc
90.endif
91
92.if ${MK_LPR} != "no"
93BIN1+=	hosts.lpd printcap
94.endif
95
96.if ${MK_MAIL} != "no"
97BIN1+=	${.CURDIR}/../usr.bin/mail/misc/mail.rc
98.endif
99
100.if ${MK_NTP} != "no"
101BIN1+=	ntp.conf
102.endif
103
104.if ${MK_OPENSSH} != "no"
105SSH=	${.CURDIR}/../crypto/openssh/ssh_config \
106	${.CURDIR}/../crypto/openssh/sshd_config \
107	${.CURDIR}/../crypto/openssh/moduli
108.endif
109.if ${MK_OPENSSL} != "no"
110SSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
111.endif
112
113.if ${MK_NS_CACHING} != "no"
114BIN1+= nscd.conf
115.endif
116
117.if ${MK_PORTSNAP} != "no"
118BIN1+= portsnap.conf
119.endif
120
121.if ${MK_PF} != "no"
122BIN1+= pf.os
123.endif
124
125.if ${MK_TCSH} != "no"
126BIN1+= csh.cshrc csh.login csh.logout
127.endif
128
129.if ${MK_WIRELESS} != "no"
130BIN1+= regdomain.xml
131.endif
132
133# -rwxr-xr-x root:wheel, for the new cron root:wheel
134BIN2=	netstart pccard_ether rc.suspend rc.resume
135
136MTREE=	BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
137.if ${MK_SENDMAIL} != "no"
138MTREE+=	BSD.sendmail.dist
139.endif
140.if ${MK_BIND} != "no"
141MTREE+=	BIND.chroot.dist
142.if ${MK_BIND_LIBS} != "no"
143MTREE+=	BIND.include.dist
144.endif
145.endif
146
147PPPCNF=	ppp.conf
148
149.if ${MK_SENDMAIL} == "no"
150ETCMAIL=mailer.conf aliases
151.else
152ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
153	mailertable.sample aliases
154.endif
155
156# Special top level files for FreeBSD
157FREEBSD=COPYRIGHT
158
159afterinstall:
160.if ${MK_MAN} != "no"
161	${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
162.endif
163
164distribute:
165	${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
166	${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
167
168.include <bsd.endian.mk>
169.if ${TARGET_ENDIANNESS} == "1234"
170CAP_MKDB_ENDIAN?= -l
171PWD_MKDB_ENDIAN?= -L
172.elif ${TARGET_ENDIANNESS} == "4321"
173CAP_MKDB_ENDIAN?= -b
174PWD_MKDB_ENDIAN?= -B
175.else
176CAP_MKDB_ENDIAN?=
177PWD_MKDB_ENDIAN?=
178.endif
179
180distribution:
181.if !defined(DESTDIR)
182	@echo "set DESTDIR before running \"make ${.TARGET}\""
183	@false
184.endif
185	cd ${.CURDIR}; \
186	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
187		${BIN1} ${DESTDIR}/etc; \
188	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
189	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
190		${BIN2} ${DESTDIR}/etc; \
191	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
192		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
193.if ${MK_AT} == "no"
194	sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
195.endif
196.if ${MK_TCSH} == "no"
197	sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
198.endif
199	pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
200	    ${DESTDIR}/etc/master.passwd
201.if ${MK_ATF} != "no"
202	${_+_}cd ${.CURDIR}/atf; ${MAKE} install
203.endif
204.if ${MK_BLUETOOTH} != "no"
205	${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
206.endif
207	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
208	${_+_}cd ${.CURDIR}/devd; ${MAKE} install
209	${_+_}cd ${.CURDIR}/gss; ${MAKE} install
210	${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
211	${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
212	${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
213	${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
214	${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
215	${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
216	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
217	    ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
218	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
219	    ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
220	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
221	    ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
222.if ${MK_BIND_MTREE} != "no"
223	if [ ! -e ${DESTDIR}/etc/namedb ]; then \
224		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
225	fi
226.endif
227.if ${MK_BIND_ETC} != "no"
228	${_+_}cd ${.CURDIR}/namedb; ${MAKE} install
229.endif
230.if ${MK_SENDMAIL} != "no"
231	${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
232.endif
233.if ${MK_OPENSSH} != "no"
234	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
235	    ${SSH} ${DESTDIR}/etc/ssh
236.endif
237.if ${MK_OPENSSL} != "no"
238	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
239	    ${SSL} ${DESTDIR}/etc/ssl
240.endif
241.if ${MK_KERBEROS} != "no"
242	cd ${.CURDIR}/root; \
243	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
244		dot.k5login ${DESTDIR}/root/.k5login;
245.endif
246	cd ${.CURDIR}/root; \
247	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
248		dot.profile ${DESTDIR}/root/.profile; \
249	    rm -f ${DESTDIR}/.profile; \
250	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
251.if ${MK_TCSH} != "no"
252	cd ${.CURDIR}/root; \
253	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
254		dot.cshrc ${DESTDIR}/root/.cshrc; \
255	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
256		dot.login ${DESTDIR}/root/.login; \
257	    rm -f ${DESTDIR}/.cshrc; \
258	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
259.endif
260	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
261	    ${MTREE} ${DESTDIR}/etc/mtree
262.if ${MK_PPP} != "no"
263	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
264	    ${PPPCNF} ${DESTDIR}/etc/ppp
265.endif
266.if ${MK_MAIL} != "no"
267	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
268	    ${ETCMAIL} ${DESTDIR}/etc/mail
269	if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
270	      ! -f ${DESTDIR}/etc/aliases ]; then \
271		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
272	fi
273.endif
274	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
275	    ${DESTDIR}/etc/dumpdates
276	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
277	    ${DESTDIR}/var/db/locate.database
278	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
279	    ${DESTDIR}/var/crash
280	cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
281		${FREEBSD} ${DESTDIR}/
282.if ${MK_BOOT} != "no"
283.if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
284	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
285	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
286	    ${DESTDIR}/boot/device.hints
287.endif
288.endif
289.if ${MK_NIS} == "no"
290	sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
291		${DESTDIR}/etc/nsswitch.conf
292.endif
293
294distrib-dirs:
295	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
296	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
297	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
298	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
299		-p ${DESTDIR}/usr/include
300.if ${MK_BIND_LIBS} != "no"
301	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
302	    -p ${DESTDIR}/usr/include
303.endif
304.if ${MK_BIND_MTREE} != "no"
305	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
306	    -p ${DESTDIR}/var/named
307.endif
308.if ${MK_GROFF} != "no"
309	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.groff.dist -p ${DESTDIR}/usr
310.endif
311.if ${MK_SENDMAIL} != "no"
312	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
313.endif
314	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
315	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
316	cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* .
317	cd ${DESTDIR}/usr/share/man; \
318	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
319	while [ $$# -gt 0 ] ; \
320	do \
321		rm -rf "$$1"; \
322		ln -s "$$2" "$$1"; \
323		shift; shift; \
324	done
325	cd ${DESTDIR}/usr/share/openssl/man; \
326	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
327	while [ $$# -gt 0 ] ; \
328	do \
329		rm -rf "$$1"; \
330		ln -s "$$2" "$$1"; \
331		shift; shift; \
332	done
333	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
334	cd ${DESTDIR}/usr/share/nls; \
335	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
336	while [ $$# -gt 0 ] ; \
337	do \
338		rm -rf "$$1"; \
339		ln -s "$$2" "$$1"; \
340		shift; shift; \
341	done
342
343etc-examples:
344	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
345	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
346	    ${DESTDIR}/usr/share/examples/etc
347	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
348	    DESTDIR=${DESTDIR}/usr/share/examples
349
350.include <bsd.prog.mk>
351