3 # HOW TO UPDATE THE ZONEINFO DATA
5 # Import the new sources to the vendor branch:
8 # $ git worktree add ../tzdata vendor/tzdata
10 # $ tar -xvf ../tzdata-latest.tar.gz
11 # (check with "git status" and "git diff" if it all makes sense)
13 # $ git commit -m "Import tzdata 20XXX"
14 # $ git tag -a -m "Tag import of tzdata 20XXX" vendor/tzdata/tzdata20XXX
15 # $ git push --follow-tags freebsd vendor/tzdata
20 # $ git subtree merge -P contrib/tzdata vendor/tzdata
21 # (write a meaningful commit message)
22 # $ git push freebsd HEAD:main
26 # $ git checkout -b freebsd/stable/12 stable-12
27 # $ git cherry-pick -x [hash of merge commit to main] -m 1 --edit
28 # (write a meaningful commit message)
29 # $ git push freebsd HEAD:stable/12
32 # If there are changes to zone1970.tab, update the baseline file by running
33 # `make baseline` in usr.sbin/tzsetup to check if tzsetup is able to parse new
34 # contents (if not, report/fix tzsetup). Check that update does not
35 # introduce breaking/unexpected changes to continents/countries/zones,
36 # and commit the updated baseline file.
38 .include <src.opts.mk>
42 CONTRIBDIR= ${SRCTOP}/contrib/tzdata/
45 .if defined(LEAPSECONDS)
46 .warning Using backwards compatibility variable for LEAPSECONDS; please use WITH_ZONEINFO_LEAPSECONDS_SUPPORT instead
47 MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes
50 .if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no"
51 LEAPFILE= -L ${CONTRIBDIR}leapseconds
56 TZFILES= africa antarctica asia australasia etcetera europe \
57 factory northamerica southamerica
60 TZFILES:= ${TZFILES:S/^/${CONTRIBDIR}/}
62 TZBUILDDIR= ${.OBJDIR}/builddir
68 America/North_Dakota \
78 TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil
80 .if !defined(_SKIP_BUILD)
83 META_TARGETS+= zonefiles install-zoneinfo
86 # Produce “fat” zoneinfo files for backward compatibility.
90 .if ${MK_DIRDEPS_BUILD} == "yes"
91 ZIC= ${STAGE_HOST_OBJTOP}/usr/sbin/zic
92 # we do everything in a single visit
93 install-zoneinfo: zonefiles
97 mkdir -p ${TZBUILDDIR}
98 (cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS})
99 (umask 022; cd ${.CURDIR}; \
100 ${ZIC:Uzic} -D -d ${TZBUILDDIR} ${ZICFLAGS} -m ${NOBINMODE} \
101 ${LEAPFILE} ${TZFILES})
102 (cd ${TZBUILDDIR} && find * -type f | LC_ALL=C sort) > ${.TARGET}
104 beforeinstall: install-zoneinfo
106 mkdir -p ${DESTDIR}/usr/share/zoneinfo
107 (cd ${DESTDIR}/usr/share/zoneinfo; mkdir -p ${TZBUILDSUBDIRS})
108 for f in `cat zonefiles`; do \
109 ${INSTALL} ${TAG_ARGS} \
110 -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
111 ${TZBUILDDIR}/$${f} ${DESTDIR}/usr/share/zoneinfo/$${f}; \
113 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
114 ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
115 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
116 ${CONTRIBDIR}/zone1970.tab ${DESTDIR}/usr/share/zoneinfo/
120 # If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
121 # and the contents of it exists in /usr/share/zoneinfo, then reinstall
124 @if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
125 -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
126 zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
127 if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
128 if [ ! -z "${DESTDIR}" ]; then \
129 optC="-C ${DESTDIR}"; \
131 echo "Updating /etc/localtime"; \
132 tzsetup $${optC} -r; \
135 echo "Run tzsetup(8) manually to update /etc/localtime."; \
139 SUBDIR.${MK_TESTS}+= tests
141 .include <bsd.prog.mk>