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 $
6 # Files that should be installed read-only (444)
8 BINUPDATE
= devd.conf fbtab gettytab network.subr \
11 rc rc.firewall rc.firewall6 \
12 rc.sendmail rc.shutdown \
14 etc.
${MACHINE_ARCH}/disktab
15 .if defined
(BINARY_UPGRADE
) # location of these depends on upgrade method
16 BINUPDATE
+=mail.rc locate.rc
18 BINUPDATE
+=${.CURDIR
}/..
/usr.bin
/mail
/misc
/mail.rc \
19 ${.CURDIR
}/..
/usr.bin
/locate
/locate
/locate.rc \
20 ${.CURDIR
}/..
/contrib
/openresolv
/resolvconf.conf \
21 ${.CURDIR
}/..
/contrib
/dhcpcd
/src
/dhcpcd.conf
24 # Initial distribution files are installed read-write (644)
26 BIN1
= auth.conf auto_master \
27 crontab csh.cshrc csh.login csh.logout \
28 devtab dhclient.conf dntpd.conf \
30 hosts hosts.allow hosts.equiv hosts.lpd \
31 inetd.conf login.access login.conf \
32 motd modems netconfig networks newsyslog.conf \
33 nscd.conf pf.conf phones printcap profile \
34 regdomain.xml remote sensorsd.conf services \
35 shells sysctl.conf syslog.conf \
37 etc.
${MACHINE_ARCH}/ttys
39 DIRS
+= lib
/libssh usr.bin
/openssl usr.bin
/ssh usr.sbin
/sshd
41 # Files that should be installed read-only-executable (555) root:wheel
43 BIN2
= pccard_ether rc.suspend rc.resume
45 DEFAULTS
= compilers.conf devfs.conf make.conf periodic.conf \
46 pfi.conf rc.conf uuids
48 MTREE
= BSD.
include.
dist BSD.root.
dist BSD.usr.
dist BSD.var.
dist
52 ETCMAIL
=aliases mailer.conf access.sample virtusertable.sample \
55 # Use this directory as the source for new configuration files when upgrading
56 UPGRADE_SRCDIR?
=${.CURDIR
}
58 # Include file which contains obsolete files
59 .if exists
(${DESTDIR}/etc
/upgrade
/Makefile_upgrade.inc
)
60 .
include "${DESTDIR}/etc/upgrade/Makefile_upgrade.inc"
63 remove-obsolete-files
:
64 @if
[ -z
"${TO_REMOVE}" ]; then \
65 echo
"Please do a 'make installworld' first."; \
66 echo
"See build(7) for further information."; \
69 @echo
"===> Remove now obsolete files"
70 @for item in
${TO_REMOVE}; do \
71 if
[ -e
${DESTDIR}$${item} -o
-L
${DESTDIR}$${item} ]; then \
72 echo
"${DESTDIR}$${item}"; \
73 chflags
-Rf noschg
"${DESTDIR}$${item}"; \
74 rm -rf
"${DESTDIR}$${item}"; \
78 remove-deprecated-files
:
79 .if defined
(REMOVE_DEPRECATED
)
80 @echo
"===> Remove now deprecated files"
81 @for item in
${TO_REMOVE_LATE}; do \
82 if
[ -e
${DESTDIR}$${item} -o
-L
${DESTDIR}$${item} ]; then \
83 echo
"${DESTDIR}$${item}"; \
84 chflags
-Rf noschg
"${DESTDIR}$${item}"; \
85 rm -rf
"${DESTDIR}$${item}"; \
89 @echo
"===> Checking for deprecated files"
90 @count
=0; for item in
${TO_REMOVE_LATE}; do \
91 if
[ -e
${DESTDIR}$${item} -o
-L
${DESTDIR}$${item} ]; then \
92 echo
"${DESTDIR}$${item} is deprecated"; \
93 count
=`expr $$count + 1`; \
96 if
[ "$$count" -gt
0 ]; then \
97 echo
"==================================================================" ; \
98 echo
"= You have $$count now deprecated files." ; \
99 echo
"= Once you are sure that none of your third party (ports or local)" ; \
100 echo
"= software are still using them, rerun with:" ; \
101 echo
"= make upgrade -DREMOVE_DEPRECATED" ; \
102 echo
"==================================================================" ; \
107 (pw
-V
${DESTDIR}/etc usershow mail
-q
> /dev
/null
) || \
108 pw
-V
${DESTDIR}/etc useradd mail
-u
6 -g
6 \
110 -d
/nonexistent
-s
/sbin
/nologin
111 (pw
-V
${DESTDIR}/etc usershow _pflogd
-q
> /dev
/null
) || \
112 pw
-V
${DESTDIR}/etc useradd _pflogd
-u
64 \
113 -c
"pflogd privsep user" \
114 -d
/var
/empty
-s
/sbin
/nologin
115 (pw
-V
${DESTDIR}/etc usershow _sdpd
-q
> /dev
/null
) || \
116 pw
-V
${DESTDIR}/etc useradd _sdpd
-u
70 \
117 -c
"sdpd privsep user" \
118 -d
/var
/empty
-s
/sbin
/nologin
119 (pw
-V
${DESTDIR}/etc usershow _dhcp
-q
> /dev
/null
) || \
120 pw
-V
${DESTDIR}/etc useradd _dhcp
-u
77 \
122 -d
/var
/empty
-s
/sbin
/nologin
123 (pw
-V
${DESTDIR}/etc groupshow input
-q
> /dev
/null
) || \
124 pw
-V
${DESTDIR}/etc groupadd input
-g
43
125 (pw
-V
${DESTDIR}/etc groupshow video
-q
> /dev
/null
) || \
126 pw
-V
${DESTDIR}/etc groupadd video
-g
44
127 (pw
-V
${DESTDIR}/etc groupshow authpf
-q
> /dev
/null
) || \
128 pw
-V
${DESTDIR}/etc groupadd authpf
-g
63
129 (pw
-V
${DESTDIR}/etc groupshow _pflogd
-q
> /dev
/null
) || \
130 pw
-V
${DESTDIR}/etc groupadd _pflogd
-g
64
131 (pw
-V
${DESTDIR}/etc groupshow _sdpd
-q
> /dev
/null
) || \
132 pw
-V
${DESTDIR}/etc groupadd _sdpd
-g
70
133 (pw
-V
${DESTDIR}/etc groupshow _dhcp
-q
> /dev
/null
) || \
134 pw
-V
${DESTDIR}/etc groupadd _dhcp
-g
77
137 @if
[ -n
"`grep '^sendmail.*/usr/libexec/sendmail/sendmail' ${DESTDIR}/etc/mail/mailer.conf`" ]; then \
138 echo
"==================================================================" ; \
139 echo
"= sendmail is being removed from the base system." ; \
140 echo
"= /etc/mail/mailer.conf is still configured to use sendmail." ; \
141 echo
"= See http://www.dragonflybsd.com/docs/docs/newhandbook/mta/" ; \
142 echo
"= Quick: cp /usr/src/libexec/dma/mailer-conf/mailer.conf.dma " ; \
143 echo
"= ${DESTDIR}/etc/mail/mailer.conf ; make upgrade" ; \
144 echo
"==================================================================" ; \
148 upgrade_base
: upgrade_check preupgrade remove-obsolete-files
149 # files that should be dirs (not possible with Makefile_upgrade.inc)
150 .for f in usr
/include/dev
/misc
/ppi usr
/share
/initrd
/sbin
151 [ -d
${DESTDIR}/${f} ] ||
rm -f
${DESTDIR}/${f}
153 .if
!defined
(BINARY_UPGRADE
) # binary upgrade just copies these files
154 cd
${UPGRADE_SRCDIR}/..
/share
/mk
; ${MAKE} install
156 cd
${UPGRADE_SRCDIR}; \
157 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
158 ${BINUPDATE} ${DESTDIR}/etc
; \
159 cap_mkdb
${DESTDIR}/etc
/login.conf
; \
160 for f in
${BIN1}; do \
161 [ -e
"${DESTDIR}/etc/$${f##*/}" ] || \
162 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
163 $$f ${DESTDIR}/etc
; \
165 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
555 \
166 ${BIN2} ${DESTDIR}/etc
;
167 cd
${UPGRADE_SRCDIR}/defaults
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
168 ${DEFAULTS} ${DESTDIR}/etc
/defaults
169 cd
${UPGRADE_SRCDIR}/periodic
; ${MAKE} install
170 mkdir
-p
${DESTDIR}/etc
/rc.d
171 cd
${UPGRADE_SRCDIR}/rc.d
; ${MAKE} install
172 cd
${UPGRADE_SRCDIR}/devd
; ${MAKE} install
173 mkdir
-p
${DESTDIR}/etc
/autofs
174 cd
${UPGRADE_SRCDIR}/autofs
; ${MAKE} install
175 # "../share/termcap/make etc-termcap" expanded inline here:
176 ${LN} -fs
/usr
/share
/misc
/termcap
${DESTDIR}/etc
/termcap
177 # "../usr.sbin/rmt/make etc-rmt" expanded inline here:
178 ${LN} -fs
/usr
/sbin
/rmt
${DESTDIR}/etc
/rmt
179 cd
${UPGRADE_SRCDIR}/mtree
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
180 ${MTREE} ${DESTDIR}/etc
/mtree
181 cd
${UPGRADE_SRCDIR}/bluetooth
; ${MAKE} install
182 cd
${UPGRADE_SRCDIR}; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 Makefile.usr
${DESTDIR}/usr
/Makefile
183 .if
!exists
(${DESTDIR}/etc
/pam.d
)
184 mkdir
-p
${DESTDIR}/etc
/pam.d
185 cd
${UPGRADE_SRCDIR}/pam.d
; ${MAKE} install
186 sh
${DESTDIR}/etc
/pam.d
/convert.sh
${DESTDIR}/etc
/pam.d
${DESTDIR}/etc
/pam.conf
188 .for pamconf in README convert.sh atrun cron passwd su system
189 .if
!exists
(${DESTDIR}/etc
/pam.d
/${pamconf})
190 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 ${UPGRADE_SRCDIR}/pam.d
/${pamconf} ${DESTDIR}/etc
/pam.d
194 .if
!defined
(BINARY_UPGRADE
) # binary upgrade just copies these files
195 cd
${UPGRADE_SRCDIR}/..
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
196 COPYRIGHT
${DESTDIR}/
198 rm -f
${DESTDIR}/usr
/include/machine
/ioctl_meteor.h
199 rm -f
${DESTDIR}/usr
/include/machine
/ioctl_bt848.h
200 rm -f
${DESTDIR}/usr
/include/sys
/ata.h
201 ${LN} -s
"../dev/video/bktr/ioctl_bt848.h" ${DESTDIR}/usr
/include/machine
/ioctl_bt848.h
202 ${LN} -s
"../dev/video/meteor/ioctl_meteor.h" ${DESTDIR}/usr
/include/machine
/ioctl_meteor.h
203 ${LN} -s nata.h
${DESTDIR}/usr
/include/sys
/ata.h
204 .if exists
(${DESTDIR}/usr
/lib
/gcc2
)
205 ldconfig
-m
${DESTDIR}/usr
/lib
/gcc2
207 .for lib in
${COMPAT_LIBS
:M
*.so.
*}
208 .if exists
(${DESTDIR}/usr
/lib
/${lib})
209 chflags noschg
${DESTDIR}/usr
/lib
/${lib}
210 rm -f
${DESTDIR}/usr
/lib
/${lib}
213 cd
${.CURDIR
}/..
/lib
/libssh
; ${MAKE} -f Makefile.etc
install
214 .if exists
(${DESTDIR}/boot
)
215 .if exists
(${DESTDIR}/kernel
)
216 chflags noschg
${DESTDIR}/kernel
217 mv
${DESTDIR}/kernel
${DESTDIR}/boot
/kernel
218 chflags schg
${DESTDIR}/boot
/kernel
220 .if exists
(${DESTDIR}/modules
)
221 mv
${DESTDIR}/modules
${DESTDIR}/boot
/modules
222 rm -rf
${DESTDIR}/boot
/modules
/modules
224 .if exists
(${DESTDIR}/kernel.old
)
225 mv
${DESTDIR}/kernel.old
${DESTDIR}/boot
/kernel.old
227 .if exists
(${DESTDIR}/modules.old
)
228 mv
${DESTDIR}/modules.old
${DESTDIR}/boot
/modules.old
229 rm -rf
${DESTDIR}/boot
/modules.old
/modules.old
232 .if exists
(${DESTDIR}/etc
/settings.conf
)
233 mv
${DESTDIR}/etc
/settings.conf
${DESTDIR}/etc
/pkg_radd.conf
235 for ext in a so
.0; do \
236 f
=${DESTDIR}/usr
/lib
/libpthread.
$$ext; \
237 dest
=$$(readlink
"$$f"); \
239 libthread_xu.
*|libc_r.
*) \
240 ln
-fs thread
/$$dest $$f ;; \
244 mkdir
-p
${DESTDIR}/dev
245 mkdir
-p
${DESTDIR}/var
/run
/sem
246 chmod
1777 ${DESTDIR}/var
/run
/sem
248 # The existence of cleartext_pass_ok means pam config files are out of date.
249 @set
- `fgrep -e cleartext_pass_ok -e pam_opie ${DESTDIR}/etc/pam.d/*`; \
252 echo
"It appears your PAM configuration files need to be updated"; \
253 echo
"This can be done by manually editing the files or:"; \
254 echo
" cd ${UPGRADE_SRCDIR}/pam.d"; \
255 echo
" make install"; \
258 upgrade_etc
: upgrade_base remove-deprecated-files
259 @echo
"Upgrade was successful"
263 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
264 ${BINUPDATE} ${DESTDIR}/etc
; \
265 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
266 ${BIN1} ${DESTDIR}/etc
; \
267 cap_mkdb
${DESTDIR}/etc
/login.conf
; \
268 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
555 \
269 ${BIN2} ${DESTDIR}/etc
; \
270 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
600 \
271 master.passwd nsmb.conf opieaccess
${DESTDIR}/etc
; \
272 pwd_mkdb
-p
-d
${DESTDIR}/etc
${DESTDIR}/etc
/master.passwd
273 cd
${.CURDIR
}/defaults
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
274 ${DEFAULTS} ${DESTDIR}/etc
/defaults
275 cd
${.CURDIR
}/pam.d
; ${MAKE} install
276 cd
${.CURDIR
}/bluetooth
; ${MAKE} install
277 cd
${.CURDIR
}/periodic
; ${MAKE} install
278 cd
${.CURDIR
}/rc.d
; ${MAKE} install
279 cd
${.CURDIR
}/devd
; ${MAKE} install
280 cd
${.CURDIR
}/autofs
; ${MAKE} install
281 cd
${.CURDIR
}/..
/share
/termcap
; ${MAKE} etc-termcap
282 cd
${.CURDIR
}/..
/usr.sbin
/rmt
; ${MAKE} etc-rmt
284 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
285 Makefile.usr
${DESTDIR}/usr
/Makefile
287 .if exists
(${.CURDIR
}/..
/${dir}/Makefile.etc
)
288 cd
${.CURDIR
}/..
/${dir}; ${MAKE} -f Makefile.etc obj
289 cd
${.CURDIR
}/..
/${dir}; ${MAKE} -f Makefile.etc
install
292 mkdir
-p
${DESTDIR}/dev
293 cd
${.CURDIR
}/root
; \
294 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
295 dot.cshrc
${DESTDIR}/root
/.cshrc
; \
296 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
297 dot.klogin
${DESTDIR}/root
/.klogin
; \
298 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
299 dot.login
${DESTDIR}/root
/.login
; \
300 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
301 dot.profile
${DESTDIR}/root
/.profile
; \
302 rm -f
${DESTDIR}/.cshrc
${DESTDIR}/.profile
; \
303 cd
${.CURDIR
}/mtree
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
304 ${MTREE} ${DESTDIR}/etc
/mtree
305 cd
${.CURDIR
}/ppp
; ${INSTALL} -o root
-g
${BINGRP} -m
600 \
306 ${PPPCNF} ${DESTDIR}/etc
/ppp
307 cd
${.CURDIR
}/mail
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
308 ${ETCMAIL} ${DESTDIR}/etc
/mail
309 @if
[ -d
${DESTDIR}/etc
/mail
-a
-f
${DESTDIR}/etc
/mail
/aliases
-a \
310 ! -f
${DESTDIR}/etc
/aliases
]; then \
312 ${LN} -s mail
/aliases
${DESTDIR}/etc
/aliases
; \
314 ${INSTALL} -o
${BINOWN} -g operator
-m
664 /dev
/null \
315 ${DESTDIR}/etc
/dumpdates
316 ${INSTALL} -o nobody
-g
${BINGRP} -m
644 /dev
/null \
317 ${DESTDIR}/var
/db
/locate.database
318 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
600 /dev
/null \
319 ${DESTDIR}/var
/log
/auth.log
320 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
600 /dev
/null \
321 ${DESTDIR}/var
/log
/cron
322 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
640 /dev
/null \
323 ${DESTDIR}/var
/log
/daemon
324 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
325 ${DESTDIR}/var
/log
/lpd-errs
326 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
640 /dev
/null \
327 ${DESTDIR}/var
/log
/maillog
328 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
329 ${DESTDIR}/var
/log
/lastlog
330 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
331 ${DESTDIR}/var
/log
/lastlogx
332 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
333 ${DESTDIR}/var
/log
/messages
334 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
600 /dev
/null \
335 ${DESTDIR}/var
/log
/security
336 ${INSTALL} -o
${BINOWN} -g network
-m
640 /dev
/null \
337 ${DESTDIR}/var
/log
/slip.log
338 ${INSTALL} -o
${BINOWN} -g network
-m
640 /dev
/null \
339 ${DESTDIR}/var
/log
/ppp.log
340 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
341 ${DESTDIR}/var
/log
/wtmp
342 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
343 ${DESTDIR}/var
/log
/wtmpx
344 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
345 ${DESTDIR}/var
/run
/utmp
346 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
347 ${DESTDIR}/var
/run
/utmpx
348 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 ${.CURDIR
}/minfree \
350 cd
${.CURDIR
}/..
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
351 COPYRIGHT
${DESTDIR}/
352 rm -f
${DESTDIR}/usr
/include/machine
/ioctl_bt848.h
353 rm -f
${DESTDIR}/usr
/include/machine
/ioctl_meteor.h
354 rm -f
${DESTDIR}/usr
/include/sys
/ata.h
355 ${LN} -s
"../dev/video/bktr/ioctl_bt848.h" ${DESTDIR}/usr
/include/machine
/ioctl_bt848.h
356 ${LN} -s
"../dev/video/meteor/ioctl_meteor.h" ${DESTDIR}/usr
/include/machine
/ioctl_meteor.h
357 ${LN} -s nata.h
${DESTDIR}/usr
/include/sys
/ata.h
359 cd
${.CURDIR
}/..
/share
/man
; ${MAKE} makedb
365 mtree
-deU
-f
${.CURDIR
}/mtree
/BSD.root.
dist -p
${DESTDIR}/
366 mtree
-deU
-f
${.CURDIR
}/mtree
/BSD.var.
dist -p
${DESTDIR}/var
367 mtree
-deU
-f
${.CURDIR
}/mtree
/BSD.usr.
dist -p
${DESTDIR}/usr
368 mtree
-deU
-f
${.CURDIR
}/mtree
/BSD.
include.
dist \
369 -p
${DESTDIR}/usr
/include
370 -chflags xlink
${DESTDIR}/* ${DESTDIR}/usr
/* ${DESTDIR}/var
/* \
372 cd
${DESTDIR}/; test -e sys ||
(rm -f sys
; ${LN} -s usr
/src
/sys sys
)
373 .if
!defined
(NO_SHARE
)
374 cd
${DESTDIR}/usr
/share
/nls
; \
376 rm -rf
"en_US.US-ASCII"; \
377 ${LN} -s
"C" "POSIX"; \
378 ${LN} -s
"C" "en_US.US-ASCII"
382 cd
${.CURDIR
}; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
383 ${BINUPDATE} ${BIN1} ${BIN2} nsmb.conf opieaccess \
384 ${DESTDIR}/usr
/share
/examples
/etc
385 cd
${.CURDIR
}/defaults
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
386 ${DEFAULTS} ${DESTDIR}/usr
/share
/examples
/etc
/defaults
388 .
include <bsd.prog.mk
>