]>
git.saurik.com Git - apple/system_cmds.git/blob - zic.tproj/generate_zoneinfo.sh
74a43d8ff2f0a6fa97c9495202c8f27843560b81
8 echo "Usage: $0 SRCROOT OBJROOT BUILT_PRODUCTS_DIR SDKROOT PLATFORM_NAME" 1>&2
14 BUILT_PRODUCTS_DIR
="$3"
18 ZICHOST_SYMROOT
="${BUILT_PRODUCTS_DIR}/zic_host-sym"
19 ZICHOST_DSTROOT
="${BUILT_PRODUCTS_DIR}/zic_host-dst"
20 ZICHOST
="${ZICHOST_DSTROOT}/zic_host"
22 LOCALTIME
="US/Pacific"
23 POSIXRULES
="US/Pacific"
25 # pacificnew is obsolete and was removed from ZONE_FILES
26 ZONE_FILES
="africa antarctica asia australasia europe northamerica southamerica etcetera factory backward systemv solar87 solar88 solar89"
27 ZONEINFO
="${BUILT_PRODUCTS_DIR}/zoneinfo"
28 DATFILES
="${BUILT_PRODUCTS_DIR}/datfiles"
29 PRIVATEDIR
="${BUILT_PRODUCTS_DIR}/private"
31 # ftp://elsie.nci.nih.gov/pub/tzdata*.tar.gz
32 # the tzdata*.tar.gz file is automatically unpacked and a version file created
33 # /usr/local/share/tz/tzdata*.tar.gz is installed by the TimeZoneData project
34 TARBALL
=`ls ${SDKROOT}/usr/local/share/tz/tzdata* | sort | tail -n 1`
35 if [ -z "$TARBALL" ]; then
36 echo "No tzdata file found in ${SDKROOT}/usr/local/share/tz" 1>&2
39 DATVERS
=`basename ${TARBALL} | sed -e 's,\..*,,' -e 's/^tzdata//'`
40 VERSIONFILE
="${ZONEINFO}/+VERSION"
42 mkdir -p "${DATFILES}"
43 mkdir -p "${ZONEINFO}"
44 tar zxf
"${TARBALL}" -C "${DATFILES}"
45 for tz
in ${ZONE_FILES}; do
46 if [ ${tz} = "northamerica" ]; then
47 ARG
="-p America/New_York"
51 ${ZICHOST} ${ARG} -L /dev
/null
-d "${ZONEINFO}" \
52 -y "${DATFILES}/yearistype.sh" "${DATFILES}/${tz}" || exit 1
58 chmod -R og
-w "${ZONEINFO}"
59 for f
in "zone.tab" "iso3166.tab"; do
60 install -m 0444 "${DATFILES}/$f" "${ZONEINFO}/$f" || exit 1
66 if [ "${PLATFORM_NAME}" = "iphoneos" ]; then
67 mkdir -p "${PRIVATEDIR}/var/db"
68 mkdir -p -m a
+rwx
"${PRIVATEDIR}/var/db/timezone"
69 ln -hfs "/usr/share/zoneinfo/${LOCALTIME}" "${PRIVATEDIR}/var/db/timezone/localtime"
71 mkdir -p "${PRIVATEDIR}/etc"
72 ln -hfs "/usr/share/zoneinfo/${LOCALTIME}" "${PRIVATEDIR}/etc/localtime"
75 rm -f "${VERSIONFILE}"
76 echo ${DATVERS} > "${VERSIONFILE}"
77 chmod 444 "${VERSIONFILE}"