4 # HOW TO UPDATE THE ZONEINFO DATA
6 # With the use of subversion, this is a little bit simpler than the CVS method.
8 # Import the new sources to the vendor branch:
10 # $ cd ~/svn/vendor/tzdata/dist
11 # $ tar zxvf /usr/ports/distfile/tzdata2008X.tar.gz
12 # (check with "svn stat" and "svn diff" if it all makes sense)
13 # $ svn commit # Commit message: "Vendor import of tzdata2008X (+details)"
17 # $ cd ~/svn/vendor/tzdata
18 # $ svn cp svn+ssh://svn.freebsd.org/base/vendor/tzdata/dist \
19 # svn+ssh://svn.freebsd.org/base/vendor/tzdata/tzdata2008X
20 # $ svn commit # Commit message: "Tag of tzdata2008X"
24 # $ cd ~/svn/head/contrib/tzdata
26 # $ svn merge -c X --accept=postpone \
27 # svn+ssh://svn.freebsd.org/base/vendor/tzdata/dist .
28 # $ svn commit # Commit message: "MFV of tzdata2008X"
31 .include <src.opts.mk>
33 CLEANFILES+= yearistype
35 CONTRIBDIR= ${SRCTOP}/contrib/tzdata/
38 .if defined(LEAPSECONDS)
39 .warning "Using backwards compatibility variable for LEAPSECONDS; please use WITH_ZONEINFO_LEAPSECONDS_SUPPORT instead"
40 MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes
43 .if defined(OLDTIMEZONES)
44 .warning "Using backwards compatibility variable for OLDTIMEZONES; please use WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT instead"
45 MK_ZONEINFO_OLD_TIMEZONES_SUPPORT= yes
48 .if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no"
49 LEAPFILE= -L ${CONTRIBDIR}leapseconds
54 TZFILES= africa antarctica asia australasia etcetera europe \
55 factory northamerica southamerica
56 POSIXRULES= America/New_York
58 .if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
59 TZFILES+= backward systemv
62 TZFILES:= ${TZFILES:S/^/${CONTRIBDIR}/}
64 TZBUILDDIR= ${.OBJDIR}/builddir
70 America/North_Dakota \
82 .if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
83 TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil
86 .if !defined(_SKIP_BUILD)
89 META_TARGETS+= zoneinfo install-zoneinfo
91 zoneinfo: yearistype ${TDATA}
92 mkdir -p ${TZBUILDDIR}
93 cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS}
94 umask 022; cd ${.CURDIR}; \
95 zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \
96 ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
99 # Sort TZS to ensure they are the same every build. find -s might
100 # be a shorter way to express this, but it's non-portable. Any
101 # differences between the two don't matter for this purpose.
104 TZS!= cd ${TZBUILDDIR} && find * -type f | LC_ALL=C sort
107 beforeinstall: install-zoneinfo
109 mkdir -p ${DESTDIR}/usr/share/zoneinfo
110 cd ${DESTDIR}/usr/share/zoneinfo; mkdir -p ${TZBUILDSUBDIRS}
112 ${INSTALL} ${TAG_ARGS} \
113 -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
114 ${TZBUILDDIR}/${f} ${DESTDIR}/usr/share/zoneinfo/${f}
116 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
117 ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
118 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
119 ${CONTRIBDIR}/zone1970.tab ${DESTDIR}/usr/share/zoneinfo/
123 # If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
124 # and the contents of it exists in /usr/share/zoneinfo, then reinstall
127 @if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
128 -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
129 zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
130 if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
131 if [ ! -z "${DESTDIR}" ]; then \
132 optC="-C ${DESTDIR}"; \
134 echo "Updating /etc/localtime"; \
135 tzsetup $${optC} -r; \
138 echo "Run tzsetup(8) manually to update /etc/localtime."; \
142 SUBDIR.${MK_TESTS}+= tests
144 .include <bsd.prog.mk>