Add installation of separate tzdata package
authorHugo Villeneuve <hugo@hugovil.com>
Fri, 5 Dec 2014 03:41:50 +0000 (22:41 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Sat, 6 Dec 2014 04:19:17 +0000 (23:19 -0500)
Timezone data is not bundled anymore with glibc.

config/packages-list
stage2/hv-install-1
stage2/packages-update
stage2/pkg/tzdata [new file with mode: 0644]

index 6f22dd9..74cd679 100644 (file)
@@ -396,6 +396,7 @@ TIFF="tiff-4.0.2"
 TK="tk8.5.9-src"
 TRANSMISSION="transmission-2.60"
 TUNCTL="tunctl-1.5"
+TZDATA="tzdata2014j"
 
 EUDEV="eudev-1.7"
 UNRAR="unrar-4.2.4"
index 8d2aebd..9329e56 100755 (executable)
@@ -11,6 +11,7 @@ rscr mult "Performing pre-install" pre-install
 ipkg -m noac -l "kernel-headers" -s "kernel-headers" ${KERNEL}
 ipkg -m noac ${MANPAGES}
 ipkg ${GLIBC}
+ipkg -m noac -s tzdata -c ${TZDATA}
 
 rscr once "Adjusting toolchain" toolchain-adjust
 rscr mult "Testing toolchain"   toolchain-test
index d9c6a4a..86ca8b7 100755 (executable)
@@ -46,6 +46,8 @@ lpkg 1 ${EUDEV}
 lpkg 1 ${XZ_UTILS}
 
 # These packages are only for stage2
+fpkg -e "tar.gz" ${TZDATA} \
+    "http://www.iana.org/time-zones/repository/releases"
 fpkg -e "tar.bz2" ${BC} "http://alpha.gnu.org/gnu/bc"
 fpkg -e "tar.gz" ${PERL} "http://www.cpan.org/src/5.0"
 fpkg -s "manpages" ${MANPAGES} "http://tldp.org"
diff --git a/stage2/pkg/tzdata b/stage2/pkg/tzdata
new file mode 100644 (file)
index 0000000..7785f23
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+hvbuild()
+{
+    mkdir -pv ${LFS_TMP}/${PACKAGE}
+    decompress_package ${TZDATA} ${LFS_TMP}/${PACKAGE}
+
+    cd ${LFS_TMP}/${PACKAGE}
+
+    ZONEINFO=/usr/share/zoneinfo
+
+    mkdir -pv ${ZONEINFO}/{posix,right}
+
+    for tz in etcetera southamerica northamerica europe africa antarctica  \
+        asia australasia backward pacificnew systemv; do
+        zic -L /dev/null   -d ${ZONEINFO}       -y "sh yearistype.sh" ${tz}
+        zic -L /dev/null   -d ${ZONEINFO}/posix -y "sh yearistype.sh" ${tz}
+        zic -L leapseconds -d ${ZONEINFO}/right -y "sh yearistype.sh" ${tz}
+    done
+
+    cp -v zone.tab zone1970.tab iso3166.tab ${ZONEINFO}
+
+    zic -d ${ZONEINFO} -p America/New_York
+
+    if [ -h /etc/localtime ]; then
+       rm /etc/localtime
+    fi
+
+    # TIMEZONE is defined in sysinfos
+    if [ ! -f ${ZONEINFO}/${TIMEZONE} ]; then
+        echo "Invalid timezone: ${ZONEINFO}/${TIMEZONE}"
+        exit 1
+    fi
+
+    ln -s ${ZONEINFO}/${TIMEZONE} /etc/localtime
+
+    unset ZONEINFO
+}