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