1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
2 # $FreeBSD: src/etc/Makefile,v 1.219.2.38 2003/03/04 09:49:00 ru Exp $
3 # $DragonFly: src/etc/Makefile,v 1.30 2004/10/21 18:49:51 dillon Exp $
5 .if !defined(NO_SENDMAIL)
9 # Files that should be installed read-only (444)
11 BINUPDATE= apmd.conf fbtab gettytab network.subr \
14 rc rc.firewall rc.firewall6 \
15 rc.sendmail rc.shutdown \
16 rc.subr rpc services \
17 etc.${MACHINE_ARCH}/disktab \
18 ${.CURDIR}/../usr.bin/mail/misc/mail.rc \
19 ${.CURDIR}/../usr.bin/locate/locate/locate.rc
21 # Initial distribution files are installed read-write (644)
23 BIN1= amd.map auth.conf \
24 crontab csh.cshrc csh.login csh.logout \
25 dhclient.conf dm.conf ftpusers group \
26 hosts hosts.allow host.conf hosts.equiv hosts.lpd \
27 inetd.conf login.access login.conf \
28 motd modems networks newsyslog.conf \
29 pam.conf pf.conf phones printcap profile \
31 shells sysctl.conf syslog.conf usbd.conf \
32 etc.${MACHINE_ARCH}/ttys \
33 ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config
35 .if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
36 .if !defined(NO_OPENSSH)
41 SSL= ${.CURDIR}/../crypto/openssl-0.9.7d/apps/openssl.cnf
44 # Files that should be installed read-only-executable (555) root:wheel
46 BIN2= pccard_ether rc.suspend rc.resume
48 DEFAULTS= rc.conf make.conf pccard.conf periodic.conf
50 MTREE= BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
51 BSD.var.dist BSD.x11.dist BSD.x11-4.dist
52 .if !defined(NO_SENDMAIL)
53 MTREE+= BSD.sendmail.dist
56 NAMEDB= PROTO.localhost.rev PROTO.localhost-v6.rev named.conf named.root \
57 make-localhost getroot README
61 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
62 mailertable.sample aliases
64 # Special top level files for FreeBSD
68 cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
71 cd ${.CURDIR}/../share/mk; ${MAKE} install
73 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
74 ${BINUPDATE} ${DESTDIR}/etc; \
75 cap_mkdb ${DESTDIR}/etc/login.conf; \
76 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
77 ${BIN2} ${DESTDIR}/etc;
78 cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
79 ${DEFAULTS} ${DESTDIR}/etc/defaults
80 cd ${.CURDIR}/periodic; ${MAKE} install
81 cd ${.CURDIR}/rc.d; ${MAKE} install
82 cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
83 cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
85 cd ${.CURDIR}/isdn; ${MAKE} install
87 .if !defined(NO_MAKEDEV)
88 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
89 MAKEDEV.local MAKEDEV ${DESTDIR}/dev
90 .if !defined(NO_MAKEDEV_RUN)
91 cd ${DESTDIR}/dev; sh MAKEDEV all
94 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
95 ${MTREE} ${DESTDIR}/etc/mtree
96 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
97 ${FREEBSD} ${DESTDIR}/
99 cd ${.CURDIR}/../share/man; ${MAKE} makedb
101 rm -f ${DESTDIR}/usr/include/machine/ioctl_meteor.h
102 rm -f ${DESTDIR}/usr/include/machine/ioctl_bt848.h
103 ln -s "../dev/video/bktr/ioctl_bt848.h" ${DESTDIR}/usr/include/machine/ioctl_bt848.h
104 ln -s "../dev/video/meteor/ioctl_meteor.h" ${DESTDIR}/usr/include/machine/ioctl_meteor.h
105 .if exists(${DESTDIR}/usr/sbin/named-checkzone)
106 rm -f ${DESTDIR}/usr/libexec/named-xfer
107 rm -f ${DESTDIR}/usr/bin/dnsquery
108 rm -f ${DESTDIR}/usr/bin/dnskeygen
109 rm -f ${DESTDIR}/usr/sbin/ndc
111 .if exists(${DESTDIR}/usr/lib/crtbegin.o)
112 csh -c "rm -f ${DESTDIR}/usr/lib/gcc2/{crtbegin.o,crtbeginS.o,crtend.o,crtendS.o}"
113 csh -c "rm -f ${DESTDIR}/usr/lib/gcc3/{crtbegin.o,crtbeginS.o,crtend.o,crtendS.o}"
115 .if exists(${DESTDIR}/usr/include/netproto/802_11/if_wavelan_ieee.h)
116 rm -f ${DESTDIR}/usr/include/dev/netif/wi/if_wavelan_ieee.h
117 rm -f ${DESTDIR}/usr/include/net/if_ieee80211.h
119 .if exists(${DESTDIR}/usr/libexec/binutils212/elf/as)
120 ldconfig -m ${DESTDIR}/usr/lib/gcc2
121 rm -rf ${DESTDIR}/usr/lib/gcc3
122 rm -rf ${DESTDIR}/usr/libexec/gcc3
123 rm -rf ${DESTDIR}/usr/libdata/ldscripts
124 rm -rf ${DESTDIR}/usr/libdata/gcc2
125 rm -rf ${DESTDIR}/usr/libdata/gcc3
126 rm -rf ${DESTDIR}/usr/libexec/elf
127 rm -rf ${DESTDIR}/usr/libexec/aout
128 rm -rf ${DESTDIR}/usr/bin/gcc2
129 rm -rf ${DESTDIR}/usr/bin/gcc3
130 rm -rf ${DESTDIR}/usr/include/g++
131 csh -c "rm -f ${DESTDIR}/usr/bin/{genassym,gensetdefs,nawk}"
132 csh -c "rm -f ${DESTDIR}/usr/share/man/{man8,cat8}/{genassym,gensetdefs}.8.gz"
133 csh -c "rm -f ${DESTDIR}/usr/share/man/{man1,cat1}/{gawk,nawk}.1.gz"
134 csh -c "rm -f ${DESTDIR}/usr/libexec/{cc1,cc1obj,cc1plus}"
135 csh -c "rm -f ${DESTDIR}/usr/libexec/{cpp,cpp0,f771,objformat}"
136 csh -c "rm -f ${DESTDIR}/usr/libexec/binutils212/{cc1,cc1obj,cc1plus}"
137 csh -c "rm -f ${DESTDIR}/usr/libexec/binutils212/{cpp,cpp0,f771,objformat}"
138 csh -c "rm -f ${DESTDIR}/usr/libexec/binutils214/{cc1,cc1obj,cc1plus}"
139 csh -c "rm -f ${DESTDIR}/usr/libexec/binutils214/{cpp,cpp0,f771,objformat}"
140 csh -c "rm -f ${DESTDIR}/usr/lib/{libgcc.a,libgcc_p.a}"
141 csh -c "rm -f ${DESTDIR}/usr/lib/{libobjc.a,libobjc_p.a,libstdc++.a}"
142 csh -c "rm -f ${DESTDIR}/usr/lib/{libstdc++.so,libstdc++.so.3}"
143 csh -c "rm -f ${DESTDIR}/usr/lib/{libstdc++_p.a}"
144 csh -c "rm -f ${DESTDIR}/usr/bin/CC"
145 rm -f ${DESTDIR}/usr/bin/makewhatis
146 rm -f ${DESTDIR}/usr/sbin/prebind
149 .if exists(${DESTDIR}/usr/share/examples/bc)
150 rm -rf ${DESTDIR}/usr/share/examples/bc
152 .if exists(${DESTDIR}/usr/share/info/dc.info.gz)
153 gzip -d ${DESTDIR}/usr/share/info/dc.info.gz
154 install-info --delete ${DESTDIR}/usr/share/info/dc.info ${DESTDIR}/usr/share/info/dir
155 rm -f ${DESTDIR}/usr/share/info/dc.info ${DESTDIR}/usr/share/info/dc.info.gz
160 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
161 ${BINUPDATE} ${DESTDIR}/etc; \
162 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
163 ${BIN1} ${DESTDIR}/etc; \
164 cap_mkdb ${DESTDIR}/etc/login.conf; \
165 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
166 ${BIN2} ${DESTDIR}/etc; \
167 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
168 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
169 pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
170 cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
171 ${DEFAULTS} ${DESTDIR}/etc/defaults
172 cd ${.CURDIR}/periodic; ${MAKE} install
173 cd ${.CURDIR}/rc.d; ${MAKE} install
174 cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
175 cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
177 cd ${.CURDIR}/isdn; ${MAKE} install
179 .if !defined(NO_SENDMAIL)
180 cd ${.CURDIR}/sendmail; ${MAKE} obj
181 cd ${.CURDIR}/sendmail; ${MAKE} distribution
183 .if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
184 .if !defined(NO_OPENSSH)
186 cd ${.CURDIR}/../secure/${_f} && ${MAKE} obj
187 cd ${.CURDIR}/../secure/${_f} && ${MAKE} etc-ssh
190 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
191 ${SSL} ${DESTDIR}/etc/ssl
193 .if !defined(NO_MAKEDEV)
194 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
195 MAKEDEV.local MAKEDEV ${DESTDIR}/dev
196 .if !defined(NO_MAKEDEV_RUN)
197 cd ${DESTDIR}/dev; sh MAKEDEV all
200 cd ${.CURDIR}/root; \
201 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
202 dot.cshrc ${DESTDIR}/root/.cshrc; \
203 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
204 dot.klogin ${DESTDIR}/root/.klogin; \
205 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
206 dot.login ${DESTDIR}/root/.login; \
207 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
208 dot.profile ${DESTDIR}/root/.profile; \
209 rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
210 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
211 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
212 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
213 ${MTREE} ${DESTDIR}/etc/mtree
214 cd ${.CURDIR}/namedb; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
215 ${NAMEDB} ${DESTDIR}/etc/namedb
216 cd ${.CURDIR}/ppp; ${INSTALL} -o root -g ${BINGRP} -m 600 \
217 ${PPPCNF} ${DESTDIR}/etc/ppp
218 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
219 ${ETCMAIL} ${DESTDIR}/etc/mail
220 @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
221 ! -f ${DESTDIR}/etc/aliases ]; then \
223 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
225 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
226 ${DESTDIR}/etc/dumpdates
227 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
228 ${DESTDIR}/var/db/locate.database
229 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
230 ${DESTDIR}/var/log/auth.log
231 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
232 ${DESTDIR}/var/log/cron
233 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
234 ${DESTDIR}/var/log/lpd-errs
235 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
236 ${DESTDIR}/var/log/maillog
237 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
238 ${DESTDIR}/var/log/lastlog
239 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
240 ${DESTDIR}/var/log/messages
241 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
242 ${DESTDIR}/var/log/security
243 ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
244 ${DESTDIR}/var/log/slip.log
245 ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
246 ${DESTDIR}/var/log/ppp.log
247 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
248 ${DESTDIR}/var/log/wtmp
249 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
250 ${DESTDIR}/var/run/utmp
251 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
253 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
254 ${FREEBSD} ${DESTDIR}/
256 cd ${.CURDIR}/../share/man; ${MAKE} makedb
260 -set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.deprecated`; \
261 while [ $$# -gt 0 ] ; \
263 for dir in /usr/share/locale \
265 /usr/local/share/nls; \
267 test -d ${DESTDIR}/$${dir} && cd ${DESTDIR}/$${dir}; \
268 test -L "$$2" && rm -rf "$$2"; \
269 test \! -L "$$1" && test -d "$$1" && mv "$$1" "$$2"; \
273 mtree -deU -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
274 mtree -deU -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
275 mtree -deU -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
276 mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
277 -p ${DESTDIR}/usr/include
278 mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
279 -p ${DESTDIR}/usr/libdata/perl/5.00503/mach
280 .if !defined(NO_SENDMAIL)
281 mtree -deU -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
283 cd ${DESTDIR}/etc/namedb; rm -f etc/namedb; ln -s ".." etc/namedb
284 cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
285 cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
286 cd ${DESTDIR}/usr/share/man; \
287 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
288 while [ $$# -gt 0 ] ; \
294 cd ${DESTDIR}/usr/share/locale; \
295 set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.alias`; \
296 while [ $$# -gt 0 ] ; \
302 cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
303 cd ${DESTDIR}/usr/share/nls; \
304 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
305 while [ $$# -gt 0 ] ; \
313 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
314 ${BINUPDATE} ${BIN1} ${BIN2} nsmb.conf opieaccess \
315 ${DESTDIR}/usr/share/examples/etc
316 cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
317 ${DEFAULTS} ${DESTDIR}/usr/share/examples/etc/defaults
319 .include <bsd.prog.mk>