actions.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 inary.actionsapi import autotools
  7. from inary.actionsapi import inarytools
  8. from inary.actionsapi import shelltools
  9. from inary.actionsapi import get
  10. def setup():
  11. options = " --prefix=/usr \
  12. --libdir=lib \
  13. --openssldir=/etc/ssl \
  14. shared -Wa,--noexecstack \
  15. zlib enable-camellia enable-idea \
  16. enable-seed enable-rfc3779 enable-rc5 \
  17. enable-cms enable-md2 enable-mdc2 threads"
  18. shelltools.system("echo "+get.buildTYPE())
  19. if get.buildTYPE() == "emul32":
  20. options += " --prefix=/emul32 --libdir=lib32".format(get.installDIR())
  21. shelltools.export("CC", "%s -m32" % get.CC())
  22. shelltools.export("CXX", "%s -m32" % get.CXX())
  23. shelltools.system("./Configure linux-elf %s" % options)
  24. shelltools.export("PKG_CONFIG_PATH","/usr/lib32/pkgconfig")
  25. else:
  26. options += " enable-ec_nistp_64_gcc_128"
  27. shelltools.system("./Configure linux-x86_64 %s" % options)
  28. inarytools.dosed("Makefile", "^(SHARED_LDFLAGS=).*", "\\1 ${LDFLAGS}")
  29. inarytools.dosed("Makefile", "^(CFLAG=.*)", "\\1 ${CFLAGS}")
  30. def build():
  31. autotools.make("depend")
  32. autotools.make()
  33. #autotools.make("rehash")
  34. #def check():
  35. #Revert ca-dir patch not to fail test
  36. #shelltools.system("patch -p1 -R < openssl-1.0.0-beta4-ca-dir.patch")
  37. # homeDir = "%s/test-home" % get.workDIR()
  38. # shelltools.export("HOME", homeDir)
  39. # shelltools.makedirs(homeDir)
  40. # autotools.make("-j1 test")
  41. #Passed. So, re-patch
  42. #shelltools.system("patch -p1 < openssl-1.0.0-beta4-ca-dir.patch")
  43. def install():
  44. if get.buildTYPE()=="emul32":
  45. shelltools.system("mkdir -p {}/usr/lib32".format(get.installDIR()))
  46. shelltools.system("install libssl.so.1.0.0 {}/usr/lib32/libssl.so.1.0.0".format(get.installDIR()))
  47. shelltools.system("install libcrypto.so.1.0.0 {}/usr/lib32/libcrypto.so.1.0.0".format(get.installDIR()))
  48. else:
  49. shelltools.system("mkdir -p {}/usr/lib/".format(get.installDIR()))
  50. shelltools.system("install libssl.so.1.0.0 {}/usr/lib/libssl.so.1.0.0".format(get.installDIR()))
  51. shelltools.system("install libcrypto.so.1.0.0 {}/usr/lib/libcrypto.so.1.0.0".format(get.installDIR()))