Annotation of src/etc/Makefile, Revision 1.446
1.446 ! tb 1: # $OpenBSD: Makefile,v 1.445 2016/11/19 14:20:58 tb Exp $
1.1 deraadt 2:
3: TZDIR= /usr/share/zoneinfo
1.182 deraadt 4: LOCALTIME= Canada/Mountain
1.287 espie 5: MTREEDIR= /etc/mtree
1.1 deraadt 6:
1.268 todd 7: NOOBJ=
1.1 deraadt 8:
1.309 espie 9: KERNELS = GENERIC bsd
10:
1.1 deraadt 11: .if exists(etc.${MACHINE}/Makefile.inc)
12: .include "etc.${MACHINE}/Makefile.inc"
13: .endif
14:
1.309 espie 15: .for CONF K in ${KERNELS}
16: . if !target($K)
17: $K:
1.443 deraadt 18: cd ../sys/arch/${MACHINE}/compile/${CONF} && ${MAKE} config && \
1.309 espie 19: ${MAKE} clean && exec ${MAKE}
20: . endif
21: ALL_KERNELS += $K
22: .endfor
23:
1.443 deraadt 24: kernels: ${ALL_KERNELS}
1.309 espie 25: .for CONF K in ${KERNELS}
1.443 deraadt 26: cp ../sys/arch/${MACHINE}/compile/${CONF}/obj/bsd ${RELEASEDIR}/$K
1.309 espie 27: .endfor
1.337 deraadt 28:
1.1 deraadt 29: # -rw-r--r--
30: BINOWN= root
31: BINGRP= wheel
1.433 benno 32: MUTABLE=acme-client.conf changelist daily etc.${MACHINE}/disktab \
33: etc.${MACHINE}/login.conf ftpusers gettytab group ksh.kshrc locate.rc \
34: mailer.conf moduli monthly netstart networks newsyslog.conf ntpd.conf \
1.381 deraadt 35: pf.os protocols rc rc.conf rpc services shells syslog.conf weekly
36:
37: # -rw-r--r--
1.434 deraadt 38: EXAMPLES=chio.conf dhclient.conf dhcpd.conf exports \
1.433 benno 39: httpd.conf ifstated.conf inetd.conf man.conf mixerctl.conf \
40: mrouted.conf ntpd.conf pkg.conf printcap rbootd.conf \
1.419 sthen 41: remote sensorsd.conf wsconsctl.conf
1.362 deraadt 42:
1.381 deraadt 43: # -rw-------
1.429 pirofti 44: EXAMPLES_600=bgpd.conf doas.conf dvmrpd.conf eigrpd.conf hostapd.conf \
45: iked.conf ipsec.conf ldapd.conf ldpd.conf ospf6d.conf ospfd.conf \
46: pf.conf radiusd.conf rc.local rc.securelevel rc.shutdown relayd.conf \
1.425 deraadt 47: ripd.conf sasyncd.conf snmpd.conf vm.conf ypldap.conf
1.1 deraadt 48:
1.297 robert 49: # -r-xr-xr-x
1.409 renato 50: RCDAEMONS=amd apmd bgpd bootparamd cron dhcpd dhcrelay dvmrpd eigrpd ftpd \
1.408 sthen 51: ftpproxy ftpproxy6 hostapd hotplugd httpd identd ifstated \
52: iked inetd isakmpd iscsid ldapd ldattach ldomd ldpd lockd \
53: lpd mopd mountd mrouted nfsd npppd nsd ntpd ospf6d ospfd \
1.415 jturner 54: pflogd portmap radiusd rarpd rbootd rebound relayd ripd route6d \
1.408 sthen 55: rtadvd sasyncd sensorsd slowcgi smtpd sndiod snmpd spamd \
1.440 reyk 56: spamlogd sshd statd switchd syslogd tftpd tftpproxy unbound \
1.417 jasper 57: vmd watchdogd wsmoused xdm ypbind ypldap ypserv
1.297 robert 58:
1.391 rpe 59: MISETS= base${OSrev}.tgz comp${OSrev}.tgz man${OSrev}.tgz game${OSrev}.tgz
1.37 niklas 60:
1.1 deraadt 61: all clean cleandir depend etc install lint:
62:
1.287 espie 63: install-mtree:
1.317 espie 64: ${INSTALL} -c -o root -g wheel -m 600 mtree/special \
1.287 espie 65: ${DESTDIR}${MTREEDIR}
1.317 espie 66: ${INSTALL} -c -o root -g wheel -m 444 mtree/4.4BSD.dist \
1.287 espie 67: ${DESTDIR}${MTREEDIR}
1.317 espie 68: ${INSTALL} -c -o root -g wheel -m 444 mtree/BSD.x11.dist \
1.287 espie 69: ${DESTDIR}${MTREEDIR}
70:
1.1 deraadt 71: .ifndef DESTDIR
1.238 deraadt 72: distribution-etc-root-var distribution distrib-dirs release:
1.1 deraadt 73: @echo setenv DESTDIR before doing that!
74: @false
75: .else
1.143 todd 76: distribution-etc-root-var: distrib-dirs
1.380 deraadt 77: ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${MUTABLE} ${DESTDIR}/etc
1.382 okan 78: sh ttys.pty | cat etc.${MACHINE}/ttys - > ${DESTDIR}/etc/ttys && \
1.18 deraadt 79: chown ${BINOWN} ${DESTDIR}/etc/ttys && \
1.20 millert 80: chgrp ${BINGRP} ${DESTDIR}/etc/ttys && \
1.86 deraadt 81: chmod 644 ${DESTDIR}/etc/ttys
1.374 deraadt 82: cat examples/sysctl.conf etc.${MACHINE}/sysctl.conf > \
1.373 deraadt 83: ${DESTDIR}/etc/examples/sysctl.conf && \
84: chown ${BINOWN} ${DESTDIR}/etc/examples/sysctl.conf && \
85: chgrp ${BINGRP} ${DESTDIR}/etc/examples/sysctl.conf && \
86: chmod 644 ${DESTDIR}/etc/examples/sysctl.conf
1.19 deraadt 87: cat fbtab.head etc.${MACHINE}/fbtab fbtab.tail > ${DESTDIR}/etc/fbtab && \
88: chown ${BINOWN} ${DESTDIR}/etc/fbtab && \
1.20 millert 89: chgrp ${BINGRP} ${DESTDIR}/etc/fbtab && \
1.19 deraadt 90: chmod 644 ${DESTDIR}/etc/fbtab
1.378 deraadt 91: ${INSTALL} -c -o ${BINOWN} -g operator -m 664 motd ${DESTDIR}/etc
1.278 ajacouto 92: ${INSTALL} -c -o root -g crontab -m 600 crontab ${DESTDIR}/var/cron/tabs/root
1.37 niklas 93: ${INSTALL} -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
1.14 mickey 94: pwd_mkdb -p -d ${DESTDIR}/etc /etc/master.passwd
1.432 natano 95: chown root:wheel ${DESTDIR}/etc/passwd ${DESTDIR}/etc/pwd.db
96: chown root:_shadow ${DESTDIR}/etc/spwd.db
1.176 henning 97: ${INSTALL} -c -o root -g wheel -m 600 pf.conf ${DESTDIR}/etc
1.361 deraadt 98: ${INSTALL} -c -o root -g _nsd -m 640 nsd.conf ${DESTDIR}/var/nsd/etc
1.347 sthen 99: ${INSTALL} -c -o root -g wheel -m 644 unbound.conf ${DESTDIR}/var/unbound/etc
1.164 deraadt 100: ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
101: etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
1.159 espie 102: cd root; \
1.37 niklas 103: ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
1.1 deraadt 104: ${DESTDIR}/root/.cshrc; \
1.37 niklas 105: ${INSTALL} -c -o root -g wheel -m 644 dot.login \
1.1 deraadt 106: ${DESTDIR}/root/.login; \
1.37 niklas 107: ${INSTALL} -c -o root -g wheel -m 644 dot.profile \
1.1 deraadt 108: ${DESTDIR}/root/.profile; \
1.274 deraadt 109: ${INSTALL} -c -o root -g wheel -m 644 dot.Xdefaults \
110: ${DESTDIR}/root/.Xdefaults; \
1.331 espie 111: ${INSTALL} -c -o root -g wheel -m 644 dot.cvsrc \
112: ${DESTDIR}/root/.cvsrc; \
1.1 deraadt 113: rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
1.229 beck 114: ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
115: ${DESTDIR}/.cshrc; \
116: ${INSTALL} -c -o root -g wheel -m 644 dot.profile \
1.261 sobrado 117: ${DESTDIR}/.profile
1.159 espie 118: cd skel; \
1.109 jakob 119: ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
120: ${DESTDIR}/etc/skel/.cshrc; \
121: ${INSTALL} -c -o root -g wheel -m 644 dot.login \
122: ${DESTDIR}/etc/skel/.login; \
123: ${INSTALL} -c -o root -g wheel -m 644 dot.mailrc \
124: ${DESTDIR}/etc/skel/.mailrc; \
125: ${INSTALL} -c -o root -g wheel -m 644 dot.profile \
1.260 mcbride 126: ${DESTDIR}/etc/skel/.profile; \
1.274 deraadt 127: ${INSTALL} -c -o root -g wheel -m 644 dot.Xdefaults \
128: ${DESTDIR}/etc/skel/.Xdefaults; \
1.331 espie 129: ${INSTALL} -c -o root -g wheel -m 644 dot.cvsrc \
130: ${DESTDIR}/etc/skel/.cvsrc; \
1.260 mcbride 131: ${INSTALL} -c -o root -g wheel -m 600 /dev/null \
132: ${DESTDIR}/etc/skel/.ssh/authorized_keys
1.159 espie 133: cd amd; \
1.37 niklas 134: ${INSTALL} -c -o root -g wheel -m 644 master.sample \
1.159 espie 135: ${DESTDIR}/etc/amd
136: cd ppp; \
1.37 niklas 137: ${INSTALL} -c -o root -g wheel -m 600 chap-secrets \
1.6 deraadt 138: ${DESTDIR}/etc/ppp; \
1.37 niklas 139: ${INSTALL} -c -o root -g wheel -m 600 options \
1.6 deraadt 140: ${DESTDIR}/etc/ppp; \
1.37 niklas 141: ${INSTALL} -c -o root -g wheel -m 600 options.sample \
1.32 deraadt 142: ${DESTDIR}/etc/ppp; \
1.37 niklas 143: ${INSTALL} -c -o root -g wheel -m 600 chatscript.sample \
1.32 deraadt 144: ${DESTDIR}/etc/ppp; \
1.37 niklas 145: ${INSTALL} -c -o root -g wheel -m 600 pap-secrets \
1.159 espie 146: ${DESTDIR}/etc/ppp
1.358 deraadt 147: cd examples; \
148: ${INSTALL} -c -o root -g wheel -m 644 ${EXAMPLES} \
1.368 ajacouto 149: ${DESTDIR}/etc/examples; \
150: ${INSTALL} -c -o root -g wheel -m 600 ${EXAMPLES_600} \
1.394 rpe 151: ${DESTDIR}/etc/examples; \
152: chgrp operator ${DESTDIR}/etc/examples/chio.conf
1.340 deraadt 153: cd signify; \
154: ${INSTALL} -c -o root -g wheel -m 644 *.pub \
155: ${DESTDIR}/etc/signify
1.383 okan 156: ln -fs ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
1.431 natano 157: chown -h root:wheel ${DESTDIR}/etc/localtime
1.383 okan 158: ln -fs /usr/sbin/rmt ${DESTDIR}/etc/rmt
1.431 natano 159: chown -h root:wheel ${DESTDIR}/etc/rmt
1.37 niklas 160: ${INSTALL} -c -o root -g wheel -m 644 minfree \
1.264 sobrado 161: ${DESTDIR}/var/crash
1.37 niklas 162: ${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \
1.264 sobrado 163: ${DESTDIR}/etc/dumpdates
1.158 millert 164: ${INSTALL} -c -o root -g crontab -m 660 /dev/null \
1.264 sobrado 165: ${DESTDIR}/var/cron/at.deny
1.177 millert 166: ${INSTALL} -c -o root -g crontab -m 660 /dev/null \
1.264 sobrado 167: ${DESTDIR}/var/cron/cron.deny
1.37 niklas 168: ${INSTALL} -c -o root -g wheel -m 600 /dev/null \
1.264 sobrado 169: ${DESTDIR}/var/cron/log
1.104 millert 170: ${INSTALL} -c -o root -g wheel -m 444 /dev/null \
1.264 sobrado 171: ${DESTDIR}/var/db/locate.database
1.104 millert 172: ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
1.264 sobrado 173: ${DESTDIR}/var/log/authlog
1.104 millert 174: ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
1.264 sobrado 175: ${DESTDIR}/var/log/daemon
1.173 fgsch 176: ${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
1.264 sobrado 177: ${DESTDIR}/var/log/failedlogin
1.104 millert 178: ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
1.264 sobrado 179: ${DESTDIR}/var/log/ftpd
1.104 millert 180: ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
1.264 sobrado 181: ${DESTDIR}/var/log/lastlog
1.104 millert 182: ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
1.264 sobrado 183: ${DESTDIR}/var/log/lpd-errs
1.420 millert 184: ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
1.264 sobrado 185: ${DESTDIR}/var/log/maillog
1.172 pvalchev 186: ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
1.264 sobrado 187: ${DESTDIR}/var/log/messages
1.104 millert 188: ${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
1.264 sobrado 189: ${DESTDIR}/var/log/secure
1.104 millert 190: ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
1.264 sobrado 191: ${DESTDIR}/var/log/wtmp
1.104 millert 192: ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
1.264 sobrado 193: ${DESTDIR}/var/log/xferlog
1.159 espie 194: cd ../usr.sbin/ypserv/ypinit && exec ${MAKE} distribution
195: cd ../usr.bin/ssh && exec ${MAKE} distribution
1.352 miod 196: cd ../lib/libcrypto && exec ${MAKE} distribution
1.244 reyk 197: cd ../usr.bin/bgplg && exec ${MAKE} distribution
1.159 espie 198: cd ../usr.bin/mail && exec ${MAKE} distribution
1.413 jsg 199: cd ../usr.sbin/ikectl && exec ${MAKE} distribution
1.288 martinh 200: cd ../usr.sbin/ldapd && exec ${MAKE} distribution
1.324 yasuoka 201: cd ../usr.sbin/npppd && exec ${MAKE} distribution
1.185 millert 202: cd mail && exec ${MAKE} distribution
1.83 deraadt 203: ${INSTALL} -c -o root -g wheel -m 600 root/root.mail \
1.264 sobrado 204: ${DESTDIR}/var/mail/root
1.294 robert 205: cd rc.d; \
206: ${INSTALL} -c -o root -g wheel -m 644 rc.subr \
1.297 robert 207: ${DESTDIR}/etc/rc.d && \
208: ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 ${RCDAEMONS} \
1.294 robert 209: ${DESTDIR}/etc/rc.d
1.399 deraadt 210: cd ${DESTDIR}/var; ln -fs ../tmp
1.431 natano 211: chown -h root:wheel ${DESTDIR}/var/tmp
1.407 ajacouto 212: touch ${DESTDIR}/var/sysmerge/etcsum
1.432 natano 213: chown root:wheel ${DESTDIR}/var/sysmerge/etcsum
1.446 ! tb 214: chmod 644 ${DESTDIR}/var/sysmerge/etcsum
1.396 rpe 215: cd ${DESTDIR}/ && \
216: sort ${.CURDIR}/../distrib/sets/lists/etc/{mi,md.${MACHINE}} | \
1.407 ajacouto 217: xargs sha256 -h ${DESTDIR}/var/sysmerge/etcsum || true
1.396 rpe 218: cd ${DESTDIR}/ && \
219: sort ${.CURDIR}/../distrib/sets/lists/etc/{mi,md.${MACHINE}} | \
1.425 deraadt 220: pax -w -d | gzip -9 > ${DESTDIR}/var/sysmerge/etc.tgz
1.431 natano 221: chown root:wheel ${DESTDIR}/var/sysmerge/etc.tgz
1.446 ! tb 222: chmod 644 ${DESTDIR}/var/sysmerge/etc.tgz
1.391 rpe 223:
224: distribution:
1.435 deraadt 225: exec ${MAKE} distribution-etc-root-var
226: cd .. && exec ${MAKE} install
1.1 deraadt 227:
228: distrib-dirs:
1.151 deraadt 229: if [ ! -d ${DESTDIR}/. ]; then \
230: ${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}; \
231: fi
1.152 millert 232: mtree -qdef mtree/4.4BSD.dist -p ${DESTDIR}/ -U
1.383 okan 233: cd ${DESTDIR}/; ln -fhs usr/src/sys sys
1.431 natano 234: chown -h root:wheel ${DESTDIR}/sys
1.49 deraadt 235:
236: .ifndef RELEASEDIR
237: release:
238: @echo setenv RELEASEDIR before building a release.
239: @false
240: .else
1.272 deraadt 241:
1.436 natano 242: release:
1.445 tb 243: umask ${WOBJUMASK}; exec ${MAKE} do-release
244:
245: do-release:
1.436 natano 246: @if [[ `id -u` -ne 0 ]]; then \
1.439 natano 247: echo $@ must be called by root >&2; \
1.441 natano 248: false; \
249: fi
250: @destmp=`df -P ${DESTDIR} | awk 'END { print $$6 }'`; \
251: if ! mount | grep -q " $${destmp} .*noperm"; then \
252: echo ${DESTDIR} must be on a noperm filesystem >&2; \
253: false; \
254: fi; \
255: if [[ `stat -f '%Su %Lp' $${destmp}` != '${BUILDUSER} 700' ]]; then \
256: echo $${destmp} must have owner BUILDUSER and mode 700 >&2; \
1.436 natano 257: false; \
258: fi
1.438 natano 259: ${MAKE} release-sets
1.436 natano 260: ${MAKE} distrib
261: su ${BUILDUSER} -c 'exec ${MAKE} sha'
1.446 ! tb 262: -cd ${RELEASEDIR} && chmod g-w,a+rX *
1.436 natano 263:
1.271 deraadt 264: release-sets:
1.438 natano 265: su ${BUILDUSER} -c 'exec ${MAKE} distribution'
1.443 deraadt 266: su ${BUILDUSER} -c 'exec ${MAKE} kernels'
267: ${MAKE} bootblocks
1.343 deraadt 268: cd ${RELEASEDIR} && rm -f SHA256
1.438 natano 269: cd ../distrib/sets && exec su ${BUILDUSER} -c 'exec sh maketars ${OSrev}'
1.271 deraadt 270:
1.272 deraadt 271: sha:
1.85 ryker 272: -cd ${RELEASEDIR}; \
1.412 tedu 273: date -u "+Build date: %s - %+" > BUILDINFO; \
274: cksum -a sha256 BUILDINFO INSTALL.`arch -ks` \
1.344 deraadt 275: ${ALL_KERNELS} ${MDEXT} ${MISETS} | sort > SHA256
1.35 graichen 276:
1.238 deraadt 277: .endif
1.1 deraadt 278:
279: .endif # DESTDIR check
1.136 todd 280:
1.160 espie 281: distrib:
1.445 tb 282: umask 022; cd ../distrib && \
1.435 deraadt 283: ${MAKE} && exec ${MAKE} install
1.1 deraadt 284:
1.159 espie 285: .PHONY: distribution-etc-root-var distribution distrib-dirs \
1.309 espie 286: release allarchs kernels release-sets m4 install-mtree \
287: bootblocks ${ALL_KERNELS}
1.266 todd 288:
1.427 deraadt 289: SUBDIR+= etc.alpha etc.amd64 etc.armv7
1.423 deraadt 290: SUBDIR+= etc.hppa etc.i386 etc.landisk etc.loongson etc.luna88k
1.349 miod 291: SUBDIR+= etc.macppc etc.octeon
1.430 guenther 292: SUBDIR+= etc.sgi etc.socppc etc.sparc64
1.266 todd 293:
294: .include <bsd.subdir.mk>
1.1 deraadt 295: .include <bsd.prog.mk>