actions.py 1.4 KB

123456789101112131415161718192021222324252627282930313233
  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 shelltools
  7. from pisi.actionsapi import autotools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import get
  10. def build():
  11. shelltools.cd("squashfs-tools")
  12. #Chakra features
  13. #reduce memory requirements of unsquashfs to support installation on systems with 256 MB RAM
  14. cmd1='sed -i -e "s/BUFFER_DEFAULT [0-9]*/BUFFER_DEFAULT 32/" unsquashfs.h'
  15. cmd2="sed -i 's|^#XZ_SUPPORT = 1|XZ_SUPPORT = 1|' Makefile"
  16. cmd3="sed -i 's|^#LZO_SUPPORT = 1|LZO_SUPPORT = 1|' Makefile"
  17. cmd4="sed -i 's|^#LZ4_SUPPORT = 1|LZ4_SUPPORT = 1|' Makefile"
  18. cmd5="sed -i 's|^#XATTR_SUPPORT = 1|XATTR_SUPPORT = 1|' Makefile"
  19. cmd6="sed -i 's|^#ZSTD_SUPPORT = 1|ZSTD_SUPPORT = 1|' Makefile"
  20. cmd7="sed -i 's|^#LZMA_XZ_SUPPORT = 1|LZMA_XZ_SUPPORT = 1|' Makefile"
  21. cmd8="sed -i 's|^COMP_DEFAULT = gzip|COMP_DEFAULT = xz|' Makefile"
  22. cmds=[cmd1,cmd2,cmd3,cmd4,cmd5,cmd6,cmd7,cmd8]
  23. for cmd in cmds:
  24. shelltools.system(cmd)
  25. autotools.make('RPM_OPT_FLAGS="%s"' % get.CFLAGS())
  26. def install():
  27. shelltools.cd("squashfs-tools")
  28. autotools.install("INSTALL_PREFIX='%s/usr' INSTALL_MANPAGES_DIR='%s/usr/share/man/man1' INSTALL_DIR='%s/usr/sbin'" % (get.installDIR(), get.installDIR(), get.installDIR()))