do_install () { install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo cp -pPR ${S}/$exec_prefix ${D}/ # libc is removing zoneinfo files from package cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo # Install default timezone if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then install -d ${D}${sysconfdir} echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime else bberror "DEFAULT_TIMEZONE is set to an invalid value." exit 1 fi chown -R root:root ${D} } pkg_postinst_${PN} () { etc_lt="$D${sysconfdir}/localtime" src="$D${sysconfdir}/timezone" if [ -e ${src} ] ; then tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}") fi if [ -z ${tz} ] ; then return 0 fi if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then echo "You have an invalid TIMEZONE setting in ${src}" echo "Your ${etc_lt} has been reset to Universal; enjoy!" tz="Universal" echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}" if [ -L ${etc_lt} ] ; then rm -f "${etc_lt}" fi ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}" fi }