Hook the new bc and dc into the tree. Unhook the old gnu bc/dc and add
[dragonfly.git] / etc / Makefile
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.27 2004/09/20 22:03:11 dillon Exp $
4
5 .if !defined(NO_SENDMAIL)
6 SUBDIR= sendmail
7 .endif
8
9 BINUPDATE= apmd.conf fbtab gettytab network.subr \
10         protocols \
11         rc rc.firewall rc.firewall6 \
12         rc.sendmail rc.shutdown \
13         rc.subr rpc services \
14         etc.${MACHINE_ARCH}/disktab \
15         ${.CURDIR}/../usr.bin/mail/misc/mail.rc \
16         ${.CURDIR}/../usr.bin/locate/locate/locate.rc
17
18 BIN1=   ${BINUPDATE} \
19         amd.map auth.conf \
20         crontab csh.cshrc csh.login csh.logout \
21         dhclient.conf dm.conf ftpusers group \
22         hosts hosts.allow host.conf hosts.equiv hosts.lpd \
23         inetd.conf login.access login.conf \
24         motd modems networks newsyslog.conf \
25         pam.conf phones printcap profile \
26         remote \
27         shells sysctl.conf syslog.conf usbd.conf \
28         etc.${MACHINE_ARCH}/ttys \
29         ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config
30
31 .if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
32 .if !defined(NO_OPENSSH)
33 SSH=    lib/libssh \
34         usr.bin/ssh \
35         usr.sbin/sshd
36 .endif
37 SSL=    ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
38 .endif
39
40 # -rwxr-xr-x root:wheel, for the new cron root:wheel
41 BIN2=   pccard_ether rc.suspend rc.resume
42
43 DEFAULTS= rc.conf make.conf pccard.conf periodic.conf
44
45 MTREE=  BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
46         BSD.var.dist BSD.x11.dist BSD.x11-4.dist
47 .if !defined(NO_SENDMAIL)
48 MTREE+= BSD.sendmail.dist
49 .endif
50
51 NAMEDB= PROTO.localhost.rev PROTO.localhost-v6.rev named.conf named.root \
52         make-localhost getroot README
53
54 PPPCNF= ppp.conf
55
56 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
57         mailertable.sample aliases
58
59 # Special top level files for FreeBSD
60 FREEBSD=COPYRIGHT
61
62 distribute:
63         cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
64
65 upgrade_etc:
66         cd ${.CURDIR}/../share/mk; ${MAKE} install
67         cd ${.CURDIR}; \
68             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
69                 ${BINUPDATE} ${DESTDIR}/etc; \
70             cap_mkdb ${DESTDIR}/etc/login.conf; \
71             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
72                 ${BIN2} ${DESTDIR}/etc;
73         cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
74             ${DEFAULTS} ${DESTDIR}/etc/defaults
75         cd ${.CURDIR}/periodic; ${MAKE} install
76         cd ${.CURDIR}/rc.d; ${MAKE} install 
77         cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
78         cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
79 .if !defined(NO_I4B)
80         cd ${.CURDIR}/isdn; ${MAKE} install
81 .endif
82 .if !defined(NO_MAKEDEV)
83         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
84             MAKEDEV.local MAKEDEV ${DESTDIR}/dev
85 .if !defined(NO_MAKEDEV_RUN)
86         cd ${DESTDIR}/dev; sh MAKEDEV all
87 .endif
88 .endif
89         cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
90             ${MTREE} ${DESTDIR}/etc/mtree
91         cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
92             ${FREEBSD} ${DESTDIR}/
93 .if !defined(NOMAN)
94         cd ${.CURDIR}/../share/man; ${MAKE} makedb
95 .endif
96         rm -f ${DESTDIR}/usr/include/machine/ioctl_meteor.h
97         rm -f ${DESTDIR}/usr/include/machine/ioctl_bt848.h
98         ln -s "../dev/video/bktr/ioctl_bt848.h" ${DESTDIR}/usr/include/machine/ioctl_bt848.h
99         ln -s "../dev/video/meteor/ioctl_meteor.h" ${DESTDIR}/usr/include/machine/ioctl_meteor.h
100 .if exists(${DESTDIR}/usr/sbin/named-checkzone)
101         rm -f ${DESTDIR}/usr/libexec/named-xfer
102         rm -f ${DESTDIR}/usr/bin/dnsquery
103         rm -f ${DESTDIR}/usr/bin/dnskeygen
104         rm -f ${DESTDIR}/usr/sbin/ndc
105 .endif
106 .if exists(${DESTDIR}/usr/lib/crtbegin.o)
107         csh -c "rm -f ${DESTDIR}/usr/lib/gcc2/{crtbegin.o,crtbeginS.o,crtend.o,crtendS.o}"
108         csh -c "rm -f ${DESTDIR}/usr/lib/gcc3/{crtbegin.o,crtbeginS.o,crtend.o,crtendS.o}"
109 .endif
110 .if exists(${DESTDIR}/usr/include/netproto/802_11/if_wavelan_ieee.h)
111         rm -f ${DESTDIR}/usr/include/dev/netif/wi/if_wavelan_ieee.h
112         rm -f ${DESTDIR}/usr/include/net/if_ieee80211.h
113 .endif
114 .if exists(${DESTDIR}/usr/libexec/binutils212/elf/as)
115         ldconfig -m ${DESTDIR}/usr/lib/gcc2
116         rm -rf ${DESTDIR}/usr/lib/gcc3
117         rm -rf ${DESTDIR}/usr/libexec/gcc3
118         rm -rf ${DESTDIR}/usr/libdata/ldscripts
119         rm -rf ${DESTDIR}/usr/libdata/gcc2
120         rm -rf ${DESTDIR}/usr/libdata/gcc3
121         rm -rf ${DESTDIR}/usr/libexec/elf
122         rm -rf ${DESTDIR}/usr/libexec/aout
123         rm -rf ${DESTDIR}/usr/bin/gcc2
124         rm -rf ${DESTDIR}/usr/bin/gcc3
125         rm -rf ${DESTDIR}/usr/include/g++
126         csh -c "rm -f ${DESTDIR}/usr/bin/{genassym,gensetdefs,nawk}"
127         csh -c "rm -f ${DESTDIR}/usr/share/man/{man8,cat8}/{genassym,gensetdefs}.8.gz"
128         csh -c "rm -f ${DESTDIR}/usr/share/man/{man1,cat1}/{gawk,nawk}.1.gz"
129         csh -c "rm -f ${DESTDIR}/usr/libexec/{cc1,cc1obj,cc1plus}"
130         csh -c "rm -f ${DESTDIR}/usr/libexec/{cpp,cpp0,f771,objformat}"
131         csh -c "rm -f ${DESTDIR}/usr/libexec/binutils212/{cc1,cc1obj,cc1plus}"
132         csh -c "rm -f ${DESTDIR}/usr/libexec/binutils212/{cpp,cpp0,f771,objformat}"
133         csh -c "rm -f ${DESTDIR}/usr/libexec/binutils214/{cc1,cc1obj,cc1plus}"
134         csh -c "rm -f ${DESTDIR}/usr/libexec/binutils214/{cpp,cpp0,f771,objformat}"
135         csh -c "rm -f ${DESTDIR}/usr/lib/{libgcc.a,libgcc_p.a}"
136         csh -c "rm -f ${DESTDIR}/usr/lib/{libobjc.a,libobjc_p.a,libstdc++.a}"
137         csh -c "rm -f ${DESTDIR}/usr/lib/{libstdc++.so,libstdc++.so.3}"
138         csh -c "rm -f ${DESTDIR}/usr/lib/{libstdc++_p.a}"
139         csh -c "rm -f ${DESTDIR}/usr/bin/CC"
140         rm -f ${DESTDIR}/usr/bin/makewhatis
141         rm -f ${DESTDIR}/usr/sbin/prebind
142         ldconfig -R
143 .endif
144 .if exists(${DESTDIR}/usr/share/examples/bc)
145         rm -rf ${DESTDIR}/usr/share/examples/bc
146 .endif
147 .if exists(${DESTDIR}/usr/share/info/dc.info.gz)
148         gzip -d ${DESTDIR}/usr/share/info/dc.info.gz
149         install-info --delete ${DESTDIR}/usr/share/info/dc.info ${DESTDIR}/usr/share/info/dir
150         rm -f ${DESTDIR}/usr/share/info/dc.info ${DESTDIR}/usr/share/info/dc.info.gz
151 .endif
152
153 distribution:
154         cd ${.CURDIR}; \
155             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
156                 ${BIN1} ${DESTDIR}/etc; \
157             cap_mkdb ${DESTDIR}/etc/login.conf; \
158             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
159                 ${BIN2} ${DESTDIR}/etc; \
160             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
161                 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
162             pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
163         cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
164             ${DEFAULTS} ${DESTDIR}/etc/defaults
165         cd ${.CURDIR}/periodic; ${MAKE} install
166         cd ${.CURDIR}/rc.d; ${MAKE} install 
167         cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
168         cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
169 .if !defined(NO_I4B)
170         cd ${.CURDIR}/isdn; ${MAKE} install
171 .endif
172 .if !defined(NO_SENDMAIL)
173         cd ${.CURDIR}/sendmail; ${MAKE} obj
174         cd ${.CURDIR}/sendmail; ${MAKE} distribution
175 .endif
176 .if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
177 .if !defined(NO_OPENSSH)
178 .for _f in ${SSH}
179         cd ${.CURDIR}/../secure/${_f} && ${MAKE} obj
180         cd ${.CURDIR}/../secure/${_f} && ${MAKE} etc-ssh
181 .endfor
182 .endif
183         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
184             ${SSL} ${DESTDIR}/etc/ssl
185 .endif
186 .if !defined(NO_MAKEDEV)
187         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
188             MAKEDEV.local MAKEDEV ${DESTDIR}/dev
189 .if !defined(NO_MAKEDEV_RUN)
190         cd ${DESTDIR}/dev; sh MAKEDEV all
191 .endif
192 .endif
193         cd ${.CURDIR}/root; \
194             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
195                 dot.cshrc ${DESTDIR}/root/.cshrc; \
196             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
197                 dot.klogin ${DESTDIR}/root/.klogin; \
198             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
199                 dot.login ${DESTDIR}/root/.login; \
200             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
201                 dot.profile ${DESTDIR}/root/.profile; \
202             rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
203             ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
204             ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
205         cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
206             ${MTREE} ${DESTDIR}/etc/mtree
207         cd ${.CURDIR}/namedb; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
208             ${NAMEDB} ${DESTDIR}/etc/namedb
209         cd ${.CURDIR}/ppp; ${INSTALL} -o root -g ${BINGRP} -m 600 \
210             ${PPPCNF} ${DESTDIR}/etc/ppp
211         cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
212             ${ETCMAIL} ${DESTDIR}/etc/mail
213         @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
214               ! -f ${DESTDIR}/etc/aliases ]; then \
215                 set -x; \
216                 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
217         fi
218         ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
219             ${DESTDIR}/etc/dumpdates
220         ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
221             ${DESTDIR}/var/db/locate.database
222         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
223             ${DESTDIR}/var/log/auth.log
224         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
225             ${DESTDIR}/var/log/cron
226         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
227             ${DESTDIR}/var/log/lpd-errs
228         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
229             ${DESTDIR}/var/log/maillog
230         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
231             ${DESTDIR}/var/log/lastlog
232         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
233             ${DESTDIR}/var/log/messages
234         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
235             ${DESTDIR}/var/log/security
236         ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
237             ${DESTDIR}/var/log/slip.log
238         ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
239             ${DESTDIR}/var/log/ppp.log
240         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
241             ${DESTDIR}/var/log/wtmp
242         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
243             ${DESTDIR}/var/run/utmp
244         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
245             ${DESTDIR}/var/crash
246         cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
247             ${FREEBSD} ${DESTDIR}/
248 .if !defined(NOMAN)
249         cd ${.CURDIR}/../share/man; ${MAKE} makedb
250 .endif
251
252 distrib-dirs:
253         -set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.deprecated`; \
254         while [ $$# -gt 0 ] ; \
255         do \
256                 for dir in /usr/share/locale \
257                            /usr/share/nls \
258                            /usr/local/share/nls; \
259                 do \
260                         test -d ${DESTDIR}/$${dir} && cd ${DESTDIR}/$${dir}; \
261                         test -L "$$2" && rm -rf "$$2"; \
262                         test \! -L "$$1" && test -d "$$1" && mv "$$1" "$$2"; \
263                 done; \
264                 shift; shift; \
265         done
266         mtree -deU -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
267         mtree -deU -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
268         mtree -deU -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
269         mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
270                 -p ${DESTDIR}/usr/include
271         mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
272                 -p ${DESTDIR}/usr/libdata/perl/5.00503/mach
273 .if !defined(NO_SENDMAIL)
274         mtree -deU -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
275 .endif
276         cd ${DESTDIR}/etc/namedb; rm -f etc/namedb; ln -s ".." etc/namedb
277         cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
278         cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
279         cd ${DESTDIR}/usr/share/man; \
280         set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
281         while [ $$# -gt 0 ] ; \
282         do \
283                 rm -rf "$$1"; \
284                 ln -s "$$2" "$$1"; \
285                 shift; shift; \
286         done
287         cd ${DESTDIR}/usr/share/locale; \
288         set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.alias`; \
289         while [ $$# -gt 0 ] ; \
290         do \
291                 rm -rf "$$1"; \
292                 ln -s "$$2" "$$1"; \
293                 shift; shift; \
294         done
295         cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
296         cd ${DESTDIR}/usr/share/nls; \
297         set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
298         while [ $$# -gt 0 ] ; \
299         do \
300                 rm -rf "$$1"; \
301                 ln -s "$$2" "$$1"; \
302                 shift; shift; \
303         done
304
305 etc-examples:
306         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
307             ${BIN1} ${BIN2} nsmb.conf opieaccess \
308             ${DESTDIR}/usr/share/examples/etc
309         cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
310             ${DEFAULTS} ${DESTDIR}/usr/share/examples/etc/defaults
311
312 .include <bsd.prog.mk>