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 \
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
22 # Initial distribution files are installed read-write (644)
24 BIN1
= auth.conf auto_master \
25 crontab csh.cshrc csh.login csh.logout \
26 devtab dhclient.conf dntpd.conf \
28 hosts hosts.allow hosts.equiv hosts.lpd \
29 inetd.conf login.access login.conf \
30 motd modems netconfig networks newsyslog.conf \
31 nscd.conf pf.conf phones printcap profile \
32 regdomain.xml remote sensorsd.conf services \
33 shells sysctl.conf syslog.conf \
35 etc.
${MACHINE_ARCH}/ttys
36 .if defined
(BINARY_UPGRADE
) # location of these depends on upgrade method
39 BIN1
+= ${.CURDIR
}/..
/gnu
/usr.bin
/man
/manpath
/manpath.config
42 .if
!defined
(NO_CRYPT
)
49 # Files that should be installed read-only-executable (555) root:wheel
51 BIN2
= pccard_ether rc.firewall rc.suspend rc.resume
53 DEFAULTS
= compilers.conf devfs.conf make.conf mkinitrd.conf periodic.conf \
54 pfi.conf rc.conf uuids
56 MTREE
= BSD.
include.
dist BSD.local.
dist BSD.root.
dist BSD.usr.
dist \
61 ETCMAIL
=aliases mailer.conf access.sample virtusertable.sample \
64 # Use this directory as the source for new configuration files when upgrading
65 UPGRADE_SRCDIR?
=${.CURDIR
}
67 # Include file which contains obsolete files
68 .if exists
(${DESTDIR}/etc
/upgrade
/Makefile_upgrade.inc
)
69 .
include "${DESTDIR}/etc/upgrade/Makefile_upgrade.inc"
72 remove-obsolete-files
:
73 @if
[ -z
"${TO_REMOVE}" ]; then \
74 echo
"Please do a 'make installworld' first."; \
75 echo
"See build(7) for further information."; \
78 @echo
"===> Remove now obsolete files"
79 @for item in
${TO_REMOVE}; do \
80 if
[ -e
${DESTDIR}$${item} -o
-L
${DESTDIR}$${item} ]; then \
81 echo
"${DESTDIR}$${item}"; \
82 chflags
-Rf noschg
"${DESTDIR}$${item}"; \
83 rm -rf
"${DESTDIR}$${item}"; \
86 @for item in
${TO_REMOVE
:M
*/man
/man
[1-9]/*:C@
/man
/man
([1-9])/@
/man
/cat\
1/@g
}; do \
87 if
[ -e
${DESTDIR}$${item} ]; then \
88 echo
"${DESTDIR}$${item}"; \
89 chflags
-Rf noschg
"${DESTDIR}$${item}"; \
90 rm -rf
"${DESTDIR}$${item}"; \
94 remove-deprecated-files
:
95 .if defined
(REMOVE_DEPRECATED
)
96 @echo
"===> Remove now deprecated files"
97 @for item in
${TO_REMOVE_LATE}; do \
98 if
[ -e
${DESTDIR}$${item} -o
-L
${DESTDIR}$${item} ]; then \
99 echo
"${DESTDIR}$${item}"; \
100 chflags
-Rf noschg
"${DESTDIR}$${item}"; \
101 rm -rf
"${DESTDIR}$${item}"; \
105 @echo
"===> Checking for deprecated files"
106 @count
=0; for item in
${TO_REMOVE_LATE}; do \
107 if
[ -e
${DESTDIR}$${item} -o
-L
${DESTDIR}$${item} ]; then \
108 echo
"${DESTDIR}$${item} is deprecated"; \
109 count
=`expr $$count + 1`; \
112 if
[ "$$count" -gt
0 ]; then \
113 echo
"==================================================================" ; \
114 echo
"= You have $$count now deprecated files." ; \
115 echo
"= Once you are sure that none of your third party (ports or local)" ; \
116 echo
"= software are still using them, rerun with REMOVE_DEPRECATED set." ; \
117 echo
"==================================================================" ; \
122 (pw
-V
${DESTDIR}/etc usershow mail
-q
> /dev
/null
) || \
123 pw
-V
${DESTDIR}/etc useradd mail
-u
6 -g
6 \
125 -d
/nonexistent
-s
/sbin
/nologin
126 (pw
-V
${DESTDIR}/etc usershow _pflogd
-q
> /dev
/null
) || \
127 pw
-V
${DESTDIR}/etc useradd _pflogd
-u
64 \
128 -c
"pflogd privsep user" \
129 -d
/var
/empty
-s
/sbin
/nologin
130 (pw
-V
${DESTDIR}/etc usershow _sdpd
-q
> /dev
/null
) || \
131 pw
-V
${DESTDIR}/etc useradd _sdpd
-u
70 \
132 -c
"sdpd privsep user" \
133 -d
/var
/empty
-s
/sbin
/nologin
134 (pw
-V
${DESTDIR}/etc usershow _dhcp
-q
> /dev
/null
) || \
135 pw
-V
${DESTDIR}/etc useradd _dhcp
-u
77 \
137 -d
/var
/empty
-s
/sbin
/nologin
138 (pw
-V
${DESTDIR}/etc groupshow video
-q
> /dev
/null
) || \
139 pw
-V
${DESTDIR}/etc groupadd video
-g
44
140 (pw
-V
${DESTDIR}/etc groupshow authpf
-q
> /dev
/null
) || \
141 pw
-V
${DESTDIR}/etc groupadd authpf
-g
63
142 (pw
-V
${DESTDIR}/etc groupshow _pflogd
-q
> /dev
/null
) || \
143 pw
-V
${DESTDIR}/etc groupadd _pflogd
-g
64
144 (pw
-V
${DESTDIR}/etc groupshow _sdpd
-q
> /dev
/null
) || \
145 pw
-V
${DESTDIR}/etc groupadd _sdpd
-g
70
146 (pw
-V
${DESTDIR}/etc groupshow _dhcp
-q
> /dev
/null
) || \
147 pw
-V
${DESTDIR}/etc groupadd _dhcp
-g
77
150 @if
[ -n
"`grep '^sendmail.*/usr/libexec/sendmail/sendmail' ${DESTDIR}/etc/mail/mailer.conf`" ]; then \
151 echo
"==================================================================" ; \
152 echo
"= sendmail is being removed from the base system." ; \
153 echo
"= /etc/mail/mailer.conf is still configured to use sendmail." ; \
154 echo
"= See http://www.dragonflybsd.com/docs/docs/newhandbook/mta/" ; \
155 echo
"= Quick: cp /usr/src/libexec/dma/mailer-conf/mailer.conf.dma " ; \
156 echo
"= ${DESTDIR}/etc/mail/mailer.conf ; make upgrade" ; \
157 echo
"==================================================================" ; \
161 upgrade_base
: upgrade_check preupgrade remove-obsolete-files
162 # files that should be dirs (not possible with Makefile_upgrade.inc)
163 .for f in usr
/include/dev
/misc
/ppi usr
/share
/initrd
/sbin
164 [ -d
${DESTDIR}/${f} ] ||
rm -f
${DESTDIR}/${f}
166 .if
!defined
(BINARY_UPGRADE
) # binary upgrade just copies these files
167 cd
${UPGRADE_SRCDIR}/..
/share
/mk
; ${MAKE} install
169 cd
${UPGRADE_SRCDIR}; \
170 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
171 ${BINUPDATE} ${DESTDIR}/etc
; \
172 cap_mkdb
${DESTDIR}/etc
/login.conf
; \
173 for f in
${BIN1}; do \
174 [ -e
"${DESTDIR}/etc/$${f##*/}" ] || \
175 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
176 $$f ${DESTDIR}/etc
; \
178 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
555 \
179 ${BIN2} ${DESTDIR}/etc
;
180 cd
${UPGRADE_SRCDIR}/defaults
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
181 ${DEFAULTS} ${DESTDIR}/etc
/defaults
182 cd
${UPGRADE_SRCDIR}/periodic
; ${MAKE} install
183 mkdir
-p
${DESTDIR}/etc
/rc.d
184 cd
${UPGRADE_SRCDIR}/rc.d
; ${MAKE} install
185 cd
${UPGRADE_SRCDIR}/devd
; ${MAKE} install
186 mkdir
-p
${DESTDIR}/etc
/autofs
187 cd
${UPGRADE_SRCDIR}/autofs
; ${MAKE} install
188 # "../share/termcap/make etc-termcap" expanded inline here:
189 ${LN} -fs
/usr
/share
/misc
/termcap
${DESTDIR}/etc
/termcap
190 # "../usr.sbin/rmt/make etc-rmt" expanded inline here:
191 ${LN} -fs
/usr
/sbin
/rmt
${DESTDIR}/etc
/rmt
192 cd
${UPGRADE_SRCDIR}/mtree
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
193 ${MTREE} ${DESTDIR}/etc
/mtree
194 cd
${UPGRADE_SRCDIR}/bluetooth
; ${MAKE} install
195 cd
${UPGRADE_SRCDIR}; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 Makefile.usr
${DESTDIR}/usr
/Makefile
196 .if
!exists
(${DESTDIR}/etc
/pam.d
)
197 mkdir
-p
${DESTDIR}/etc
/pam.d
198 cd
${UPGRADE_SRCDIR}/pam.d
; ${MAKE} install
199 sh
${DESTDIR}/etc
/pam.d
/convert.sh
${DESTDIR}/etc
/pam.d
${DESTDIR}/etc
/pam.conf
201 .for pamconf in README convert.sh atrun cron passwd rsh su system
202 .if
!exists
(${DESTDIR}/etc
/pam.d
/${pamconf})
203 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 ${UPGRADE_SRCDIR}/pam.d
/${pamconf} ${DESTDIR}/etc
/pam.d
207 .if
!defined
(BINARY_UPGRADE
) # binary upgrade just copies these files
208 cd
${UPGRADE_SRCDIR}/..
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
209 COPYRIGHT
${DESTDIR}/
211 rm -f
${DESTDIR}/usr
/include/machine
/ioctl_meteor.h
212 rm -f
${DESTDIR}/usr
/include/machine
/ioctl_bt848.h
213 rm -f
${DESTDIR}/usr
/include/sys
/ata.h
214 ${LN} -s
"../dev/video/bktr/ioctl_bt848.h" ${DESTDIR}/usr
/include/machine
/ioctl_bt848.h
215 ${LN} -s
"../dev/video/meteor/ioctl_meteor.h" ${DESTDIR}/usr
/include/machine
/ioctl_meteor.h
216 ${LN} -s nata.h
${DESTDIR}/usr
/include/sys
/ata.h
217 .if exists
(${DESTDIR}/usr
/lib
/gcc2
)
218 ldconfig
-m
${DESTDIR}/usr
/lib
/gcc2
220 .for lib in
${COMPAT_LIBS
:M
*.so.
*}
221 .if exists
(${DESTDIR}/usr
/lib
/${lib})
222 chflags noschg
${DESTDIR}/usr
/lib
/${lib}
223 rm -f
${DESTDIR}/usr
/lib
/${lib}
226 cd
${.CURDIR
}/..
/lib
/libssh
; ${MAKE} -f Makefile.etc obj
227 cd
${.CURDIR
}/..
/lib
/libssh
; ${MAKE} -f Makefile.etc
install
228 .if exists
(${DESTDIR}/boot
)
229 .if exists
(${DESTDIR}/kernel
)
230 chflags noschg
${DESTDIR}/kernel
231 mv
${DESTDIR}/kernel
${DESTDIR}/boot
/kernel
232 chflags schg
${DESTDIR}/boot
/kernel
234 .if exists
(${DESTDIR}/modules
)
235 mv
${DESTDIR}/modules
${DESTDIR}/boot
/modules
236 rm -rf
${DESTDIR}/boot
/modules
/modules
238 .if exists
(${DESTDIR}/kernel.old
)
239 mv
${DESTDIR}/kernel.old
${DESTDIR}/boot
/kernel.old
241 .if exists
(${DESTDIR}/modules.old
)
242 mv
${DESTDIR}/modules.old
${DESTDIR}/boot
/modules.old
243 rm -rf
${DESTDIR}/boot
/modules.old
/modules.old
246 .if exists
(${DESTDIR}/etc
/settings.conf
)
247 mv
${DESTDIR}/etc
/settings.conf
${DESTDIR}/etc
/pkg_radd.conf
249 for ext in a so
.0; do \
250 f
=${DESTDIR}/usr
/lib
/libpthread.
$$ext; \
251 dest
=$$(readlink
"$$f"); \
253 libthread_xu.
*|libc_r.
*) \
254 ln
-fs thread
/$$dest $$f ;; \
258 mkdir
-p
${DESTDIR}/dev
259 mkdir
-p
${DESTDIR}/var
/run
/sem
260 chmod
1777 ${DESTDIR}/var
/run
/sem
262 # The existence of cleartext_pass_ok means pam config files are out of date.
263 @set
- `fgrep cleartext_pass_ok ${DESTDIR}/etc/pam.d/*`; \
266 echo
"It appears your PAM configuration files need to be updated"; \
267 echo
"This can be done by manually editing the files or:"; \
268 echo
" cd ${UPGRADE_SRCDIR}/pam.d"; \
269 echo
" make install"; \
272 upgrade_etc
: upgrade_base remove-deprecated-files
273 @echo
"Upgrade was successful"
277 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
278 ${BINUPDATE} ${DESTDIR}/etc
; \
279 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
280 ${BIN1} ${DESTDIR}/etc
; \
281 cap_mkdb
${DESTDIR}/etc
/login.conf
; \
282 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
555 \
283 ${BIN2} ${DESTDIR}/etc
; \
284 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
600 \
285 master.passwd nsmb.conf opieaccess
${DESTDIR}/etc
; \
286 pwd_mkdb
-p
-d
${DESTDIR}/etc
${DESTDIR}/etc
/master.passwd
287 cd
${.CURDIR
}/defaults
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
288 ${DEFAULTS} ${DESTDIR}/etc
/defaults
289 cd
${.CURDIR
}/pam.d
; ${MAKE} install
290 cd
${.CURDIR
}/bluetooth
; ${MAKE} install
291 cd
${.CURDIR
}/periodic
; ${MAKE} install
292 cd
${.CURDIR
}/rc.d
; ${MAKE} install
293 cd
${.CURDIR
}/devd
; ${MAKE} install
294 cd
${.CURDIR
}/autofs
; ${MAKE} install
295 cd
${.CURDIR
}/..
/share
/termcap
; ${MAKE} etc-termcap
296 cd
${.CURDIR
}/..
/usr.sbin
/rmt
; ${MAKE} etc-rmt
298 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
299 Makefile.usr
${DESTDIR}/usr
/Makefile
301 .if exists
(${.CURDIR
}/..
/${dir}/Makefile.etc
)
302 cd
${.CURDIR
}/..
/${dir}; ${MAKE} -f Makefile.etc obj
303 cd
${.CURDIR
}/..
/${dir}; ${MAKE} -f Makefile.etc
install
306 mkdir
-p
${DESTDIR}/dev
307 cd
${.CURDIR
}/root
; \
308 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
309 dot.cshrc
${DESTDIR}/root
/.cshrc
; \
310 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
311 dot.klogin
${DESTDIR}/root
/.klogin
; \
312 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
313 dot.login
${DESTDIR}/root
/.login
; \
314 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
315 dot.profile
${DESTDIR}/root
/.profile
; \
316 rm -f
${DESTDIR}/.cshrc
${DESTDIR}/.profile
; \
317 cd
${.CURDIR
}/mtree
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
318 ${MTREE} ${DESTDIR}/etc
/mtree
319 cd
${.CURDIR
}/ppp
; ${INSTALL} -o root
-g
${BINGRP} -m
600 \
320 ${PPPCNF} ${DESTDIR}/etc
/ppp
321 cd
${.CURDIR
}/mail
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 \
322 ${ETCMAIL} ${DESTDIR}/etc
/mail
323 @if
[ -d
${DESTDIR}/etc
/mail
-a
-f
${DESTDIR}/etc
/mail
/aliases
-a \
324 ! -f
${DESTDIR}/etc
/aliases
]; then \
326 ${LN} -s mail
/aliases
${DESTDIR}/etc
/aliases
; \
328 ${INSTALL} -o
${BINOWN} -g operator
-m
664 /dev
/null \
329 ${DESTDIR}/etc
/dumpdates
330 ${INSTALL} -o nobody
-g
${BINGRP} -m
644 /dev
/null \
331 ${DESTDIR}/var
/db
/locate.database
332 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
600 /dev
/null \
333 ${DESTDIR}/var
/log
/auth.log
334 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
600 /dev
/null \
335 ${DESTDIR}/var
/log
/cron
336 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
640 /dev
/null \
337 ${DESTDIR}/var
/log
/daemon
338 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
339 ${DESTDIR}/var
/log
/lpd-errs
340 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
640 /dev
/null \
341 ${DESTDIR}/var
/log
/maillog
342 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
343 ${DESTDIR}/var
/log
/lastlog
344 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
345 ${DESTDIR}/var
/log
/lastlogx
346 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
347 ${DESTDIR}/var
/log
/messages
348 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
600 /dev
/null \
349 ${DESTDIR}/var
/log
/security
350 ${INSTALL} -o
${BINOWN} -g network
-m
640 /dev
/null \
351 ${DESTDIR}/var
/log
/slip.log
352 ${INSTALL} -o
${BINOWN} -g network
-m
640 /dev
/null \
353 ${DESTDIR}/var
/log
/ppp.log
354 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
355 ${DESTDIR}/var
/log
/wtmp
356 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
357 ${DESTDIR}/var
/log
/wtmpx
358 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
359 ${DESTDIR}/var
/run
/utmp
360 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 /dev
/null \
361 ${DESTDIR}/var
/run
/utmpx
362 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
644 ${.CURDIR
}/minfree \
364 cd
${.CURDIR
}/..
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
365 COPYRIGHT
${DESTDIR}/
366 rm -f
${DESTDIR}/usr
/include/machine
/ioctl_bt848.h
367 rm -f
${DESTDIR}/usr
/include/machine
/ioctl_meteor.h
368 rm -f
${DESTDIR}/usr
/include/sys
/ata.h
369 ${LN} -s
"../dev/video/bktr/ioctl_bt848.h" ${DESTDIR}/usr
/include/machine
/ioctl_bt848.h
370 ${LN} -s
"../dev/video/meteor/ioctl_meteor.h" ${DESTDIR}/usr
/include/machine
/ioctl_meteor.h
371 ${LN} -s nata.h
${DESTDIR}/usr
/include/sys
/ata.h
373 cd
${.CURDIR
}/..
/share
/man
; ${MAKE} makedb
379 mtree
-deU
-f
${.CURDIR
}/mtree
/BSD.root.
dist -p
${DESTDIR}/
380 mtree
-deU
-f
${.CURDIR
}/mtree
/BSD.var.
dist -p
${DESTDIR}/var
381 mtree
-deU
-f
${.CURDIR
}/mtree
/BSD.usr.
dist -p
${DESTDIR}/usr
382 mtree
-deU
-f
${.CURDIR
}/mtree
/BSD.
include.
dist \
383 -p
${DESTDIR}/usr
/include
384 -chflags xlink
${DESTDIR}/* ${DESTDIR}/usr
/* ${DESTDIR}/var
/* \
386 cd
${DESTDIR}/; test -e sys ||
(rm -f sys
; ${LN} -s usr
/src
/sys sys
)
387 .if
!defined
(NO_SHARE
)
388 cd
${DESTDIR}/usr
/share
/nls
; \
389 set
- `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
390 while
[ $$# -gt 0 ] ; \
393 ${LN} -s
"$$2" "$$1"; \
399 cd
${.CURDIR
}; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
400 ${BINUPDATE} ${BIN1} ${BIN2} nsmb.conf opieaccess \
401 ${DESTDIR}/usr
/share
/examples
/etc
402 cd
${.CURDIR
}/defaults
; ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
444 \
403 ${DEFAULTS} ${DESTDIR}/usr
/share
/examples
/etc
/defaults
405 .
include <bsd.prog.mk
>