actions.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 libtools
  8. from pisi.actionsapi import autotools
  9. from pisi.actionsapi import pisitools
  10. LIBDIR = "/usr/lib32" if get.buildTYPE() == "emul32" else "/usr/lib"
  11. bindir = "/usr/bin32" if get.buildTYPE() == "emul32" else "/usr/bin"
  12. def setup():
  13. autotools.autoreconf("-vif")
  14. options = "--enable-jit \
  15. --libdir=%s \
  16. --bindir=%s \
  17. --enable-pcre2test-libreadline \
  18. --enable-pcre2-32 \
  19. --enable-pcre2-16 \
  20. --enable-unicode \
  21. --docdir=/%s/%s \
  22. --disable-static" % (LIBDIR, bindir, get.docDIR(), get.srcNAME())
  23. if get.buildTYPE() != "emul32":
  24. options += " --enable-pcre2grep-libz \
  25. --enable-pcre2grep-libbz2 \
  26. "
  27. autotools.configure(options)
  28. pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
  29. def build():
  30. autotools.make()
  31. def check():
  32. if get.buildTYPE() == "emul32":
  33. pass
  34. else:
  35. autotools.make("-j1 check")
  36. def install():
  37. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  38. if get.buildTYPE() == "emul32":
  39. pisitools.removeDir("/usr/bin32")
  40. return