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