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