2 # Copyright (C) 2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
10 PKG_NAME:=squashfs-tools
14 PKG_SOURCE:=squashfs$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/squashfs
16 PKG_MD5SUM:=1b7a781fb4cf8938842279bd3e8ee852
21 PKG_BUILD_DIR:=$(BUILD_DIR)/squashfs$(PKG_VERSION)
23 include $(INCLUDE_DIR)/package.mk
25 define Package/squashfs-tools/Default
29 DEPENDS += +libpthread +zlib \
30 +SQUASHFS_TOOLS_LZO_SUPPORT:liblzo \
31 +SQUASHFS_TOOLS_XZ_SUPPORT:liblzma
34 define Package/squashfs-tools-mksquashfs
35 $(call Package/squashfs-tools/Default)
39 define Package/squashfs-tools-unsquashfs
40 $(call Package/squashfs-tools/Default)
44 define Package/squashfs-tools-unsquashfs/config
45 source "$(SOURCE)/Config.in"
48 define Build/Configure
51 SQUASHFS_TOOLS_CONFIG := \
54 ifneq ($(CONFIG_SQUASHFS_TOOLS_XZ_SUPPORT),)
55 SQUASHFS_TOOLS_CONFIG += 'XZ_SUPPORT=1'
58 ifneq ($(CONFIG_SQUASHFS_TOOLS_LZO_SUPPORT),)
59 SQUASHFS_TOOLS_CONFIG += 'LZO_SUPPORT=1'
63 $(MAKE) -C $(PKG_BUILD_DIR)/squashfs-tools \
65 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
66 EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
67 $(SQUASHFS_TOOLS_CONFIG) \
71 define Package/squashfs-tools-mksquashfs/install
72 $(INSTALL_DIR) $(1)/usr/sbin
73 $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/mksquashfs $(1)/usr/sbin/mksquashfs
76 define Package/squashfs-tools-unsquashfs/install
77 $(INSTALL_DIR) $(1)/usr/sbin
78 $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/unsquashfs $(1)/usr/sbin/unsquashfs
81 $(eval $(call BuildPackage,squashfs-tools-mksquashfs))
82 $(eval $(call BuildPackage,squashfs-tools-unsquashfs))