#!/usr/bin/make -f tables = \ africa \ antarctica \ asia \ australasia \ europe \ northamerica \ southamerica \ etcetera nop: @: build: oh-autobuild -- KSHELL=/bin/sh touch $@ install: build install -D src/tzselect tzselect.data/usr/bin install -D src/zdump zdump.data/usr/bin install -D src/zic zic.data/usr/sbin install -D src/tzfile.5 tzdata-doc.data/usr/share/man/man5 install -D src/tzselect.8 tzdata-doc.data/usr/share/man/man8 install -D src/zdump.8 tzdata-doc.data/usr/share/man/man8 install -D src/zic.8 tzdata-doc.data/usr/share/man/man8 # Install country and zone tables used by tzselect. cp src/*.tab tzdata.data/usr/share/zoneinfo # Install the Factory zone and make it the default localtime. src/zic -d tzdata.data/usr/share/zoneinfo src/factory mkdir -p tzdata.data/etc ln -sf /usr/share/zoneinfo/Factory tzdata.data/etc/localtime # Install time zones. set -e; for t in $(tables); do \ p="tzdata-$${t}"; \ src/zic -d "$${p}.data/usr/share/zoneinfo" "src/$${t}"; \ grep '^L' src/$${t} | while read type dest src etc; do \ rm -f "tzdata-$${t}.data/usr/share/zoneinfo/$${src}"; \ link="$${src}" up=''; \ while [ x"$${link#*/}" != x"$${link}" ] && \ [ x"$${link%%/*}" = x"$${dest%%/*}" ]; do \ link="$${link#*/}"; \ dest="$${dest#*/}"; \ done; \ while [ x"$${link#*/}" != x"$${link}" ]; do \ link="$${link#*/}"; \ up="../$${up}"; \ done; \ src="$${p}.data/usr/share/zoneinfo/$${src}"; \ ln -sf "$${up}$${dest}" "$${src}"; \ done; \ done # Install links listed in the "backward" table into the relevant time # zone data package. grep '^L' src/backward | while read type dest src etc; do \ p="tzdata-$$(cd src && grep -l \ "^Zone[ ][ ]*$${dest}[ ].*$$" \ $(tables))"; \ link="$${src}" up=''; \ while [ x"$${link#*/}" != x"$${link}" ] && \ [ x"$${link%%/*}" = x"$${dest%%/*}" ]; do \ link="$${link#*/}"; \ dest="$${dest#*/}"; \ done; \ while [ x"$${link#*/}" != x"$${link}" ]; do \ link="$${link#*/}"; \ up="../$${up}"; \ done; \ src="$${p}.data/usr/share/zoneinfo/$${src}"; \ mkdir -p "$${src%/*}"; \ ln -sf "$${up}$${dest}" "$${src}"; \ done # Install America/New_York in tzdata and link posixrules to it. mkdir -p tzdata.data/usr/share/zoneinfo/America mv tzdata-northamerica.data/usr/share/zoneinfo/America/New_York \ tzdata.data/usr/share/zoneinfo/America ln -sf America/New_York tzdata.data/usr/share/zoneinfo/posixrules set -e; for p $(OPK_PACKAGES); do \ oh-fixperms -d "$${p}.data"; \ oh-strip -d "$${p}.data"; \ done