Makefile revision 196767
1#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
2# $FreeBSD: head/etc/Makefile 196767 2009-09-02 14:54:47Z flz $
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_NTP} != "no"
67BIN1+=	ntp.conf
68.endif
69
70.if ${MK_OPENSSH} != "no"
71SSH=	${.CURDIR}/../crypto/openssh/ssh_config \
72	${.CURDIR}/../crypto/openssh/sshd_config \
73	${.CURDIR}/../crypto/openssh/moduli
74.endif
75.if ${MK_OPENSSL} != "no"
76SSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
77.endif
78
79.if ${MK_NS_CACHING} != "no"
80BIN1+= nscd.conf
81.endif
82
83.if ${MK_PORTSNAP} != "no"
84BIN1+= portsnap.conf
85.endif
86
87.if ${MK_PF} != "no"
88BIN1+= pf.os
89.endif
90
91.if ${MK_TCSH} != "no"
92BIN1+= csh.cshrc csh.login csh.logout
93.endif
94
95.if ${MK_WIRELESS} != "no"
96BIN1+= regdomain.xml
97.endif
98
99# -rwxr-xr-x root:wheel, for the new cron root:wheel
100BIN2=	netstart pccard_ether rc.suspend rc.resume
101
102MTREE=	BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
103.if ${MK_SENDMAIL} != "no"
104MTREE+=	BSD.sendmail.dist
105.endif
106.if ${MK_BIND} != "no"
107MTREE+=	BIND.chroot.dist
108.if ${MK_BIND_LIBS} != "no"
109MTREE+=	BIND.include.dist
110.endif
111.endif
112
113PPPCNF=	ppp.conf
114
115.if ${MK_SENDMAIL} == "no"
116ETCMAIL=mailer.conf aliases
117.else
118ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
119	mailertable.sample aliases
120.endif
121
122# Special top level files for FreeBSD
123FREEBSD=COPYRIGHT
124
125afterinstall:
126.if ${MK_MAN} != "no"
127	${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
128.endif
129
130distribute:
131	${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
132	${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
133
134.include <bsd.endian.mk>
135.if ${TARGET_ENDIANNESS} == "1234"
136CAP_MKDB_ENDIAN?= -l
137PWD_MKDB_ENDIAN?= -L
138.elif ${TARGET_ENDIANNESS} == "4321"
139CAP_MKDB_ENDIAN?= -b
140PWD_MKDB_ENDIAN?= -B
141.else
142CAP_MKDB_ENDIAN?=
143PWD_MKDB_ENDIAN?=
144.endif
145
146distribution:
147.if !defined(DESTDIR)
148	@echo "set DESTDIR before running \"make ${.TARGET}\""
149	@false
150.endif
151	cd ${.CURDIR}; \
152	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
153		${BIN1} ${DESTDIR}/etc; \
154	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
155	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
156		${BIN2} ${DESTDIR}/etc; \
157	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
158		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
159.if ${MK_TCSH} == "no"
160	sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
161.endif
162	pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
163	    ${DESTDIR}/etc/master.passwd
164.if ${MK_BLUETOOTH} != "no"
165	${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
166.endif
167	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
168	${_+_}cd ${.CURDIR}/devd; ${MAKE} install
169	${_+_}cd ${.CURDIR}/gss; ${MAKE} install
170	${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
171	${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
172	${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
173	${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
174	${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
175	${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
176	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
177	    ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
178	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
179	    ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
180	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
181	    ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
182.if ${MK_BIND_MTREE} != "no"
183	@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
184		set -x; \
185		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
186	fi
187.endif
188.if ${MK_BIND_ETC} != "no"
189	${_+_}cd ${.CURDIR}/namedb; ${MAKE} install
190.endif
191.if ${MK_SENDMAIL} != "no"
192	${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
193.endif
194.if ${MK_OPENSSH} != "no"
195	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
196	    ${SSH} ${DESTDIR}/etc/ssh
197.endif
198.if ${MK_OPENSSL} != "no"
199	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
200	    ${SSL} ${DESTDIR}/etc/ssl
201.endif
202.if ${MK_KERBEROS} != "no"
203	cd ${.CURDIR}/root; \
204	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
205		dot.k5login ${DESTDIR}/root/.k5login;
206.endif
207	cd ${.CURDIR}/root; \
208	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
209		dot.profile ${DESTDIR}/root/.profile; \
210	    rm -f ${DESTDIR}/.profile; \
211	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
212.if ${MK_TCSH} != "no"
213	cd ${.CURDIR}/root; \
214	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
215		dot.cshrc ${DESTDIR}/root/.cshrc; \
216	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
217		dot.login ${DESTDIR}/root/.login; \
218	    rm -f ${DESTDIR}/.cshrc; \
219	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
220.endif
221	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
222	    ${MTREE} ${DESTDIR}/etc/mtree
223.if ${MK_PPP} != "no"
224	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
225	    ${PPPCNF} ${DESTDIR}/etc/ppp
226.endif
227.if ${MK_MAIL} != "no"
228	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
229	    ${ETCMAIL} ${DESTDIR}/etc/mail
230	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
231	      ! -f ${DESTDIR}/etc/aliases ]; then \
232		set -x; \
233		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
234	fi
235.endif
236	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
237	    ${DESTDIR}/etc/dumpdates
238	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
239	    ${DESTDIR}/var/db/locate.database
240	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
241	    ${DESTDIR}/var/crash
242	cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
243		${FREEBSD} ${DESTDIR}/
244.if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
245	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
246	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
247	    ${DESTDIR}/boot/device.hints
248.endif
249
250distrib-dirs:
251	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
252	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
253	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
254	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
255		-p ${DESTDIR}/usr/include
256.if ${MK_BIND_LIBS} != "no"
257	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
258	    -p ${DESTDIR}/usr/include
259.endif
260.if ${MK_BIND_MTREE} != "no"
261	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
262	    -p ${DESTDIR}/var/named
263.endif
264.if ${MK_SENDMAIL} != "no"
265	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
266.endif
267	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
268	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
269	cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* .
270	cd ${DESTDIR}/usr/share/man; \
271	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
272	while [ $$# -gt 0 ] ; \
273	do \
274		rm -rf "$$1"; \
275		ln -s "$$2" "$$1"; \
276		shift; shift; \
277	done
278	cd ${DESTDIR}/usr/share/openssl/man; \
279	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
280	while [ $$# -gt 0 ] ; \
281	do \
282		rm -rf "$$1"; \
283		ln -s "$$2" "$$1"; \
284		shift; shift; \
285	done
286	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
287	cd ${DESTDIR}/usr/share/nls; \
288	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
289	while [ $$# -gt 0 ] ; \
290	do \
291		rm -rf "$$1"; \
292		ln -s "$$2" "$$1"; \
293		shift; shift; \
294	done
295
296etc-examples:
297	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
298	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
299	    ${DESTDIR}/usr/share/examples/etc
300	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
301	    DESTDIR=${DESTDIR}/usr/share/examples
302
303.include <bsd.prog.mk>
304