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+= zoneinfo install-zoneinfo
86 # Produce “fat” zoneinfo files for backward compatibility.
90 .if ${MK_DIRDEPS_BUILD} == "yes"
91 ZIC= ${STAGE_HOST_OBJTOP}/usr/sbin/zic
95 mkdir -p ${TZBUILDDIR}
96 cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS}
97 umask 022; cd ${.CURDIR}; \
98 ${ZIC:Uzic} -D -d ${TZBUILDDIR} ${ZICFLAGS} -m ${NOBINMODE} \
99 ${LEAPFILE} ${TZFILES}
102 # Sort TZS to ensure they are the same every build. find -s might
103 # be a shorter way to express this, but it's non-portable. Any
104 # differences between the two don't matter for this purpose.
107 TZS!= cd ${TZBUILDDIR} && find * -type f | LC_ALL=C sort
110 beforeinstall: install-zoneinfo
112 mkdir -p ${DESTDIR}/usr/share/zoneinfo
113 cd ${DESTDIR}/usr/share/zoneinfo; mkdir -p ${TZBUILDSUBDIRS}
115 ${INSTALL} ${TAG_ARGS} \
116 -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
117 ${TZBUILDDIR}/${f} ${DESTDIR}/usr/share/zoneinfo/${f}
119 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
120 ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
121 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
122 ${CONTRIBDIR}/zone1970.tab ${DESTDIR}/usr/share/zoneinfo/
126 # If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
127 # and the contents of it exists in /usr/share/zoneinfo, then reinstall
130 @if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
131 -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
132 zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
133 if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
134 if [ ! -z "${DESTDIR}" ]; then \
135 optC="-C ${DESTDIR}"; \
137 echo "Updating /etc/localtime"; \
138 tzsetup $${optC} -r; \
141 echo "Run tzsetup(8) manually to update /etc/localtime."; \
145 SUBDIR.${MK_TESTS}+= tests
147 .include <bsd.prog.mk>