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 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 \ 27 crontab csh.cshrc csh.login csh.logout \ 28 devtab dhclient.conf dntpd.conf \ 29 ftpusers gettytab \ 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 39DIRS+= lib/libssh usr.bin/openssl usr.bin/ssh usr.sbin/sshd 40 41# Files that should be installed read-only-executable (555) root:wheel 42# 43BIN2= pccard_ether rc.suspend rc.resume 44 45DEFAULTS= compilers.conf devfs.conf make.conf periodic.conf \ 46 pfi.conf rc.conf uuids 47 48MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist 49.if !defined(NOFSCHG) 50MTREE_FSCHG= -i 51.endif 52 53PPPCNF= ppp.conf 54 55ETCMAIL=aliases mailer.conf access.sample virtusertable.sample \ 56 mailertable.sample 57 58# Use this directory as the source for new configuration files when upgrading 59UPGRADE_SRCDIR?=${.CURDIR} 60 61CHECK_DEPRECATED_DIRS+= /usr/local 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 83remove-deprecated-files: 84.if defined(REMOVE_DEPRECATED) 85 @echo "===> Remove now deprecated files" 86 @for item in ${TO_REMOVE_LATE}; do \ 87 if [ -e ${DESTDIR}$${item} -o -L ${DESTDIR}$${item} ]; then \ 88 echo "${DESTDIR}$${item}"; \ 89 chflags -Rf noschg "${DESTDIR}$${item}"; \ 90 rm -rf "${DESTDIR}$${item}"; \ 91 fi; \ 92 done; 93.else 94 @make check-deprecated-files 95.endif 96 97check-deprecated-files: 98 @echo "===> Checking for deprecated files" 99 @echo " (harmless ELF linker warnings may appear here)" 100 @tmpldd=`mktemp -t chkldd`; \ 101 chroot ${DESTDIR}/ find ${CHECK_DEPRECATED_DIRS:O:u} \ 102 -type f \( -name '*.so*' -o -perm +111 \) | \ 103 chroot ${DESTDIR}/ xargs ldd 2>/dev/null > $${tmpldd}; \ 104 count=0; for item in ${TO_REMOVE_LATE}; do \ 105 if [ -e ${DESTDIR}$${item} -o -L ${DESTDIR}$${item} ]; then \ 106 echo "${DESTDIR}$${item} is deprecated"; \ 107 deps=""; \ 108 for object in `cat $${tmpldd} | awk -v library=$${item} \ 109 -f ${.CURDIR}/../tools/tools/chkldd/chkldd.awk`; do \ 110 echo "${TO_REMOVE_LATE}" | grep -q "$${object}" \ 111 || deps="$${deps} $${object}"; \ 112 done; \ 113 if [ -n "$${deps}" ]; then \ 114 echo " but it's still linked from these objects:"; \ 115 echo " " $${deps}; \ 116 echo ""; \ 117 fi; \ 118 count=`expr $$count + 1`; \ 119 fi; \ 120 done; \ 121 rm $${tmpldd}; \ 122 if [ "$$count" -gt 0 ]; then \ 123 echo "==================================================================" ; \ 124 echo "= You have $$count now deprecated files." ; \ 125 echo "= Once you are sure that none of your third party (ports or local)" ; \ 126 echo "= software are still using them, rerun with:" ; \ 127 echo "= make upgrade -DREMOVE_DEPRECATED" ; \ 128 echo "==================================================================" ; \ 129 fi; 130 131preupgrade: 132 sh ${.CURDIR}/../tools/pw-update.sh \ 133 -d ${DESTDIR}/etc \ 134 -g ${.CURDIR}/group \ 135 -p ${.CURDIR}/master.passwd 136 137upgrade_check: 138 @if [ -n "`grep '^sendmail.*/usr/libexec/sendmail/sendmail' ${DESTDIR}/etc/mail/mailer.conf`" ]; then \ 139 echo "==================================================================" ; \ 140 echo "= sendmail is being removed from the base system." ; \ 141 echo "= /etc/mail/mailer.conf is still configured to use sendmail." ; \ 142 echo "= See http://www.dragonflybsd.com/docs/docs/newhandbook/mta/" ; \ 143 echo "= Quick: cp /usr/src/libexec/dma/mailer-conf/mailer.conf.dma " ; \ 144 echo "= ${DESTDIR}/etc/mail/mailer.conf ; make upgrade" ; \ 145 echo "==================================================================" ; \ 146 /usr/bin/false ; \ 147 fi 148 149upgrade_base: upgrade_check preupgrade remove-obsolete-files 150 # files that should be dirs (not possible with Makefile_upgrade.inc) 151.for f in usr/include/dev/misc/ppi usr/share/initrd/sbin var/db/entropy 152 [ -d ${DESTDIR}/${f} ] || rm -f ${DESTDIR}/${f} 153.endfor 154.if !defined(BINARY_UPGRADE) # binary upgrade just copies these files 155 cd ${UPGRADE_SRCDIR}/../share/mk; ${MAKE} install 156.endif 157 cd ${UPGRADE_SRCDIR}; \ 158 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 159 ${BINUPDATE} ${DESTDIR}/etc; \ 160 cap_mkdb ${DESTDIR}/etc/login.conf; \ 161 for f in ${BIN1}; do \ 162 [ -e "${DESTDIR}/etc/$${f##*/}" ] || \ 163 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 164 $$f ${DESTDIR}/etc; \ 165 done; \ 166 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \ 167 ${BIN2} ${DESTDIR}/etc 168 cd ${UPGRADE_SRCDIR}/defaults; \ 169 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 170 ${DEFAULTS} ${DESTDIR}/etc/defaults 171 cd ${UPGRADE_SRCDIR}/periodic; ${MAKE} install 172 mkdir -p ${DESTDIR}/etc/rc.d 173 cd ${UPGRADE_SRCDIR}/rc.d; ${MAKE} install 174 cd ${UPGRADE_SRCDIR}/devd; ${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; \ 180 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 181 ${MTREE} ${DESTDIR}/etc/mtree 182 cd ${UPGRADE_SRCDIR}/bluetooth; ${MAKE} install 183 cd ${UPGRADE_SRCDIR}/calendar; ${MAKE} install 184 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 185 ${UPGRADE_SRCDIR}/Makefile.usr ${DESTDIR}/usr/Makefile 186.if !exists(${DESTDIR}/etc/pam.d) 187 mkdir -p ${DESTDIR}/etc/pam.d 188 cd ${UPGRADE_SRCDIR}/pam.d; ${MAKE} install 189 sh ${DESTDIR}/etc/pam.d/convert.sh ${DESTDIR}/etc/pam.d \ 190 ${DESTDIR}/etc/pam.conf 191.else 192.for pamconf in README convert.sh atrun cron passwd su system 193.if !exists(${DESTDIR}/etc/pam.d/${pamconf}) 194 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 195 ${UPGRADE_SRCDIR}/pam.d/${pamconf} ${DESTDIR}/etc/pam.d 196.endif 197.endfor 198.endif 199.if !defined(BINARY_UPGRADE) # binary upgrade just copies these files 200 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 201 ${UPGRADE_SRCDIR}/../COPYRIGHT ${DESTDIR}/ 202.endif 203 rm -f ${DESTDIR}/usr/include/machine/ioctl_meteor.h 204 rm -f ${DESTDIR}/usr/include/machine/ioctl_bt848.h 205 ${LN} -s "../dev/video/bktr/ioctl_bt848.h" \ 206 ${DESTDIR}/usr/include/machine/ioctl_bt848.h 207 ${LN} -s "../dev/video/meteor/ioctl_meteor.h" \ 208 ${DESTDIR}/usr/include/machine/ioctl_meteor.h 209.if exists(${DESTDIR}/usr/lib/gcc2) 210 ldconfig -m ${DESTDIR}/usr/lib/gcc2 211.endif 212.for lib in ${COMPAT_LIBS:M*.so.*} 213.if exists(${DESTDIR}/usr/lib/${lib}) 214 chflags noschg ${DESTDIR}/usr/lib/${lib} 215 rm -f ${DESTDIR}/usr/lib/${lib} 216.endif 217.endfor 218 cd ${.CURDIR}/../lib/libssh; ${MAKE} -f Makefile.etc install 219.if exists(${DESTDIR}/boot) 220.if exists(${DESTDIR}/kernel) 221 chflags noschg ${DESTDIR}/kernel 222 mv ${DESTDIR}/kernel ${DESTDIR}/boot/kernel 223 chflags schg ${DESTDIR}/boot/kernel 224.endif 225.if exists(${DESTDIR}/modules) 226 mv ${DESTDIR}/modules ${DESTDIR}/boot/modules 227 rm -rf ${DESTDIR}/boot/modules/modules 228.endif 229.if exists(${DESTDIR}/kernel.old) 230 mv ${DESTDIR}/kernel.old ${DESTDIR}/boot/kernel.old 231.endif 232.if exists(${DESTDIR}/modules.old) 233 mv ${DESTDIR}/modules.old ${DESTDIR}/boot/modules.old 234 rm -rf ${DESTDIR}/boot/modules.old/modules.old 235.endif 236.endif 237.if exists(${DESTDIR}/etc/settings.conf) 238 mv ${DESTDIR}/etc/settings.conf ${DESTDIR}/etc/pkg_radd.conf 239.endif 240 for ext in a so.0; do \ 241 f=${DESTDIR}/usr/lib/libpthread.$$ext; \ 242 dest=$$(readlink "$$f"); \ 243 case "$$dest" in \ 244 libthread_xu.*) \ 245 ln -fs thread/$$dest $$f ;; \ 246 esac; \ 247 done 248 ldconfig -R 249 mkdir -p ${DESTDIR}/dev 250 mkdir -p ${DESTDIR}/var/run/sem 251 chmod 1777 ${DESTDIR}/var/run/sem 252 253# The existence of cleartext_pass_ok means pam config files are out of date. 254 @set - `fgrep -e cleartext_pass_ok -e pam_opie ${DESTDIR}/etc/pam.d/*`; \ 255 if [ $$# -gt 0 ] ; \ 256 then \ 257 echo "It appears your PAM configuration files need to be updated"; \ 258 echo "This can be done by manually editing the files or:"; \ 259 echo " cd ${UPGRADE_SRCDIR}/pam.d"; \ 260 echo " make install"; \ 261 fi 262 263# Move the dhcpcd duid, secret and lease files back outside the chroot. 264# Then ensure the chroot is empty. 265 DHCPCD_DB="${DESTDIR}/var/db/dhcpcd"; \ 266 DHCPCD_CHROOT=`pw -V ${DESTDIR}/etc usershow _dhcp | cut -d: -f9`; \ 267 DHCPCD_CHROOT_DB="${DESTDIR}$$DHCPCD_CHROOT/var/db/dhcpcd"; \ 268 if [ -f "$$DHCPCD_CHROOT_DB/duid" ] && \ 269 [ ! -f "$$DHCPCD_DB/duid" ]; then \ 270 mkdir -p "$$DHCPCD_DB" && \ 271 mv "$$DHCPCD_CHROOT_DB"/* "$$DHCPCD_DB"; \ 272 chown -R root:wheel "$$DHCPCD_DB"; \ 273 rm -rf "$$DHCPCD_CHROOT"/*; \ 274 fi; \ 275 if [ "$$DHCPCD_CHROOT" != /var/empty ]; then \ 276 pw -V ${DESTDIR}/etc usermod _dhcp -d /var/empty; \ 277 rm -rf "$$DHCPCD_CHROOT"; \ 278 fi 279 280upgrade_etc: upgrade_base remove-deprecated-files 281 @echo "Upgrade was successful" 282 283distribution: 284 cd ${.CURDIR}; \ 285 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 286 ${BINUPDATE} ${DESTDIR}/etc; \ 287 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 288 ${BIN1} group ${DESTDIR}/etc; \ 289 cap_mkdb ${DESTDIR}/etc/login.conf; \ 290 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \ 291 ${BIN2} ${DESTDIR}/etc; \ 292 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ 293 master.passwd nsmb.conf ${DESTDIR}/etc; \ 294 pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd 295 cd ${.CURDIR}/defaults; \ 296 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 297 ${DEFAULTS} ${DESTDIR}/etc/defaults 298 cd ${.CURDIR}/pam.d; ${MAKE} install 299 cd ${.CURDIR}/bluetooth; ${MAKE} install 300 cd ${.CURDIR}/calendar; ${MAKE} install 301 cd ${.CURDIR}/periodic; ${MAKE} install 302 cd ${.CURDIR}/rc.d; ${MAKE} install 303 cd ${.CURDIR}/devd; ${MAKE} install 304 cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap 305 cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt 306 cd ${.CURDIR}; \ 307 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 308 Makefile.usr ${DESTDIR}/usr/Makefile 309.for dir in ${DIRS} 310.if exists(${.CURDIR}/../${dir}/Makefile.etc) 311 cd ${.CURDIR}/../${dir}; ${MAKE} -f Makefile.etc obj 312 cd ${.CURDIR}/../${dir}; ${MAKE} -f Makefile.etc install 313.endif 314.endfor 315 mkdir -p ${DESTDIR}/dev 316 cd ${.CURDIR}/../share/skel; \ 317 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 318 dot.cshrc ${DESTDIR}/root/.cshrc; \ 319 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 320 dot.login ${DESTDIR}/root/.login; \ 321 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 322 dot.profile ${DESTDIR}/root/.profile; \ 323 rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \ 324 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 325 ${MTREE} ${DESTDIR}/etc/mtree 326 cd ${.CURDIR}/ppp; ${INSTALL} -o root -g ${BINGRP} -m 600 \ 327 ${PPPCNF} ${DESTDIR}/etc/ppp 328 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 329 ${ETCMAIL} ${DESTDIR}/etc/mail 330 @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ 331 ! -f ${DESTDIR}/etc/aliases ]; then \ 332 set -x; \ 333 ${LN} -s mail/aliases ${DESTDIR}/etc/aliases; \ 334 fi 335 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \ 336 ${DESTDIR}/etc/dumpdates 337 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \ 338 ${DESTDIR}/var/db/locate.database 339 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 340 ${DESTDIR}/var/log/auth.log 341 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 342 ${DESTDIR}/var/log/cron 343 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \ 344 ${DESTDIR}/var/log/daemon 345 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 346 ${DESTDIR}/var/log/lpd-errs 347 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \ 348 ${DESTDIR}/var/log/maillog 349 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 350 ${DESTDIR}/var/log/lastlogx 351 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 352 ${DESTDIR}/var/log/messages 353 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 354 ${DESTDIR}/var/log/security 355 ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \ 356 ${DESTDIR}/var/log/slip.log 357 ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \ 358 ${DESTDIR}/var/log/ppp.log 359 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 360 ${DESTDIR}/var/log/wtmpx 361 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 362 ${DESTDIR}/var/run/utmpx 363 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \ 364 ${DESTDIR}/var/crash 365 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 366 ${.CURDIR}/../COPYRIGHT ${DESTDIR}/ 367 rm -f ${DESTDIR}/usr/include/machine/ioctl_bt848.h 368 rm -f ${DESTDIR}/usr/include/machine/ioctl_meteor.h 369 ${LN} -s "../dev/video/bktr/ioctl_bt848.h" \ 370 ${DESTDIR}/usr/include/machine/ioctl_bt848.h 371 ${LN} -s "../dev/video/meteor/ioctl_meteor.h" \ 372 ${DESTDIR}/usr/include/machine/ioctl_meteor.h 373.if !defined(NOMAN) 374 cd ${.CURDIR}/../share/man; ${MAKE} makedb 375.endif 376 377# 378# 379distrib-dirs: 380 mtree ${MTREE_FSCHG} -deU -f ${.CURDIR}/mtree/BSD.root.dist \ 381 -p ${DESTDIR}/ 382 mtree ${MTREE_FSCHG} -deU -f ${.CURDIR}/mtree/BSD.var.dist \ 383 -p ${DESTDIR}/var 384 mtree ${MTREE_FSCHG} -deU -f ${.CURDIR}/mtree/BSD.usr.dist \ 385 -p ${DESTDIR}/usr 386 mtree ${MTREE_FSCHG} -deU -f ${.CURDIR}/mtree/BSD.include.dist \ 387 -p ${DESTDIR}/usr/include 388 -chflags xlink ${DESTDIR}/* ${DESTDIR}/usr/* ${DESTDIR}/var/* \ 389 ${DESTDIR}/home/* 390 cd ${DESTDIR}/; test -e sys || (rm -f sys; ${LN} -s usr/src/sys sys) 391.if !defined(NO_SHARE) 392 cd ${DESTDIR}/usr/share/nls; \ 393 rm -rf "POSIX"; \ 394 rm -rf "en_US.US-ASCII"; \ 395 ${LN} -s "C" "POSIX"; \ 396 ${LN} -s "C" "en_US.US-ASCII" 397.endif 398 399etc-examples: 400 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 401 ${BINUPDATE} ${BIN1} ${BIN2} nsmb.conf \ 402 ${DESTDIR}/usr/share/examples/etc 403 cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 404 ${DEFAULTS} ${DESTDIR}/usr/share/examples/etc/defaults 405 406.include <bsd.prog.mk> 407