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