actions.py 1.7 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 autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import shelltools
  9. from pisi.actionsapi import get
  10. libname = "libexpect.so.%s" % get.srcVERSION()
  11. majorVersion = tuple(get.srcVERSION().split(".")[:2])
  12. def setup():
  13. #pisitools.dosed("expect.man", "/usr/local/bin", "/usr/bin")
  14. #pisitools.dosed("expectk.man", "/usr/local/bin", "/usr/bin")
  15. pisitools.dosed("Makefile.in", "^install: .*", "install: all install-binaries install-doc")
  16. pisitools.dosed("Makefile.in", "^(SCRIPTS_MANPAGES = .*)$", "_\\1")
  17. autotools.autoconf()
  18. shelltools.export("CFLAGS","%s -D_BSD_SOURCE" % get.CFLAGS())
  19. autotools.configure("--with-tcl=/usr/lib \
  20. --with-tclinclude=/usr/include \
  21. --without-x \
  22. --with-tk=no \
  23. --enable-shared")
  24. def build():
  25. autotools.make("SONAME=%s" % libname)
  26. def install():
  27. autotools.rawInstall('DESTDIR="%s"' % get.installDIR())
  28. pisitools.domove("/usr/lib/expect%s/libexpect%s.so" % (get.srcVERSION(), get.srcVERSION()), "/usr/lib/", libname)
  29. pisitools.rename("/usr/lib/expect%s" % get.srcVERSION(), "expect%s.%s" % majorVersion)
  30. #pisitools.dosym(libname, "/usr/lib/libexpect.so.%s.%s" % majorVersion)
  31. pisitools.dosym(libname, "/usr/lib/libexpect%s.so" % get.srcVERSION())
  32. pisitools.dosym(libname, "/usr/lib/libexpect.so.%s" % majorVersion[0])
  33. pisitools.dosym(libname, "/usr/lib/libexpect.so")
  34. pisitools.dodoc("FAQ", "ChangeLog", "NEWS", "README", "HISTORY")