actions.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/usr/bin/env python3
  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 inary.actionsapi import pythonmodules
  7. from inary.actionsapi import inarytools
  8. from inary.actionsapi import shelltools
  9. from inary.actionsapi import get
  10. WorkDir="docutils-%s" % get.srcVERSION()
  11. def setup():
  12. shelltools.cd("..")
  13. shelltools.makedirs("build_python")
  14. shelltools.copytree("./%s" % WorkDir, "build_python")
  15. shelltools.cd(WorkDir)
  16. shelltools.cd("..")
  17. shelltools.makedirs("build_python3")
  18. shelltools.copytree("./%s" % WorkDir, "build_python3")
  19. shelltools.cd(WorkDir)
  20. def build():
  21. pythonmodules.compile()
  22. shelltools.cd("../build_python/%s" % WorkDir)
  23. pythonmodules.compile()
  24. shelltools.system("pwd")
  25. shelltools.cd("../../build_python3/%s" % WorkDir)
  26. pythonmodules.compile(pyVer="3")
  27. def install():
  28. pythonmodules.install()
  29. shelltools.cd("../build_python/%s" % WorkDir)
  30. pythonmodules.install()
  31. shelltools.cd("../../build_python3/%s" % WorkDir)
  32. pythonmodules.install(pyVer="3")
  33. #Remove .py extensions from scripts in /usr/bin
  34. for f in shelltools.ls("%s/usr/bin" % get.installDIR()):
  35. inarytools.domove("/usr/bin/%s" % f, "/usr/bin", f.replace(".py", ""))