Makefile revision 156813
1#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
2# $FreeBSD: head/etc/Makefile 156813 2006-03-17 18:54:44Z ru $
3
4.include <bsd.own.mk>
5
6.if ${MK_SENDMAIL} != "no"
7SUBDIR=	sendmail
8.endif
9
10BIN1=	amd.map apmd.conf auth.conf \
11	crontab csh.cshrc csh.login csh.logout devd.conf devfs.conf \
12	dhclient.conf disktab fbtab ftpusers gettytab group \
13	hosts hosts.allow hosts.equiv hosts.lpd \
14	inetd.conf login.access login.conf \
15	mac.conf motd netconfig network.subr networks newsyslog.conf \
16	portsnap.conf pf.conf pf.os phones profile protocols \
17	rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
18	rc.sendmail rc.shutdown \
19	rc.subr remote rpc services shells \
20	snmpd.config sysctl.conf syslog.conf \
21	etc.${MACHINE_ARCH}/ttys \
22	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
23	${.CURDIR}/../usr.bin/mail/misc/mail.rc \
24	${.CURDIR}/../usr.bin/locate/locate/locate.rc
25
26OPENBSMDIR=			${.CURDIR}/../contrib/openbsm
27BSM_ETC_OPEN_FILES=		${OPENBSMDIR}/etc/audit_class \
28				${OPENBSMDIR}/etc/audit_event
29BSM_ETC_RESTRICTED_FILES=	${OPENBSMDIR}/etc/audit_control \
30				${OPENBSMDIR}/etc/audit_user
31BSM_ETC_EXEC_FILES=		${OPENBSMDIR}/etc/audit_warn
32BSM_ETC_DIR=			${DESTDIR}/etc/security
33
34.if ${MK_LPR} != "no"
35BIN1+=	printcap
36.endif
37
38.if ${MK_OPENSSH} != "no"
39SSH=	${.CURDIR}/../crypto/openssh/ssh_config \
40	${.CURDIR}/../crypto/openssh/sshd_config \
41	${.CURDIR}/../crypto/openssh/moduli
42.endif
43.if ${MK_OPENSSL} != "no"
44SSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
45.endif
46
47# -rwxr-xr-x root:wheel, for the new cron root:wheel
48BIN2=	netstart pccard_ether rc.suspend rc.resume
49
50MTREE=	BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
51	BSD.var.dist BSD.x11.dist BSD.x11-4.dist
52.if ${MK_SENDMAIL} != "no"
53MTREE+=	BSD.sendmail.dist
54.endif
55.if ${MK_BIND} != "no"
56MTREE+=	BIND.chroot.dist
57.if ${MK_BIND_LIBS} != "no"
58MTREE+=	BIND.include.dist
59.endif
60.endif
61
62.if ${MK_BIND_ETC} != "no"
63NAMEDB=	PROTO.localhost.rev PROTO.localhost-v6.rev named.conf named.root \
64	make-localhost
65.endif
66
67PPPCNF=	ppp.conf
68
69.if ${MK_SENDMAIL} == "no"
70ETCMAIL=mailer.conf aliases
71.else
72ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
73	mailertable.sample aliases
74.endif
75
76# Special top level files for FreeBSD
77FREEBSD=COPYRIGHT
78
79afterinstall:
80.if ${MK_MAN} != "no"
81	cd ${.CURDIR}/../share/man; ${MAKE} makedb
82.endif
83
84distribute:
85	cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
86	cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
87
88.include <bsd.endian.mk>
89.if ${TARGET_ENDIANNESS} == "1234"
90CAP_MKDB_ENDIAN?= -l
91PWD_MKDB_ENDIAN?= -L
92.elif ${TARGET_ENDIANNESS} == "4321"
93CAP_MKDB_ENDIAN?= -b
94PWD_MKDB_ENDIAN?= -B
95.else
96CAP_MKDB_ENDIAN?=
97PWD_MKDB_ENDIAN?=
98.endif
99
100distribution:
101.if !defined(DESTDIR)
102	@echo "set DESTDIR before running \"make ${.TARGET}\""
103	@false
104.endif
105	cd ${.CURDIR}; \
106	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
107		${BIN1} ${DESTDIR}/etc; \
108	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
109	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
110		${BIN2} ${DESTDIR}/etc; \
111	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
112		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
113	    pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
114		${DESTDIR}/etc/master.passwd
115	cd ${.CURDIR}/bluetooth; ${MAKE} install
116	cd ${.CURDIR}/defaults; ${MAKE} install
117	cd ${.CURDIR}/gss; ${MAKE} install
118	cd ${.CURDIR}/periodic; ${MAKE} install
119	cd ${.CURDIR}/rc.d; ${MAKE} install
120	cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
121	cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
122	cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
123	cd ${.CURDIR}/pam.d; ${MAKE} install
124	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
125	    ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
126	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
127	    ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
128	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
129	    ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
130.if ${MK_I4B} != "no"
131	cd ${.CURDIR}/isdn; ${MAKE} install
132.endif
133.if ${MK_SENDMAIL} != "no"
134	cd ${.CURDIR}/sendmail; ${MAKE} distribution
135.endif
136.if ${MK_OPENSSH} != "no"
137	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
138	    ${SSH} ${DESTDIR}/etc/ssh
139.endif
140.if ${MK_OPENSSL} != "no"
141	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
142	    ${SSL} ${DESTDIR}/etc/ssl
143.endif
144.if ${MK_KERBEROS} != "no"
145	cd ${.CURDIR}/root; \
146	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
147		dot.k5login ${DESTDIR}/root/.k5login;
148.endif
149	cd ${.CURDIR}/root; \
150	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
151		dot.cshrc ${DESTDIR}/root/.cshrc; \
152	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
153		dot.login ${DESTDIR}/root/.login; \
154	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
155		dot.profile ${DESTDIR}/root/.profile; \
156	    rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
157	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
158	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
159	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
160	    ${MTREE} ${DESTDIR}/etc/mtree
161.if ${MK_BIND_ETC} != "no"
162	cd ${.CURDIR}/namedb; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
163	    ${NAMEDB} ${DESTDIR}/var/named/etc/namedb
164.endif
165.if ${MK_BIND_MTREE} != "no"
166	@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
167		set -x; \
168		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
169	fi
170.endif
171	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
172	    ${PPPCNF} ${DESTDIR}/etc/ppp
173	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
174	    ${ETCMAIL} ${DESTDIR}/etc/mail
175	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
176	      ! -f ${DESTDIR}/etc/aliases ]; then \
177		set -x; \
178		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
179	fi
180	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
181	    ${DESTDIR}/etc/dumpdates
182	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
183	    ${DESTDIR}/var/db/locate.database
184	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
185	    ${DESTDIR}/var/crash
186	cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
187		${FREEBSD} ${DESTDIR}/
188	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
189	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
190	    ${DESTDIR}/boot/device.hints
191
192distrib-dirs:
193	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
194	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
195	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
196	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
197		-p ${DESTDIR}/usr/include
198.if ${MK_BIND_LIBS} != "no"
199	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
200	    -p ${DESTDIR}/usr/include
201.endif
202.if ${MK_BIND_MTREE} != "no"
203	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
204	    -p ${DESTDIR}/var/named
205.endif
206.if ${MK_SENDMAIL} != "no"
207	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
208.endif
209	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
210	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
211	cd ${DESTDIR}/usr/share/man; \
212	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
213	while [ $$# -gt 0 ] ; \
214	do \
215		rm -rf "$$1"; \
216		ln -s "$$2" "$$1"; \
217		shift; shift; \
218	done
219	cd ${DESTDIR}/usr/share/openssl/man; \
220	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
221	while [ $$# -gt 0 ] ; \
222	do \
223		rm -rf "$$1"; \
224		ln -s "$$2" "$$1"; \
225		shift; shift; \
226	done
227	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
228	cd ${DESTDIR}/usr/share/nls; \
229	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
230	while [ $$# -gt 0 ] ; \
231	do \
232		rm -rf "$$1"; \
233		ln -s "$$2" "$$1"; \
234		shift; shift; \
235	done
236
237etc-examples:
238	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
239	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
240	    ${DESTDIR}/usr/share/examples/etc
241	cd ${.CURDIR}/defaults; ${MAKE} install \
242	    DESTDIR=${DESTDIR}/usr/share/examples
243
244.include <bsd.prog.mk>
245