actions.py 986 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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/licenses/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. import os
  11. datadir = "/usr/share/abe"
  12. def fixperms(d):
  13. for root, dirs, files in os.walk(d):
  14. for name in dirs:
  15. shelltools.chmod(os.path.join(root, name), 0755)
  16. for name in files:
  17. shelltools.chmod(os.path.join(root, name), 0644)
  18. def setup():
  19. shelltools.system("./autogen.sh")
  20. autotools.configure("-with-data-dir=%s" % datadir)
  21. def build():
  22. autotools.make()
  23. def install():
  24. pisitools.dodir(datadir)
  25. pisitools.dobin("src/abe")
  26. for d in ["images", "sounds", "maps"]:
  27. fixperms(d)
  28. shelltools.copytree(d, "%s/%s/" % (get.installDIR(), datadir))
  29. pisitools.dodoc("AUTHORS", "ChangeLog", "README*")