Add 2.6 kernel dependency to gpioctl
[openwrt/svn-archive/archive.git] / include / unpack.mk
index 10e6c25bf5418b5a7fcebc62b036cd05815c827b..9b68e5dea39d1e97b9722f1735c4f40d736054e1 100644 (file)
@@ -1,4 +1,9 @@
-ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1)))
+# 
+# Copyright (C) 2006-2007 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
 
 # unpacking files with +s may break on some platforms. this typically emits error code 2
 ifneq ($(HOST_OS),Linux)
@@ -20,14 +25,13 @@ ifeq ($(strip $(PKG_UNPACK)),)
 
     ifeq ($(filter gz tgz,$(EXT)),$(EXT))
       EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
-      UNPACK:=$(ZCAT) $(DL_DIR)/$(PKG_SOURCE) |
+      UNPACK:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) |
     endif      
     ifeq ($(filter bzip2 bz2 bz tbz2 tbz,$(EXT)),$(EXT))
       EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
       UNPACK:=bzcat $(DL_DIR)/$(PKG_SOURCE) |
     endif
     ifeq ($(filter tgz tbz tbz2,$(EXT1)),$(EXT1))
-      $(error FOO: $(filter tgz tbz tbz2,$(EXT1)),$(EXT1))
       EXT:=tar
     endif
     UNPACK ?= cat $(DL_DIR)/$(PKG_SOURCE) |
@@ -43,15 +47,15 @@ ifeq ($(strip $(PKG_UNPACK)),)
   endif
  
   # compatibility code for packages that set PKG_CAT
-  ifeq ($(strip $(PKG_CAT)$(PKG_UNPACK)),)
+  ifeq ($(strip $(PKG_UNPACK)),)
     # use existing PKG_CAT
     PKG_UNPACK:=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD)
     ifeq ($(PKG_CAT),unzip)
       PKG_UNPACK:=$(UNZIP_CMD)
     endif
-    # replace zcat with $(ZCAT), because some system have it as gzcat
+    # replace zcat with $(ZCAT), because some system don't support it properly
     ifeq ($(PKG_CAT),zcat)
-      PKG_UNPACK:=$(ZCAT) $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD)
+      PKG_UNPACK:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD)
     endif
   endif
   ifneq ($(strip $(CRLF_WORKAROUND)),)