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 regdomain.xml 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 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 # dhcpcd had been made to chroot into /var/chroot/dhcp, which however 264 # is inappropriate, so move the dhcpcd duid, secret and lease files 265 # back and ensure the chroot (/var/empty) is empty. 266 DHCPCD_DB="${DESTDIR}/var/db/dhcpcd"; \ 267 DHCPCD_CHROOT="/var/chroot/dhcp"; \ 268 DHCPCD_CHROOT_DB="${DESTDIR}$$DHCPCD_CHROOT/var/db/dhcpcd"; \ 269 if [ -f "$$DHCPCD_CHROOT_DB/duid" ] && \ 270 [ ! -f "$$DHCPCD_DB/duid" ]; then \ 271 mv "$$DHCPCD_CHROOT_DB"/* "$$DHCPCD_DB"; \ 272 chown -R root:wheel "$$DHCPCD_DB"; \ 273 rm -rf "$$DHCPCD_CHROOT"; \ 274 fi 275 sh ${.CURDIR}/../tools/pw-update.sh \ 276 -d ${DESTDIR}/etc \ 277 -g ${.CURDIR}/group \ 278 -p ${.CURDIR}/master.passwd \ 279 -U _dhcp 280 281upgrade_etc: upgrade_base remove-deprecated-files 282 @echo "Upgrade was successful" 283 284distribution: 285 cd ${.CURDIR}; \ 286 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 287 ${BINUPDATE} ${DESTDIR}/etc; \ 288 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 289 ${BIN1} group ${DESTDIR}/etc; \ 290 cap_mkdb ${DESTDIR}/etc/login.conf; \ 291 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \ 292 ${BIN2} ${DESTDIR}/etc; \ 293 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ 294 master.passwd nsmb.conf ${DESTDIR}/etc; \ 295 pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd 296 cd ${.CURDIR}/defaults; \ 297 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 298 ${DEFAULTS} ${DESTDIR}/etc/defaults 299 cd ${.CURDIR}/pam.d; ${MAKE} install 300 cd ${.CURDIR}/bluetooth; ${MAKE} install 301 cd ${.CURDIR}/calendar; ${MAKE} install 302 cd ${.CURDIR}/periodic; ${MAKE} install 303 cd ${.CURDIR}/rc.d; ${MAKE} install 304 cd ${.CURDIR}/devd; ${MAKE} install 305 cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap 306 cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt 307 cd ${.CURDIR}; \ 308 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 309 Makefile.usr ${DESTDIR}/usr/Makefile 310.for dir in ${DIRS} 311.if exists(${.CURDIR}/../${dir}/Makefile.etc) 312 cd ${.CURDIR}/../${dir}; ${MAKE} -f Makefile.etc obj 313 cd ${.CURDIR}/../${dir}; ${MAKE} -f Makefile.etc install 314.endif 315.endfor 316 mkdir -p ${DESTDIR}/dev 317 cd ${.CURDIR}/../share/skel; \ 318 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 319 dot.cshrc ${DESTDIR}/root/.cshrc; \ 320 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 321 dot.login ${DESTDIR}/root/.login; \ 322 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 323 dot.profile ${DESTDIR}/root/.profile; \ 324 rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \ 325 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 326 ${MTREE} ${DESTDIR}/etc/mtree 327 cd ${.CURDIR}/ppp; ${INSTALL} -o root -g ${BINGRP} -m 600 \ 328 ${PPPCNF} ${DESTDIR}/etc/ppp 329 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 330 ${ETCMAIL} ${DESTDIR}/etc/mail 331 @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ 332 ! -f ${DESTDIR}/etc/aliases ]; then \ 333 set -x; \ 334 ${LN} -s mail/aliases ${DESTDIR}/etc/aliases; \ 335 fi 336 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \ 337 ${DESTDIR}/etc/dumpdates 338 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \ 339 ${DESTDIR}/var/db/locate.database 340 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 341 ${DESTDIR}/var/log/auth.log 342 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 343 ${DESTDIR}/var/log/cron 344 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \ 345 ${DESTDIR}/var/log/daemon 346 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 347 ${DESTDIR}/var/log/lpd-errs 348 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \ 349 ${DESTDIR}/var/log/maillog 350 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 351 ${DESTDIR}/var/log/lastlogx 352 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 353 ${DESTDIR}/var/log/messages 354 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 355 ${DESTDIR}/var/log/security 356 ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \ 357 ${DESTDIR}/var/log/slip.log 358 ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \ 359 ${DESTDIR}/var/log/ppp.log 360 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 361 ${DESTDIR}/var/log/wtmpx 362 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 363 ${DESTDIR}/var/run/utmpx 364 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \ 365 ${DESTDIR}/var/crash 366 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 367 ${.CURDIR}/../COPYRIGHT ${DESTDIR}/ 368 rm -f ${DESTDIR}/usr/include/machine/ioctl_bt848.h 369 rm -f ${DESTDIR}/usr/include/machine/ioctl_meteor.h 370 ${LN} -s "../dev/video/bktr/ioctl_bt848.h" \ 371 ${DESTDIR}/usr/include/machine/ioctl_bt848.h 372 ${LN} -s "../dev/video/meteor/ioctl_meteor.h" \ 373 ${DESTDIR}/usr/include/machine/ioctl_meteor.h 374.if !defined(NOMAN) 375 cd ${.CURDIR}/../share/man; ${MAKE} makedb 376.endif 377 378# 379# 380distrib-dirs: 381 mtree ${MTREE_FSCHG} -deU -f ${.CURDIR}/mtree/BSD.root.dist \ 382 -p ${DESTDIR}/ 383 mtree ${MTREE_FSCHG} -deU -f ${.CURDIR}/mtree/BSD.var.dist \ 384 -p ${DESTDIR}/var 385 mtree ${MTREE_FSCHG} -deU -f ${.CURDIR}/mtree/BSD.usr.dist \ 386 -p ${DESTDIR}/usr 387 mtree ${MTREE_FSCHG} -deU -f ${.CURDIR}/mtree/BSD.include.dist \ 388 -p ${DESTDIR}/usr/include 389 -chflags xlink ${DESTDIR}/* ${DESTDIR}/usr/* ${DESTDIR}/var/* \ 390 ${DESTDIR}/home/* 391 cd ${DESTDIR}/; test -e sys || (rm -f sys; ${LN} -s usr/src/sys sys) 392.if !defined(NO_SHARE) 393 cd ${DESTDIR}/usr/share/nls; \ 394 rm -rf "POSIX"; \ 395 rm -rf "en_US.US-ASCII"; \ 396 ${LN} -s "C" "POSIX"; \ 397 ${LN} -s "C" "en_US.US-ASCII" 398.endif 399 400etc-examples: 401 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 402 ${BINUPDATE} ${BIN1} ${BIN2} \ 403 group master.passwd nsmb.conf \ 404 ${DESTDIR}/usr/share/examples/etc 405 cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 406 ${DEFAULTS} ${DESTDIR}/usr/share/examples/etc/defaults 407 408.include <bsd.prog.mk> 409