actions.py 1.4 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 autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import shelltools
  9. from pisi.actionsapi import get
  10. def setup():
  11. if get.buildTYPE() != "emul32":
  12. autotools.autoreconf("-fi")
  13. options = "--disable-static \
  14. --enable-noexecstack"
  15. if get.buildTYPE() == "emul32":
  16. shelltools.system("sed 's:i586\*-\*-\*:x86_64-*-*:' -i mpi/config.links")
  17. shelltools.system("sed 's:x86_64-\*-\*:ignore:;s:i?86-\*-\*:x86_64-*-*:' -i configure.ac")
  18. shelltools.export("CFLAGS", "%s -m32" % get.CFLAGS())
  19. autotools.autoreconf("-fi")
  20. options += " --libdir=/usr/lib32 --bindir=/usr/bin32"
  21. # Use 32-bit assembler, another option is to use --disable-asm option
  22. pisitools.dosed("mpi/config.links", "path=\"amd64\"", "path=\"i586 i386\"")
  23. autotools.configure(options)
  24. def build():
  25. autotools.make()
  26. def check():
  27. autotools.make("check")
  28. def install():
  29. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  30. if get.buildTYPE() == "emul32":
  31. pisitools.removeDir("/usr/bin32")
  32. return
  33. pisitools.dodir("/etc/gcrypt")
  34. pisitools.dodoc("AUTHORS", "ChangeLog", "COPYING*", "NEWS", "README", "THANKS", "TODO")