Makefile revision 148282
1#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
2# $FreeBSD: head/etc/Makefile 148282 2005-07-22 10:35:35Z 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.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=
86.endif
87
88distribution:
89.if !defined(DESTDIR)
90	@echo "set DESTDIR before running \"make ${.TARGET}\""
91	@false
92.endif
93	cd ${.CURDIR}; \
94	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
95		${BIN1} ${DESTDIR}/etc; \
96	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
97	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
98		${BIN2} ${DESTDIR}/etc; \
99	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
100		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
101	    pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
102		${DESTDIR}/etc/master.passwd
103	cd ${.CURDIR}/bluetooth; ${MAKE} install
104	cd ${.CURDIR}/defaults; ${MAKE} install
105	cd ${.CURDIR}/periodic; ${MAKE} install
106	cd ${.CURDIR}/rc.d; ${MAKE} install
107	cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
108	cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
109	cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
110	cd ${.CURDIR}/pam.d; ${MAKE} install
111.if !defined(NO_I4B)
112	cd ${.CURDIR}/isdn; ${MAKE} install
113.endif
114.if !defined(NO_SENDMAIL)
115	cd ${.CURDIR}/sendmail; ${MAKE} distribution
116.endif
117.if !defined(NO_OPENSSL)
118.if !defined(NO_OPENSSH)
119	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
120	    ${SSH} ${DESTDIR}/etc/ssh
121.endif
122	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
123	    ${SSL} ${DESTDIR}/etc/ssl
124.endif
125.if !defined(NO_KERBEROS)
126	cd ${.CURDIR}/root; \
127	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
128		dot.k5login ${DESTDIR}/root/.k5login;
129.endif
130	cd ${.CURDIR}/root; \
131	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
132		dot.cshrc ${DESTDIR}/root/.cshrc; \
133	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
134		dot.login ${DESTDIR}/root/.login; \
135	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
136		dot.profile ${DESTDIR}/root/.profile; \
137	    rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
138	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
139	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
140	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
141	    ${MTREE} ${DESTDIR}/etc/mtree
142.if !defined(NO_BIND)
143.if !defined(NO_BIND_ETC)
144	cd ${.CURDIR}/namedb; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
145	    ${NAMEDB} ${DESTDIR}/var/named/etc/namedb
146.endif
147.if !defined(NO_BIND_MTREE)
148	@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
149		set -x; \
150		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
151	fi
152.endif
153.endif
154	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
155	    ${PPPCNF} ${DESTDIR}/etc/ppp
156	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
157	    ${ETCMAIL} ${DESTDIR}/etc/mail
158	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
159	      ! -f ${DESTDIR}/etc/aliases ]; then \
160		set -x; \
161		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
162	fi
163	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
164	    ${DESTDIR}/etc/dumpdates
165	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
166	    ${DESTDIR}/var/db/locate.database
167	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
168	    ${DESTDIR}/var/crash
169	cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
170		${FREEBSD} ${DESTDIR}/
171	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
172	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
173	    ${DESTDIR}/boot/device.hints
174
175distrib-dirs:
176	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
177	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
178	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
179	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
180		-p ${DESTDIR}/usr/include
181.if !defined(NO_BIND)
182.if defined(WITH_BIND_LIBS)
183	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
184	    -p ${DESTDIR}/usr/include
185.endif
186.if !defined(NO_BIND_MTREE)
187	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
188	    -p ${DESTDIR}/var/named
189.endif
190.endif
191.if !defined(NO_SENDMAIL)
192	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
193.endif
194	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
195	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
196	cd ${DESTDIR}/usr/share/man; \
197	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
198	while [ $$# -gt 0 ] ; \
199	do \
200		rm -rf "$$1"; \
201		ln -s "$$2" "$$1"; \
202		shift; shift; \
203	done
204	cd ${DESTDIR}/usr/share/openssl/man; \
205	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
206	while [ $$# -gt 0 ] ; \
207	do \
208		rm -rf "$$1"; \
209		ln -s "$$2" "$$1"; \
210		shift; shift; \
211	done
212	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
213	cd ${DESTDIR}/usr/share/nls; \
214	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
215	while [ $$# -gt 0 ] ; \
216	do \
217		rm -rf "$$1"; \
218		ln -s "$$2" "$$1"; \
219		shift; shift; \
220	done
221
222etc-examples:
223	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
224	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
225	    ${DESTDIR}/usr/share/examples/etc
226	cd ${.CURDIR}/defaults; ${MAKE} install \
227	    DESTDIR=${DESTDIR}/usr/share/examples
228
229.include <bsd.prog.mk>
230