Advertisement
Guest User

Untitled

a guest
Aug 30th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. do_install () {
  2. install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo
  3. cp -pPR ${S}/$exec_prefix ${D}/
  4. # libc is removing zoneinfo files from package
  5. cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo
  6. cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo
  7.  
  8. # Install default timezone
  9. if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
  10. install -d ${D}${sysconfdir}
  11. echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
  12. ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
  13. else
  14. bberror "DEFAULT_TIMEZONE is set to an invalid value."
  15. exit 1
  16. fi
  17.  
  18. chown -R root:root ${D}
  19. }
  20.  
  21. pkg_postinst_${PN} () {
  22. etc_lt="$D${sysconfdir}/localtime"
  23. src="$D${sysconfdir}/timezone"
  24.  
  25. if [ -e ${src} ] ; then
  26. tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
  27. fi
  28.  
  29. if [ -z ${tz} ] ; then
  30. return 0
  31. fi
  32.  
  33. if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then
  34. echo "You have an invalid TIMEZONE setting in ${src}"
  35. echo "Your ${etc_lt} has been reset to Universal; enjoy!"
  36. tz="Universal"
  37. echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
  38. if [ -L ${etc_lt} ] ; then
  39. rm -f "${etc_lt}"
  40. fi
  41. ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}"
  42. fi
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement