actions.py 1.4 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/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. def makedepends(d):
  12. for root, dirs, files in os.walk(d):
  13. for name in files:
  14. if name == "Makefile":
  15. shelltools.touch(os.path.join(root, "depend.mk"))
  16. def setup():
  17. pisitools.dosed("config.mk", "^STRIPFLAG.*=.*", "STRIPFLAG = ")
  18. # force external jasper usage
  19. pisitools.echo("config.mk", "JASPERLIB = -ljasper")
  20. pisitools.echo("config.mk", "JASPERHDR_DIR = /usr/include/jasper")
  21. makedepends("./")
  22. def build():
  23. autotools.make('CFLAGS="%s -fPIC -O3 -ffast-math -pedantic -fno-common" LDFLAGS="%s" -j1' % (get.CFLAGS(), get.LDFLAGS()))
  24. def install():
  25. pisitools.dodir("/")
  26. autotools.make('-j1 package pkgdir=%s/usr' % get.installDIR())
  27. pisitools.remove("/usr/bin/manweb")
  28. for data in ["VERSION","pkginfo","README","config_template"]:
  29. pisitools.remove("/usr/%s" % data)
  30. pisitools.domove("/usr/man", "/usr/share")
  31. # remove conflicts with jbigkit
  32. for i in ["pbm", "pgm"]:
  33. pisitools.remove("/usr/share/man/man5/%s.5" % i)
  34. pisitools.dodoc("README", "doc/*LICENSE*")