Makefile revision 99449
1#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
2# $FreeBSD: head/etc/Makefile 99449 2002-07-05 13:17:24Z 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 \
10	dhclient.conf dm.conf fbtab ftpusers gettytab group \
11	hosts hosts.allow hosts.equiv hosts.lpd \
12	inetd.conf login.access login.conf \
13	motd modems netconfig networks newsyslog.conf \
14	phones printcap profile protocols \
15	rc rc.atm rc.devfs rc.diskless1 rc.diskless2 rc.firewall rc.firewall6 \
16	rc.network rc.network6 rc.pccard rc.sendmail rc.serial rc.shutdown \
17	rc.subr rc.syscons rc.sysctl remote rpc services \
18	shells sysctl.conf syslog.conf usbd.conf \
19	etc.${MACHINE_ARCH}/disktab \
20	etc.${MACHINE_ARCH}/rc.${MACHINE_ARCH} \
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
26.if !defined(NO_I4B)
27BIN1+=	rc.isdn
28.endif
29
30.if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
31.if !defined(NO_OPENSSH)
32SSH=	${.CURDIR}/../crypto/openssh/ssh_config \
33	${.CURDIR}/../crypto/openssh/sshd_config \
34	moduli
35.endif
36SSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
37.endif
38
39# -rwxr-xr-x root:wheel, for the new cron root:wheel
40BIN2=	netstart pccard_ether rc.suspend rc.resume
41
42DEFAULTS= rc.conf pccard.conf periodic.conf
43
44MTREE=	BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
45	BSD.var.dist BSD.x11.dist BSD.x11-4.dist
46.if !defined(NO_SENDMAIL)
47MTREE+=	BSD.sendmail.dist
48.endif
49NAMEDB= PROTO.localhost.rev PROTO.localhost-v6.rev named.conf named.root \
50	make-localhost
51PPPCNF= ppp.conf
52ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
53	mailertable.sample aliases
54
55
56# Special top level files for FreeBSD
57FREEBSD=COPYRIGHT
58
59etc:
60
61distribute:
62	cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
63.if defined(OBJFORMAT)
64	echo OBJFORMAT=${OBJFORMAT} > ${DISTDIR}/${DISTRIBUTION}/etc/objformat
65.endif
66	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
67	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
68	    ${DISTDIR}/${DISTRIBUTION}/boot/device.hints
69
70distribution:
71	cd ${.CURDIR}; \
72	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc; \
73	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 755 ${BIN2} ${DESTDIR}/etc; \
74	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 \
75	    master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
76	pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
77	cd ${.CURDIR}/defaults; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \
78	    ${DEFAULTS} ${DESTDIR}/etc/defaults
79	cd ${.CURDIR}/periodic; ${MAKE} install
80	cd ${.CURDIR}/rc.d; ${MAKE} install
81	cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
82	cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
83	cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
84	cd ${.CURDIR}/pam.d; ${MAKE} install
85.if !defined(NO_I4B)
86	cd ${.CURDIR}/isdn; ${MAKE} install
87.endif
88.if !defined(NO_SENDMAIL)
89	cd ${.CURDIR}/sendmail; ${MAKE} distribution
90.endif
91.if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
92.if !defined(NO_OPENSSH)
93	cd ${.CURDIR}; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${SSH} \
94	    ${DESTDIR}/etc/ssh
95.endif
96	cd ${.CURDIR}; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${SSL} \
97	    ${DESTDIR}/etc/ssl
98.endif
99.if !defined(NO_MAKEDEV_INSTALL)
100	cd ${.CURDIR}; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
101	     MAKEDEV.local MAKEDEV ${DESTDIR}/dev
102.if !defined(NO_MAKEDEV_RUN)
103	cd ${DESTDIR}/dev; sh MAKEDEV all
104.endif
105.endif
106	cd ${.CURDIR}/root; \
107		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.cshrc \
108		    ${DESTDIR}/root/.cshrc; \
109		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.klogin \
110		    ${DESTDIR}/root/.klogin; \
111		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.login \
112		    ${DESTDIR}/root/.login; \
113		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.profile \
114		    ${DESTDIR}/root/.profile; \
115		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
116		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
117		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
118	cd ${.CURDIR}/mtree; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
119	    ${MTREE} ${DESTDIR}/etc/mtree
120	cd ${.CURDIR}/namedb; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \
121	    ${NAMEDB} ${DESTDIR}/etc/namedb
122	cd ${.CURDIR}/ppp; ${INSTALL} -c -o root -g ${BINGRP} -m 600 \
123	    ${PPPCNF} ${DESTDIR}/etc/ppp
124	cd ${.CURDIR}/mail; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \
125	    ${ETCMAIL} ${DESTDIR}/etc/mail
126	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
127	      ! -f ${DESTDIR}/etc/aliases ]; then \
128		set -x; \
129		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
130	fi
131	${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \
132	    ${DESTDIR}/etc/dumpdates
133	${INSTALL} -c -o nobody -g ${BINGRP} -m 644 /dev/null \
134	    ${DESTDIR}/var/db/locate.database
135	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
136	    ${DESTDIR}/var/log/auth.log
137	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
138	    ${DESTDIR}/var/log/cron
139	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
140	    ${DESTDIR}/var/log/lpd-errs
141	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
142	    ${DESTDIR}/var/log/maillog
143	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
144	    ${DESTDIR}/var/log/lastlog
145	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
146	    ${DESTDIR}/var/log/messages
147	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
148	    ${DESTDIR}/var/log/security
149	${INSTALL} -c -o ${BINOWN} -g network -m 640 /dev/null \
150	    ${DESTDIR}/var/log/slip.log
151	${INSTALL} -c -o ${BINOWN} -g network -m 640 /dev/null \
152	    ${DESTDIR}/var/log/ppp.log
153	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
154	    ${DESTDIR}/var/log/wtmp
155	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
156	    ${DESTDIR}/var/run/utmp
157	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
158	    ${DESTDIR}/var/crash
159	cd ${.CURDIR}/..; \
160	    ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FREEBSD} \
161		${DESTDIR}/
162.if !defined(NOMAN)
163	cd ${.CURDIR}/../share/man; ${MAKE} makedb
164.endif
165
166distrib-dirs:
167	-set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.deprecated`; \
168	while [ $$# -gt 0 ] ; \
169	do \
170		for dir in /usr/share/locale \
171			   /usr/share/nls \
172			   /usr/local/share/nls; \
173		do \
174			test -d ${DESTDIR}/$${dir} && cd ${DESTDIR}/$${dir}; \
175			test -L "$$2" && rm -rf "$$2"; \
176			test \! -L "$$1" && test -d "$$1" && mv "$$1" "$$2"; \
177		done; \
178		shift; shift; \
179	done
180	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
181	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
182	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
183	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
184		-p ${DESTDIR}/usr/include
185.if !defined(NO_SENDMAIL)
186	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
187.endif
188	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
189	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
190	cd ${DESTDIR}/usr/share/man; \
191	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
192	while [ $$# -gt 0 ] ; \
193	do \
194		rm -rf "$$1"; \
195		ln -s "$$2" "$$1"; \
196		shift; shift; \
197	done
198	cd ${DESTDIR}/usr/share/locale; \
199	set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.alias`; \
200	while [ $$# -gt 0 ] ; \
201	do \
202		rm -rf "$$1"; \
203		ln -s "$$2" "$$1"; \
204		shift; shift; \
205	done
206	cd ${DESTDIR}/usr/share/nls; \
207	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
208	while [ $$# -gt 0 ] ; \
209	do \
210		rm -rf "$$1"; \
211		ln -s "$$2" "$$1"; \
212		shift; shift; \
213	done
214
215etc-examples:
216	cd ${.CURDIR}; \
217	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${BIN1} ${BIN2} \
218	    nsmb.conf opieaccess ${DESTDIR}/usr/share/examples/etc
219	cd ${.CURDIR}/defaults; \
220	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${DEFAULTS} \
221	    ${DESTDIR}/usr/share/examples/etc/defaults
222
223.include <bsd.prog.mk>
224