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