Makefile revision 142838
1#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
2# $FreeBSD: head/etc/Makefile 142838 2005-02-28 22:55:43Z ru $
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	pf.conf pf.os phones profile protocols \
15	rc rc.firewall rc.firewall6 rc.sendmail rc.shutdown \
16	rc.subr remote rpc services \
17	shells sysctl.conf syslog.conf usbd.conf \
18	etc.${MACHINE_ARCH}/ttys \
19	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
20	${.CURDIR}/../usr.bin/mail/misc/mail.rc \
21	${.CURDIR}/../usr.bin/locate/locate/locate.rc
22.if !defined(NO_LPR)
23BIN1+=	printcap
24.endif
25
26.if !defined(NO_CRYPT) && !defined(NO_OPENSSL)
27.if !defined(NO_OPENSSH)
28SSH=	${.CURDIR}/../crypto/openssh/ssh_config \
29	${.CURDIR}/../crypto/openssh/sshd_config \
30	${.CURDIR}/../crypto/openssh/moduli
31.endif
32SSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
33.endif
34
35# -rwxr-xr-x root:wheel, for the new cron root:wheel
36BIN2=	netstart pccard_ether rc.suspend rc.resume
37
38MTREE=	BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
39	BSD.var.dist BSD.x11.dist BSD.x11-4.dist
40.if !defined(NO_SENDMAIL)
41MTREE+=	BSD.sendmail.dist
42.endif
43.if !defined(NO_BIND)
44MTREE+=	BIND.chroot.dist
45.if defined(WITH_BIND_LIBS)
46MTREE+=	BIND.include.dist
47.endif
48.endif
49
50.if !defined(NO_BIND_ETC) && !defined(NO_BIND)
51NAMEDB=	PROTO.localhost.rev PROTO.localhost-v6.rev named.conf named.root \
52	make-localhost
53.endif
54
55PPPCNF=	ppp.conf
56
57.if defined(NO_SENDMAIL)
58ETCMAIL=mailer.conf aliases
59.else
60ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
61	mailertable.sample aliases
62.endif
63
64# Special top level files for FreeBSD
65FREEBSD=COPYRIGHT
66
67afterinstall:
68.if !defined(NO_MAN)
69	cd ${.CURDIR}/../share/man; ${MAKE} makedb
70.endif
71
72distribute:
73	cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
74	cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
75
76.include <bsd.endian.mk>
77.if ${TARGET_ENDIANNESS} == "1234"
78CAP_MKDB_ENDIAN= -l
79PWD_MKDB_ENDIAN= -L
80.elif ${TARGET_ENDIANNESS} == "4321"
81CAP_MKDB_ENDIAN= -b
82PWD_MKDB_ENDIAN= -B
83.else
84CAP_MKDB_ENDIAN=
85.endif
86
87distribution:
88	cd ${.CURDIR}; \
89	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
90		${BIN1} ${DESTDIR}/etc; \
91	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
92	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
93		${BIN2} ${DESTDIR}/etc; \
94	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
95		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
96	    pwd_mkdb ${PWD_MKDB_ENDIAN} -p -d ${DESTDIR}/etc \
97		${DESTDIR}/etc/master.passwd
98	cd ${.CURDIR}/bluetooth; ${MAKE} install
99	cd ${.CURDIR}/defaults; ${MAKE} install
100	cd ${.CURDIR}/periodic; ${MAKE} install
101	cd ${.CURDIR}/rc.d; ${MAKE} install
102	cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
103	cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
104	cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
105	cd ${.CURDIR}/pam.d; ${MAKE} install
106.if !defined(NO_I4B)
107	cd ${.CURDIR}/isdn; ${MAKE} install
108.endif
109.if !defined(NO_SENDMAIL)
110	cd ${.CURDIR}/sendmail; ${MAKE} distribution
111.endif
112.if !defined(NO_OPENSSL)
113.if !defined(NO_OPENSSH)
114	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
115	    ${SSH} ${DESTDIR}/etc/ssh
116.endif
117	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
118	    ${SSL} ${DESTDIR}/etc/ssl
119.endif
120.if !defined(NO_KERBEROS)
121	cd ${.CURDIR}/root; \
122	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
123		dot.k5login ${DESTDIR}/root/.k5login;
124.endif
125	cd ${.CURDIR}/root; \
126	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
127		dot.cshrc ${DESTDIR}/root/.cshrc; \
128	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
129		dot.login ${DESTDIR}/root/.login; \
130	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
131		dot.profile ${DESTDIR}/root/.profile; \
132	    rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
133	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
134	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
135	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
136	    ${MTREE} ${DESTDIR}/etc/mtree
137.if !defined(NO_BIND)
138.if !defined(NO_BIND_ETC)
139	cd ${.CURDIR}/namedb; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
140	    ${NAMEDB} ${DESTDIR}/var/named/etc/namedb
141.endif
142.if !defined(NO_BIND_MTREE)
143	@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
144		set -x; \
145		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
146	fi
147.endif
148.endif
149	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
150	    ${PPPCNF} ${DESTDIR}/etc/ppp
151	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
152	    ${ETCMAIL} ${DESTDIR}/etc/mail
153	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
154	      ! -f ${DESTDIR}/etc/aliases ]; then \
155		set -x; \
156		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
157	fi
158	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
159	    ${DESTDIR}/etc/dumpdates
160	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
161	    ${DESTDIR}/var/db/locate.database
162	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
163	    ${DESTDIR}/var/log/auth.log
164	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
165	    ${DESTDIR}/var/log/cron
166	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
167	    ${DESTDIR}/var/log/debug.log
168	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
169	    ${DESTDIR}/var/log/xferlog
170	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
171	    ${DESTDIR}/var/log/lpd-errs
172	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
173	    ${DESTDIR}/var/log/maillog
174	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
175	    ${DESTDIR}/var/log/lastlog
176	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
177	    ${DESTDIR}/var/log/messages
178	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
179	    ${DESTDIR}/var/log/security
180	${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
181	    ${DESTDIR}/var/log/slip.log
182	${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
183	    ${DESTDIR}/var/log/ppp.log
184	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
185	    ${DESTDIR}/var/log/wtmp
186	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
187	    ${DESTDIR}/var/run/utmp
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 !defined(NO_BIND)
203.if defined(WITH_BIND_LIBS)
204	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
205	    -p ${DESTDIR}/usr/include
206.endif
207.if !defined(NO_BIND_MTREE)
208	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
209	    -p ${DESTDIR}/var/named
210.endif
211.endif
212.if !defined(NO_SENDMAIL)
213	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
214.endif
215	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
216	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
217	cd ${DESTDIR}/usr/share/man; \
218	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
219	while [ $$# -gt 0 ] ; \
220	do \
221		rm -rf "$$1"; \
222		ln -s "$$2" "$$1"; \
223		shift; shift; \
224	done
225	cd ${DESTDIR}/usr/share/openssl/man; \
226	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
227	while [ $$# -gt 0 ] ; \
228	do \
229		rm -rf "$$1"; \
230		ln -s "$$2" "$$1"; \
231		shift; shift; \
232	done
233	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
234	cd ${DESTDIR}/usr/share/nls; \
235	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
236	while [ $$# -gt 0 ] ; \
237	do \
238		rm -rf "$$1"; \
239		ln -s "$$2" "$$1"; \
240		shift; shift; \
241	done
242
243etc-examples:
244	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
245	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
246	    ${DESTDIR}/usr/share/examples/etc
247	cd ${.CURDIR}/defaults; ${MAKE} install \
248	    DESTDIR=${DESTDIR}/usr/share/examples
249
250.include <bsd.prog.mk>
251