actions.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 get
  7. from pisi.actionsapi import autotools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import shelltools
  10. def setup():
  11. pisitools.dosed("src/scratch", "-xshm ", "")
  12. # fix unused direct dependency analysis
  13. pisitools.dosed("src/plugins/unicode/Makefile", "gcc -shared", "gcc -Wl,-O1,--as-needed -shared")
  14. def build():
  15. pisitools.cflags.add("-Wno-unused-result -Wno-parentheses -Wno-implicit-function-declaration")
  16. shelltools.system("make build")
  17. def install():
  18. # install binary and additional files
  19. pisitools.insinto("/usr/bin/", "src/scratch")
  20. shelltools.chmod("%s/usr/bin/scratch" % get.installDIR(), 0755)
  21. pisitools.insinto("/usr/lib/scratch/", "Scratch.image")
  22. pisitools.insinto("/usr/lib/scratch/", "Scratch.ini")
  23. pisitools.insinto("/usr/share/applications/", "src/scratch.desktop")
  24. pisitools.insinto("/usr/share/mime/packages/", "src/scratch.xml")
  25. # install documentation files
  26. pisitools.dodoc("LICENSE*", "README*", "gpl*")
  27. shelltools.copytree("Help", "%s/usr/share/doc/scratch" % get.installDIR())
  28. #install man file
  29. pisitools.insinto("/usr/share/man/man1/", "src/man/scratch.1.gz")
  30. # install data files under share
  31. for dirs in ["Help", "locale", "Media", "Projects"]:
  32. shelltools.copytree(dirs, "%s/usr/share/scratch" % get.installDIR())
  33. # install plugins
  34. shelltools.copytree("Plugins", "%s/usr/lib/scratch" % get.installDIR())
  35. # install images
  36. shelltools.cd("src/icons")
  37. for dirs in ["32x32", "48x48", "128x128"]:
  38. pisitools.insinto("/usr/share/icons/hicolor/%s/apps" % dirs, "%s/*.*" % dirs)