Allow a NULL dev to be passed to _devsw(). This should close any remaining
[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.6 2003/08/01 03:48:33 rob Exp $
4
5 .if !defined(NO_SENDMAIL)
6 SUBDIR= sendmail
7 .endif
8
9 BIN1=   amd.map apmd.conf auth.conf \
10         crontab csh.cshrc csh.login csh.logout \
11         dhclient.conf dm.conf fbtab ftpusers gettytab group \
12         hosts hosts.allow host.conf hosts.equiv hosts.lpd \
13         inetd.conf login.access login.conf \
14         motd modems networks network.subr  newsyslog.conf \
15         pam.conf phones printcap profile protocols \
16         rc rc.firewall rc.firewall6 \
17         rc.sendmail rc.shutdown \
18         rc.subr remote rpc services \
19         shells sysctl.conf syslog.conf usbd.conf \
20         etc.${MACHINE_ARCH}/disktab \
21         etc.${MACHINE_ARCH}/ttys \
22         ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
23         ${.CURDIR}/../usr.bin/mail/misc/mail.rc \
24         ${.CURDIR}/../usr.bin/locate/locate/locate.rc
25
26 .if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
27 .if !defined(NO_OPENSSH)
28 SSH=    ${.CURDIR}/../crypto/openssh/ssh_config \
29         ${.CURDIR}/../crypto/openssh/sshd_config \
30         moduli
31 .endif
32 SSL=    ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
33 .endif
34
35 # -rwxr-xr-x root:wheel, for the new cron root:wheel
36 BIN2=   pccard_ether rc.suspend rc.resume
37
38 DEFAULTS= rc.conf make.conf pccard.conf periodic.conf
39
40 MTREE=  BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
41         BSD.var.dist BSD.x11.dist BSD.x11-4.dist
42 .if !defined(NO_SENDMAIL)
43 MTREE+= BSD.sendmail.dist
44 .endif
45
46 NAMEDB= PROTO.localhost.rev PROTO.localhost-v6.rev named.conf named.root \
47         make-localhost
48
49 PPPCNF= ppp.conf
50
51 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
52         mailertable.sample aliases
53
54 # Special top level files for FreeBSD
55 FREEBSD=COPYRIGHT
56
57 distribute:
58         cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
59 .if defined(OBJFORMAT)
60         echo OBJFORMAT=${OBJFORMAT} > ${DISTDIR}/${DISTRIBUTION}/etc/objformat
61 .endif
62
63 distribution:
64         cd ${.CURDIR}; \
65             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
66                 ${BIN1} ${DESTDIR}/etc; \
67             cap_mkdb ${DESTDIR}/etc/login.conf; \
68             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
69                 ${BIN2} ${DESTDIR}/etc; \
70             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
71                 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
72             pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
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}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
78         cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
79         cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
80 .if !defined(NO_I4B)
81         cd ${.CURDIR}/isdn; ${MAKE} install
82 .endif
83 .if !defined(NO_SENDMAIL)
84         cd ${.CURDIR}/sendmail; ${MAKE} distribution
85 .endif
86 .if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
87 .if !defined(NO_OPENSSH)
88         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
89             ${SSH} ${DESTDIR}/etc/ssh
90 .endif
91         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
92             ${SSL} ${DESTDIR}/etc/ssl
93 .endif
94 .if !defined(NO_MAKEDEV)
95         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
96             MAKEDEV.local MAKEDEV ${DESTDIR}/dev
97 .if !defined(NO_MAKEDEV_RUN)
98         cd ${DESTDIR}/dev; sh MAKEDEV all
99 .endif
100 .endif
101         cd ${.CURDIR}/root; \
102             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
103                 dot.cshrc ${DESTDIR}/root/.cshrc; \
104             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
105                 dot.klogin ${DESTDIR}/root/.klogin; \
106             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
107                 dot.login ${DESTDIR}/root/.login; \
108             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
109                 dot.profile ${DESTDIR}/root/.profile; \
110             rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
111             ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
112             ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
113         cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
114             ${MTREE} ${DESTDIR}/etc/mtree
115         cd ${.CURDIR}/namedb; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
116             ${NAMEDB} ${DESTDIR}/etc/namedb
117         cd ${.CURDIR}/ppp; ${INSTALL} -o root -g ${BINGRP} -m 600 \
118             ${PPPCNF} ${DESTDIR}/etc/ppp
119         cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
120             ${ETCMAIL} ${DESTDIR}/etc/mail
121         @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
122               ! -f ${DESTDIR}/etc/aliases ]; then \
123                 set -x; \
124                 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
125         fi
126         ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
127             ${DESTDIR}/etc/dumpdates
128         ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
129             ${DESTDIR}/var/db/locate.database
130         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
131             ${DESTDIR}/var/log/auth.log
132         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
133             ${DESTDIR}/var/log/cron
134         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
135             ${DESTDIR}/var/log/lpd-errs
136         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
137             ${DESTDIR}/var/log/maillog
138         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
139             ${DESTDIR}/var/log/lastlog
140         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
141             ${DESTDIR}/var/log/messages
142         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
143             ${DESTDIR}/var/log/security
144         ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
145             ${DESTDIR}/var/log/slip.log
146         ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
147             ${DESTDIR}/var/log/ppp.log
148         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
149             ${DESTDIR}/var/log/wtmp
150         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
151             ${DESTDIR}/var/run/utmp
152         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
153             ${DESTDIR}/var/crash
154         cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
155             ${FREEBSD} ${DESTDIR}/
156 .if !defined(NOMAN)
157         cd ${.CURDIR}/../share/man; ${MAKE} makedb
158 .endif
159
160 distrib-dirs:
161         -set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.deprecated`; \
162         while [ $$# -gt 0 ] ; \
163         do \
164                 for dir in /usr/share/locale \
165                            /usr/share/nls \
166                            /usr/local/share/nls; \
167                 do \
168                         test -d ${DESTDIR}/$${dir} && cd ${DESTDIR}/$${dir}; \
169                         test -L "$$2" && rm -rf "$$2"; \
170                         test \! -L "$$1" && test -d "$$1" && mv "$$1" "$$2"; \
171                 done; \
172                 shift; shift; \
173         done
174         mtree -deU -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
175         mtree -deU -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
176         mtree -deU -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
177         mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
178                 -p ${DESTDIR}/usr/include
179         mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
180                 -p ${DESTDIR}/usr/libdata/perl/5.00503/mach
181 .if !defined(NO_SENDMAIL)
182         mtree -deU -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
183 .endif
184         cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
185         cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
186         cd ${DESTDIR}/usr/share/man; \
187         set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
188         while [ $$# -gt 0 ] ; \
189         do \
190                 rm -rf "$$1"; \
191                 ln -s "$$2" "$$1"; \
192                 shift; shift; \
193         done
194         cd ${DESTDIR}/usr/share/locale; \
195         set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.alias`; \
196         while [ $$# -gt 0 ] ; \
197         do \
198                 rm -rf "$$1"; \
199                 ln -s "$$2" "$$1"; \
200                 shift; shift; \
201         done
202         cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
203         cd ${DESTDIR}/usr/share/nls; \
204         set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
205         while [ $$# -gt 0 ] ; \
206         do \
207                 rm -rf "$$1"; \
208                 ln -s "$$2" "$$1"; \
209                 shift; shift; \
210         done
211
212 etc-examples:
213         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
214             ${BIN1} ${BIN2} nsmb.conf opieaccess \
215             ${DESTDIR}/usr/share/examples/etc
216         cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
217             ${DEFAULTS} ${DESTDIR}/usr/share/examples/etc/defaults
218
219 .include <bsd.prog.mk>