actions.py 1.5 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 get
  9. libversion = get.srcVERSION()
  10. def build():
  11. autotools.make('CC=%s AR=%s RANLIB=%s CFLAGS="%s -D_FILE_OFFSET_BITS=64 -fPIC"' % (get.CC(), get.AR(), get.RANLIB(), get.CFLAGS()))
  12. autotools.make('CFLAGS="%s -D_FILE_OFFSET_BITS=64 -fPIC" -f Makefile-libbz2_so' % get.CFLAGS())
  13. def check():
  14. autotools.make("check")
  15. def install():
  16. autotools.rawInstall("PREFIX=%s/usr" % get.installDIR())
  17. # No static libs
  18. pisitools.removeDir("/usr/lib")
  19. pisitools.domove("/usr/bin/", "/")
  20. for link in ("/bin/bunzip2", "/bin/bzcat"):
  21. pisitools.remove(link)
  22. pisitools.dosym("bzip2", link)
  23. for wrong_link in ("/bin/bzcmp", "/bin/bzegrep", "/bin/bzfgrep", "/bin/bzless"):
  24. pisitools.remove(wrong_link)
  25. pisitools.dosym("bzgrep", "/bin/bzegrep")
  26. pisitools.dosym("bzgrep", "/bin/bzfgrep")
  27. pisitools.dosym("bzdiff", "/bin/bzcmp")
  28. pisitools.dosym("bzmore", "/bin/bzless")
  29. pisitools.dolib("libbz2.so.%s" % libversion, "/lib")
  30. pisitools.dosym("libbz2.so.1", "/lib/libbz2.so")
  31. pisitools.dosym("libbz2.so.1", "/lib/libbz2.so.1.0")
  32. pisitools.dosym("libbz2.so.%s" % libversion, "/lib/libbz2.so.1")
  33. pisitools.dohtml("manual.html")
  34. pisitools.dodoc("README", "CHANGES", "bzip2.txt")