* Don't install the freefall gnats files into /etc as
[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.8 2004/01/09 20:25:13 drhodus 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=    ${.CURDIR}/../crypto/openssh/ssh_config \
34         ${.CURDIR}/../crypto/openssh/sshd_config \
35         moduli
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
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 .if defined(OBJFORMAT)
65         echo OBJFORMAT=${OBJFORMAT} > ${DISTDIR}/${DISTRIBUTION}/etc/objformat
66 .endif
67
68 upgrade_etc:
69         cd ${.CURDIR}; \
70             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
71                 ${BINUPDATE} ${DESTDIR}/etc; \
72             cap_mkdb ${DESTDIR}/etc/login.conf; \
73             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
74                 ${BIN2} ${DESTDIR}/etc;
75         cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
76             ${DEFAULTS} ${DESTDIR}/etc/defaults
77         cd ${.CURDIR}/periodic; ${MAKE} install
78         cd ${.CURDIR}/rc.d; ${MAKE} install 
79         cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
80         cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
81 .if !defined(NO_I4B)
82         cd ${.CURDIR}/isdn; ${MAKE} install
83 .endif
84 .if !defined(NO_MAKEDEV)
85         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
86             MAKEDEV.local MAKEDEV ${DESTDIR}/dev
87 .if !defined(NO_MAKEDEV_RUN)
88         cd ${DESTDIR}/dev; sh MAKEDEV all
89 .endif
90 .endif
91         cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
92             ${MTREE} ${DESTDIR}/etc/mtree
93         cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
94             ${FREEBSD} ${DESTDIR}/
95 .if !defined(NOMAN)
96         cd ${.CURDIR}/../share/man; ${MAKE} makedb
97 .endif
98
99 distribution:
100         cd ${.CURDIR}; \
101             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
102                 ${BIN1} ${DESTDIR}/etc; \
103             cap_mkdb ${DESTDIR}/etc/login.conf; \
104             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
105                 ${BIN2} ${DESTDIR}/etc; \
106             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
107                 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
108             pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
109         cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
110             ${DEFAULTS} ${DESTDIR}/etc/defaults
111         cd ${.CURDIR}/periodic; ${MAKE} install
112         cd ${.CURDIR}/rc.d; ${MAKE} install 
113         cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
114         cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
115 .if !defined(NO_I4B)
116         cd ${.CURDIR}/isdn; ${MAKE} install
117 .endif
118 .if !defined(NO_SENDMAIL)
119         cd ${.CURDIR}/sendmail; ${MAKE} distribution
120 .endif
121 .if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
122 .if !defined(NO_OPENSSH)
123         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
124             ${SSH} ${DESTDIR}/etc/ssh
125 .endif
126         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
127             ${SSL} ${DESTDIR}/etc/ssl
128 .endif
129 .if !defined(NO_MAKEDEV)
130         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
131             MAKEDEV.local MAKEDEV ${DESTDIR}/dev
132 .if !defined(NO_MAKEDEV_RUN)
133         cd ${DESTDIR}/dev; sh MAKEDEV all
134 .endif
135 .endif
136         cd ${.CURDIR}/root; \
137             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
138                 dot.cshrc ${DESTDIR}/root/.cshrc; \
139             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
140                 dot.klogin ${DESTDIR}/root/.klogin; \
141             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
142                 dot.login ${DESTDIR}/root/.login; \
143             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
144                 dot.profile ${DESTDIR}/root/.profile; \
145             rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
146             ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
147             ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
148         cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
149             ${MTREE} ${DESTDIR}/etc/mtree
150         cd ${.CURDIR}/namedb; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
151             ${NAMEDB} ${DESTDIR}/etc/namedb
152         cd ${.CURDIR}/ppp; ${INSTALL} -o root -g ${BINGRP} -m 600 \
153             ${PPPCNF} ${DESTDIR}/etc/ppp
154         cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
155             ${ETCMAIL} ${DESTDIR}/etc/mail
156         @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
157               ! -f ${DESTDIR}/etc/aliases ]; then \
158                 set -x; \
159                 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
160         fi
161         ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
162             ${DESTDIR}/etc/dumpdates
163         ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
164             ${DESTDIR}/var/db/locate.database
165         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
166             ${DESTDIR}/var/log/auth.log
167         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
168             ${DESTDIR}/var/log/cron
169         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
170             ${DESTDIR}/var/log/lpd-errs
171         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
172             ${DESTDIR}/var/log/maillog
173         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
174             ${DESTDIR}/var/log/lastlog
175         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
176             ${DESTDIR}/var/log/messages
177         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
178             ${DESTDIR}/var/log/security
179         ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
180             ${DESTDIR}/var/log/slip.log
181         ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
182             ${DESTDIR}/var/log/ppp.log
183         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
184             ${DESTDIR}/var/log/wtmp
185         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
186             ${DESTDIR}/var/run/utmp
187         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
188             ${DESTDIR}/var/crash
189         cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
190             ${FREEBSD} ${DESTDIR}/
191 .if !defined(NOMAN)
192         cd ${.CURDIR}/../share/man; ${MAKE} makedb
193 .endif
194
195 distrib-dirs:
196         -set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.deprecated`; \
197         while [ $$# -gt 0 ] ; \
198         do \
199                 for dir in /usr/share/locale \
200                            /usr/share/nls \
201                            /usr/local/share/nls; \
202                 do \
203                         test -d ${DESTDIR}/$${dir} && cd ${DESTDIR}/$${dir}; \
204                         test -L "$$2" && rm -rf "$$2"; \
205                         test \! -L "$$1" && test -d "$$1" && mv "$$1" "$$2"; \
206                 done; \
207                 shift; shift; \
208         done
209         mtree -deU -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
210         mtree -deU -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
211         mtree -deU -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
212         mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
213                 -p ${DESTDIR}/usr/include
214         mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
215                 -p ${DESTDIR}/usr/libdata/perl/5.00503/mach
216 .if !defined(NO_SENDMAIL)
217         mtree -deU -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
218 .endif
219         cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
220         cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
221         cd ${DESTDIR}/usr/share/man; \
222         set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
223         while [ $$# -gt 0 ] ; \
224         do \
225                 rm -rf "$$1"; \
226                 ln -s "$$2" "$$1"; \
227                 shift; shift; \
228         done
229         cd ${DESTDIR}/usr/share/locale; \
230         set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.alias`; \
231         while [ $$# -gt 0 ] ; \
232         do \
233                 rm -rf "$$1"; \
234                 ln -s "$$2" "$$1"; \
235                 shift; shift; \
236         done
237         cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
238         cd ${DESTDIR}/usr/share/nls; \
239         set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
240         while [ $$# -gt 0 ] ; \
241         do \
242                 rm -rf "$$1"; \
243                 ln -s "$$2" "$$1"; \
244                 shift; shift; \
245         done
246
247 etc-examples:
248         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
249             ${BIN1} ${BIN2} nsmb.conf opieaccess \
250             ${DESTDIR}/usr/share/examples/etc
251         cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
252             ${DEFAULTS} ${DESTDIR}/usr/share/examples/etc/defaults
253
254 .include <bsd.prog.mk>