actions.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 pisitools
  7. from pisi.actionsapi import shelltools
  8. from pisi.actionsapi import scons
  9. from pisi.actionsapi import get
  10. import os
  11. NoStrip = "/"
  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. if name.startswith("SConscript"):
  19. shelltools.unlink(os.path.join(root, name))
  20. def setup():
  21. fixperms("data")
  22. def build():
  23. scons.make('release=1 \
  24. destdir="%s" \
  25. prefix=/usr \
  26. datadir=share/vdrift \
  27. bindir=bin \
  28. localedir=share/locale' % get.installDIR())
  29. def install():
  30. pisitools.dobin("src/vdrift")
  31. pisitools.dodir("/usr/share")
  32. shelltools.copytree("data", "%s/usr/share/vdrift" % get.installDIR())
  33. pisitools.dodoc("LICENSE", "README*")