actions.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/copyleft/gpl.txt.
  6. from pisi.actionsapi import autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import shelltools
  9. from pisi.actionsapi import get
  10. WorkDir = "."
  11. ZoneDir = "/usr/share/zoneinfo"
  12. TargetDir = "%s%s" % (get.installDIR(), ZoneDir)
  13. RightDir = "%s/right" % TargetDir
  14. PosixDir = "%s/posix" % TargetDir
  15. timezones = ["etcetera", "southamerica", "northamerica", "europe", "africa", "antarctica", \
  16. "asia", "australasia", "factory", "backward" ]
  17. def setup():
  18. pisitools.dodir (ZoneDir)
  19. pisitools.dodir (RightDir)
  20. pisitools.dodir (PosixDir)
  21. def install():
  22. pisitools.insinto ("/usr/share/zoneinfo", "iso3166.tab")
  23. pisitools.insinto ("/usr/share/zoneinfo", "zone.tab")
  24. pisitools.insinto ("/usr/share/zoneinfo", "zone1970.tab")
  25. for tzdata in timezones:
  26. cmd = "zic -L /dev/null -d %s -y \"%s/yearistype.sh\" %s" % (TargetDir, get.workDIR(), tzdata)
  27. shelltools.system (cmd)
  28. part2 = "zic -L /dev/null -d %s -y \"%s/yearistype.sh\" %s" % (PosixDir, get.workDIR(), tzdata)
  29. shelltools.system (part2)
  30. part3 = "zic -L leapseconds -d %s -y \"%s/yearistype.sh\" %s" % (RightDir, get.workDIR(), tzdata)
  31. shelltools.system (part3)
  32. #shelltools.system ("zic -d %s -y \"%s/yearistype.sh\" %s -p Europe/Istanbul" % (TargetDir, get.workDIR(), tzdata))
  33. shelltools.system ("zic -d %s -p Europe/Istanbul" % TargetDir)