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