actions.py 1022 B

1234567891011121314151617181920212223242526272829
  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|^COMP_DEFAULT = gzip|COMP_DEFAULT = xz|' Makefile"
  18. cmds=[cmd1,cmd2,cmd3,cmd4]
  19. for cmd in cmds:
  20. shelltools.system(cmd)
  21. autotools.make('RPM_OPT_FLAGS="%s"' % get.CFLAGS())
  22. def install():
  23. shelltools.cd("squashfs-tools")
  24. autotools.install("INSTALL_DIR='%s/usr/sbin'" % get.installDIR())