]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/zoneinfo/Makefile
tests: add more netlink tests for neighbors/routes
[FreeBSD/FreeBSD.git] / share / zoneinfo / Makefile
1 # $FreeBSD$
2
3 #
4 # HOW TO UPDATE THE ZONEINFO DATA
5 #
6 # Import the new sources to the vendor branch:
7 #
8 # $ cd ~/freebsd/src
9 # $ git worktree add ../tzdata vendor/tzdata
10 # $ pushd ../tzdata
11 # $ tar -xvf ../tzdata-latest.tar.gz
12 #   (check with "git status" and "git diff" if it all makes sense)
13 # $ git add -A
14 # $ git commit -m "Import tzdata 20XXX"
15 # $ git tag -a -m "Tag import of tzdata 20XXX" vendor/tzdata/tzdata20XXX
16 # $ git push --follow-tags freebsd vendor/tzdata
17 # $ popd
18 #
19 # Merge-from-vendor
20 #
21 # $ git subtree merge -P contrib/tzdata vendor/tzdata
22 #   (write a meaningful commit message)
23 # $ git push freebsd HEAD:main
24 #
25 # MFC
26 #
27 # $ git checkout -b freebsd/stable/12 stable-12
28 # $ git cherry-pick -x [hash of merge commit to main] -m 1 --edit
29 #   (write a meaningful commit message)
30 # $ git push freebsd HEAD:stable/12
31 #
32
33 .include <src.opts.mk>
34
35 PACKAGE=        zoneinfo
36 CLEANDIRS+=     builddir
37 CONTRIBDIR=     ${SRCTOP}/contrib/tzdata/
38 .PATH:          ${CONTRIBDIR}
39
40 .if defined(LEAPSECONDS)
41 .warning "Using backwards compatibility variable for LEAPSECONDS; please use WITH_ZONEINFO_LEAPSECONDS_SUPPORT instead"
42 MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes
43 .endif
44
45 .if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no"
46 LEAPFILE=       -L ${CONTRIBDIR}leapseconds
47 .else
48 LEAPFILE=
49 .endif
50
51 TZFILES=        africa antarctica asia australasia etcetera europe \
52                 factory northamerica southamerica
53 TZFILES+=       backward
54
55 TZFILES:=       ${TZFILES:S/^/${CONTRIBDIR}/}
56
57 TZBUILDDIR=     ${.OBJDIR}/builddir
58 TZBUILDSUBDIRS= \
59                 Africa \
60                 America/Argentina \
61                 America/Indiana \
62                 America/Kentucky \
63                 America/North_Dakota \
64                 Antarctica \
65                 Arctic \
66                 Asia \
67                 Atlantic \
68                 Australia \
69                 Etc \
70                 Europe \
71                 Indian \
72                 Pacific
73 TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil
74
75 .if !defined(_SKIP_BUILD)
76 all: zoneinfo
77 .endif
78 META_TARGETS+=  zoneinfo install-zoneinfo
79
80 #
81 # Produce “fat” zoneinfo files for backward compatibility.
82 #
83 ZICFLAGS?=      -b fat
84
85 zoneinfo: ${TDATA}
86         mkdir -p ${TZBUILDDIR}
87         cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS}
88         umask 022; cd ${.CURDIR}; \
89         zic -D -d ${TZBUILDDIR} ${ZICFLAGS} -m ${NOBINMODE} \
90             ${LEAPFILE} ${TZFILES}
91
92 #
93 # Sort TZS to ensure they are the same every build. find -s might
94 # be a shorter way to express this, but it's non-portable. Any
95 # differences between the two don't matter for this purpose.
96 #
97 .if make(*install*)
98 TZS!= cd ${TZBUILDDIR} && find * -type f | LC_ALL=C sort
99 .endif
100
101 beforeinstall: install-zoneinfo
102 install-zoneinfo:
103         mkdir -p ${DESTDIR}/usr/share/zoneinfo
104         cd ${DESTDIR}/usr/share/zoneinfo;  mkdir -p ${TZBUILDSUBDIRS}
105 .for f in ${TZS}
106         ${INSTALL} ${TAG_ARGS} \
107             -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
108             ${TZBUILDDIR}/${f} ${DESTDIR}/usr/share/zoneinfo/${f}
109 .endfor
110         ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
111             ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
112         ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
113             ${CONTRIBDIR}/zone1970.tab ${DESTDIR}/usr/share/zoneinfo/
114
115 afterinstall:
116 #
117 # If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
118 # and the contents of it exists in /usr/share/zoneinfo, then reinstall
119 # it.
120 #
121         @if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
122             -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
123                 zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
124                 if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
125                         if [ ! -z "${DESTDIR}" ]; then \
126                                 optC="-C ${DESTDIR}"; \
127                         fi; \
128                         echo "Updating /etc/localtime"; \
129                         tzsetup $${optC} -r; \
130                 fi; \
131         else \
132                 echo "Run tzsetup(8) manually to update /etc/localtime."; \
133         fi
134
135 HAS_TESTS=
136 SUBDIR.${MK_TESTS}+= tests
137
138 .include <bsd.prog.mk>