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