ddd5fd11fe3b61be4888339ca8efbe2061485f79
2 # Copyright (C) 2006-2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 # unpacking files with +s may break on some platforms. this typically emits error code 2
9 ifneq ($(HOST_OS
),Linux
)
10 HOST_TAR
:=trapret
2 $(TAR
)
14 TAR_CMD
=$(HOST_TAR
) -C
$(1)/..
$(TAR_OPTIONS
)
15 UNZIP_CMD
=unzip
-d
$(1)/..
$(DL_DIR
)/$(PKG_SOURCE
)
20 ifeq ($(strip $(PKG_UNPACK
))$(strip $(HOST_UNPACK
)),)
21 ifeq ($(strip $(PKG_CAT
)),)
22 # try to autodetect file type
23 EXT
:=$(call ext
,$(PKG_SOURCE
))
26 ifeq ($(filter gz tgz
,$(EXT
)),$(EXT
))
27 EXT
:=$(call ext
,$(PKG_SOURCE
:.
$(EXT
)=))
28 DECOMPRESS_CMD
:=gzip
-dc
$(DL_DIR
)/$(PKG_SOURCE
) |
30 ifeq ($(filter bzip2 bz2 bz tbz2 tbz
,$(EXT
)),$(EXT
))
31 EXT
:=$(call ext
,$(PKG_SOURCE
:.
$(EXT
)=))
32 DECOMPRESS_CMD
:=bzcat
$(DL_DIR
)/$(PKG_SOURCE
) |
34 ifeq ($(filter tgz tbz tbz2
,$(EXT1
)),$(EXT1
))
37 DECOMPRESS_CMD ?
= cat
$(DL_DIR
)/$(PKG_SOURCE
) |
39 UNPACK_CMD
=$(DECOMPRESS_CMD
) $(TAR_CMD
)
42 UNPACK_CMD
=$(DECOMPRESS_CMD
) (cd
$(1)/..
; cpio
-i
-d
)
45 UNPACK_CMD
=$(UNZIP_CMD
)
49 # compatibility code for packages that set PKG_CAT
50 ifeq ($(strip $(UNPACK_CMD
)),)
51 # use existing PKG_CAT
52 UNPACK_CMD
=$(PKG_CAT
) $(DL_DIR
)/$(PKG_SOURCE
) |
$(TAR_CMD
)
53 ifeq ($(PKG_CAT
),unzip
)
54 UNPACK_CMD
=$(UNZIP_CMD
)
56 # replace zcat with $(ZCAT), because some system don't support it properly
57 ifeq ($(PKG_CAT
),zcat
)
58 UNPACK_CMD
=gzip
-dc
$(DL_DIR
)/$(PKG_SOURCE
) |
$(TAR_CMD
)
61 ifneq ($(strip $(CRLF_WORKAROUND
)),)
62 CRLF_CMD
:= && find
$(PKG_BUILD_DIR
) -type f
-print0 | xargs
-0 perl
-pi
-e
's!\r$$$$!!g'
66 PKG_UNPACK
:= $(call UNPACK_CMD
,$(PKG_BUILD_DIR
)) $(call CRLF_CMD
,$(PKG_BUILD_DIR
))
67 HOST_UNPACK
:= $(call UNPACK_CMD
,$(HOST_BUILD_DIR
)) $(call CRLF_CMD
,$(HOST_BUILD_DIR
))
This page took 0.045871 seconds and 3 git commands to generate.