]> git.saurik.com Git - apple/icu.git/blame_incremental - icuSources/tools/tzcode/readme.txt
ICU-6.2.15.tar.gz
[apple/icu.git] / icuSources / tools / tzcode / readme.txt
... / ...
CommitLineData
1**********************************************************************
2* Copyright (c) 2003-2004, International Business Machines
3* Corporation and others. All Rights Reserved.
4**********************************************************************
5* Author: Alan Liu
6* Created: August 18 2003
7* Since: ICU 2.8
8**********************************************************************
9
10----------------------------------------------------------------------
11OVERVIEW
12
13This file describes the tools in icu/source/tools/tzcode
14
15The purpose of these tools is to process the zoneinfo or "Olson" time
16zone database into a form usable by ICU4C (release 2.8 and later).
17Unlike earlier releases, ICU4C 2.8 supports historical time zone
18behavior, as well as the full set of Olson compatibility IDs.
19
20References:
21
22ICU4C: http://oss.software.ibm.com/icu/
23Olson: ftp://elsie.nci.nih.gov/pub/
24
25----------------------------------------------------------------------
26ICU4C vs. ICU4J
27
28For ICU releases >= 2.8, both ICU4C and ICU4J implement full
29historical time zones, based on Olson data. The implementations in C
30and Java are somewhat different. The C implementation is a
31self-contained implementation, whereas ICU4J uses the underlying JDK
321.3 or 1.4 time zone implementation.
33
34Older versions of ICU (C and Java <= 2.6) implement a "present day
35snapshot". This only reflects current time zone behavior, without
36historical variation. Furthermore, it lacks the full set of Olson
37compatibility IDs.
38
39----------------------------------------------------------------------
40BACKGROUND
41
42The zoneinfo or "Olson" time zone package is used by various systems
43to describe the behavior of time zones. The package consists of
44several parts. E.g.:
45
46 Index of ftp://elsie.nci.nih.gov/pub/
47
48 classictzcode.tar.gz 65 KB 12/10/1994 12:00:00 AM
49 classictzdata.tar.gz 67 KB 12/10/1994 12:00:00 AM
50 e5+57.tar.gz 2909 KB 3/22/1993 12:00:00 AM
51 iso8601.ps.gz 16 KB 7/27/1996 12:00:00 AM
52 leastsq.xls 49 KB 4/24/1997 12:00:00 AM
53 ltroff.tar.gz 36 KB 7/16/1993 12:00:00 AM
54 pi.shar.gz 4 KB 3/9/1994 12:00:00 AM
55 tzarchive.gz 3412 KB 8/18/2003 4:00:00 AM
56 tzcode2003a.tar.gz 98 KB 3/24/2003 2:32:00 PM
57 tzdata2003a.tar.gz 132 KB 3/24/2003 2:32:00 PM
58
59ICU only uses the tzcodeYYYYV.tar.gz and tzdataYYYYV.tar.gz files,
60where YYYY is the year and V is the version letter ('a'...'z').
61
62----------------------------------------------------------------------
63HOWTO
64
651. Obtain the current versions of tzcodeYYYYV.tar.gz (aka `tzcode')
66 and tzdataYYYYV.tar.gz (aka `tzdata') from the FTP site given
67 above. Either manually download or use wget:
68
69 $ cd {path_to}/icu/source/tools/tzcode
70 $ wget "ftp://elsie.nci.nih.gov/pub/tz*.tar.gz"
71
722. Unpack tzcode and tzdata directly into the directory tzcode:
73
74 $ tar xzvf tzcode*.tar.gz
75 $ tar xzvf tzdata*.tar.gz
76
77 *** Make sure you only have ONE FILE named tzdata*.tar.gz in the
78 directory.
79 *** Do NOT delete the tzdata*.tar.gz file.
80
81 The Makefile looks in the current directory to determine the
82 version of Olson data it is building by looking for tzdata*.tar.gz.
83
843. Apply the ICU patch to zic.c:
85
86 $ patch < patch-icu-tzcode
87
88 If patch complains at this point, there is a mismatch that must be
89 manually addressed. See the CVS log of `patch-icu-tzcode' for
90 version details.
91
924. Build:
93
94 $ make icu_data
95
965. Copy the data files to the correct location in the ICU4C/ICU4J
97 source trees:
98
99 $ cp zoneinfo.txt ../../../data/misc/
100 $ cp ZoneMetaData.java {path_to}/icu4j/src/com/ibm/icu/impl
101
1026. Rebuild ICU:
103
104 $ cd ../../../
105 $ {*make}
106
1077. Don't forget to check in the new zoneinfo.txt (from its location at
108 {path_to}/icu/source/data/misc/zoneinfo.txt) into CVS.
109
110----------------------------------------------------------------------
111HOWTO regenerate patch-icu-tzcode
112
113If you need to edit any of the tzcode* files, you will need to
114regenerate the patch file as follows.
115
1161. Follow the above instructions to extract and patch the tzcode*
117 files in {path_to}/icu/source/tools/tzcode. Modify any of the
118 tzcode files.
119
1202. Extract a clean set of the tzcode* files into a new directory,
121 ../tzcode.orig/:
122
123 $ mkdir ../tzcode.orig
124 $ cd ../tzcode.orig
125 $ tar xzf ../tzcode/tzcode*.tar.gz
126 $ cd ../tzcode
127
1283. Compute diffs, ignoring files that are in only one directory:
129
130 $ diff -ur ../tzcode.orig . | grep -vE -e "^Only in " > patch-icu-tzcode
131
1324. Test the patch-icu-tzcode file by regenerating and diffing the
133 files again in another directory. The expected output from the
134 final diff command is *nothing*.
135
136 $ mkdir ../tzcode.new
137 $ cd ../tzcode.new
138 $ tar xzf ../tzcode/tzcode*.tar.gz
139 $ patch < ../tzcode/patch-icu-tzcode
140 $ cd ../tzcode
141 $ diff -ur ../tzcode.new . | grep -vE -e "^Only in "
142
1435. Check in the new patch-icu-tzcode file.
144
145----------------------------------------------------------------------
146eof