[packages] squashfs-tools: modularize package
authorluka <luka@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 12 Apr 2013 09:43:51 +0000 (09:43 +0000)
committerluka <luka@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 12 Apr 2013 09:43:51 +0000 (09:43 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@36317 3c298f89-4303-0410-b956-a3cf2f4a3e73

utils/squashfs-tools/Config.in
utils/squashfs-tools/Makefile

index f02c0ba..86996e6 100644 (file)
@@ -1,11 +1,11 @@
-if PACKAGE_squashfs-tools
+if PACKAGE_squashfs-tools-mksquashfs || PACKAGE_squashfs-tools-unsquashfs
 
-config SQUASHFS_TOOLS_MKSQUASHFS
-       bool "Install mksquashfs"
+config SQUASHFS_TOOLS_LZO_SUPPORT
+       bool "Enable LZO support"
        default y
 
-config SQUASHFS_TOOLS_UNSQUASHFS
-       bool "Install unsquashfs"
+config SQUASHFS_TOOLS_XZ_SUPPORT
+       bool "Enable XZ support"
        default y
 
 endif
index cf8f0b1..c3ad0f0 100644 (file)
@@ -9,49 +9,74 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=squashfs-tools
 PKG_VERSION:=4.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=squashfs$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/squashfs
 PKG_MD5SUM:=1b7a781fb4cf8938842279bd3e8ee852
+
 PKG_CAT:=zcat
+PKG_BUILD_PARALLEL:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/squashfs$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/squashfs-tools
+define Package/squashfs-tools/Default
   SECTION:=utils
   CATEGORY:=Utilities
   TITLE:=squashfs-tools
-  DEPENDS+= +libpthread +zlib
-  MENU:=1
+  DEPENDS += +libpthread +zlib \
+       +SQUASHFS_TOOLS_LZO_SUPPORT:liblzo \
+       +SQUASHFS_TOOLS_XZ_SUPPORT:liblzma
+endef
+
+define Package/squashfs-tools-mksquashfs
+  $(call Package/squashfs-tools/Default)
+  TITLE+= mksquashfs
+endef
+
+define Package/squashfs-tools-unsquashfs
+  $(call Package/squashfs-tools/Default)
+  TITLE+= unsquashfs
 endef
 
-define Package/squashfs-tools/config
+define Package/squashfs-tools-unsquashfs/config
        source "$(SOURCE)/Config.in"
 endef
 
 define Build/Configure
 endef
 
+SQUASHFS_TOOLS_CONFIG := \
+       'XATTR_SUPPORT='
+
+ifneq ($(CONFIG_SQUASHFS_TOOLS_XZ_SUPPORT),)
+SQUASHFS_TOOLS_CONFIG += 'XZ_SUPPORT=1'
+endif
+
+ifneq ($(CONFIG_SQUASHFS_TOOLS_LZO_SUPPORT),)
+SQUASHFS_TOOLS_CONFIG += 'LZO_SUPPORT=1'
+endif
+
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR)/squashfs-tools \
                CC="$(TARGET_CC)" \
                EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
                EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
-               XATTR_SUPPORT= \
+               $(SQUASHFS_TOOLS_CONFIG) \
                mksquashfs unsquashfs
 endef
 
-define Package/squashfs-tools/install
+define Package/squashfs-tools-mksquashfs/install
        $(INSTALL_DIR) $(1)/usr/sbin
-ifeq ($(CONFIG_SQUASHFS_TOOLS_MKSQUASHFS),y)
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/mksquashfs $(1)/usr/sbin/mksquashfs
-endif
-ifeq ($(CONFIG_SQUASHFS_TOOLS_UNSQUASHFS),y)
+endef
+
+define Package/squashfs-tools-unsquashfs/install
+       $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/unsquashfs $(1)/usr/sbin/unsquashfs
-endif
 endef
 
-$(eval $(call BuildPackage,squashfs-tools))
+$(eval $(call BuildPackage,squashfs-tools-mksquashfs))
+$(eval $(call BuildPackage,squashfs-tools-unsquashfs))