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