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