]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/zoneinfo/Makefile
Import DTS from Linux 4.20
[FreeBSD/FreeBSD.git] / share / zoneinfo / Makefile
1 # $FreeBSD$
2
3 #
4 # HOW TO UPDATE THE ZONEINFO DATA
5 #
6 # With the use of subversion, this is a little bit simpler than the CVS method.
7 #
8 # Import the new sources to the vendor branch:
9 #
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)" 
14 #
15 # Tag it
16 #
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"
21 #
22 # Merge-from-vendor
23 #
24 # $ cd ~/svn/head/contrib/tzdata
25 # $ svn update
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"
29 #
30
31 .include <src.opts.mk>
32
33 CLEANFILES+=    yearistype
34 CLEANDIRS+=     builddir
35 CONTRIBDIR=     ${SRCTOP}/contrib/tzdata/
36 .PATH:          ${CONTRIBDIR}
37
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
41 .endif
42
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
46 .endif
47
48 .if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no"
49 LEAPFILE=       -L ${CONTRIBDIR}leapseconds
50 .else
51 LEAPFILE=
52 .endif
53
54 TZFILES=        africa antarctica asia australasia etcetera europe \
55                 factory northamerica southamerica
56 POSIXRULES=     America/New_York
57
58 .if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
59 TZFILES+=       backward systemv
60 .endif
61
62 TZFILES:=       ${TZFILES:S/^/${CONTRIBDIR}/}
63
64 TZBUILDDIR=     ${.OBJDIR}/builddir
65 TZBUILDSUBDIRS= \
66                 Africa \
67                 America/Argentina \
68                 America/Indiana \
69                 America/Kentucky \
70                 America/North_Dakota \
71                 Antarctica \
72                 Arctic \
73                 Asia \
74                 Atlantic \
75                 Australia \
76                 Etc \
77                 Europe \
78                 Indian \
79                 Pacific \
80                 SystemV
81
82 .if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
83 TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil
84 .endif
85
86 .if !defined(_SKIP_BUILD)
87 all: zoneinfo
88 .endif
89 META_TARGETS+=  zoneinfo install-zoneinfo
90
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}
97
98 #
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.
102 #
103 .if make(*install*)
104 TZS!= cd ${TZBUILDDIR} && find * -type f | LC_ALL=C sort
105 .endif
106
107 beforeinstall: install-zoneinfo
108 install-zoneinfo:
109         mkdir -p ${DESTDIR}/usr/share/zoneinfo
110         cd ${DESTDIR}/usr/share/zoneinfo;  mkdir -p ${TZBUILDSUBDIRS}
111 .for f in ${TZS}
112         ${INSTALL} ${TAG_ARGS} \
113             -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
114             ${TZBUILDDIR}/${f} ${DESTDIR}/usr/share/zoneinfo/${f}
115 .endfor
116         ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
117             ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
118
119 afterinstall:
120 #
121 # If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
122 # and the contents of it exists in /usr/share/zoneinfo, then reinstall
123 # it.
124 #
125         @if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
126             -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
127                 zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
128                 if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
129                         if [ ! -z "${DESTDIR}" ]; then \
130                                 optC="-C ${DESTDIR}"; \
131                         fi; \
132                         echo "Updating /etc/localtime"; \
133                         tzsetup $${optC} -r; \
134                 fi; \
135         else \
136                 echo "Run tzsetup(8) manually to update /etc/localtime."; \
137         fi
138
139 HAS_TESTS=
140 SUBDIR.${MK_TESTS}+= tests
141
142 .include <bsd.prog.mk>