Skip to contentSkip to conversation

PATCH against 18643 to add unzip (info-zip), the standard Linux unzip

Buildroot Doug the RockRat 2 participants 3 messages May 18, 2007 – May 19, 2007

lore
Share & tools
lore
#0 lore raw

This has encrypted support, which the busy box one does not, and pulls from source forge.

As this is the first package I've added, I would appreciate feedback on if it's done correctly or not.

Thanks,
Doug

Index: buildroot-2007-05-17/package/Config.in
===================================================================
--- buildroot-2007-05-17/package/Config.in
(revision 18643)
+++ buildroot-2007-05-17/package/Config.in
(working copy)
@@ -311,6 +311,7 @@ endif
source "package/lzo/Config.in"
source "package/lzma/Config.in"
source "package/zlib/Config.in"
+source "package/unzip/Config.in"
endif

menuconfig BR2_SCRIPTING_SUPPORT
Index: buildroot-2007-05-17/package/unzip/Config.in
===================================================================
--- buildroot-2007-05-17/package/unzip/Config.in
(revision 0)
+++ buildroot-2007-05-17/package/unzip/Config.in
(revision 0)
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_UNZIP

+       bool "unzip"
+       default n
+       help

+ list, test and extract compressed files in a
ZIP archive
+ unzip is the standard unzip utility used on
Linux.
+
+config BR2_PACKAGE_UNZIP_STATIC

+       bool "Static Compile of unzip"
+       default n
+       depends on BR2_PACKAGE_UNZIP
+       help

+ Set this to statically compile unzip
+
Index:
buildroot-2007-05-17/package/unzip/unzip-5.52.patch
===================================================================
---
buildroot-2007-05-17/package/unzip/unzip-5.52.patch
(revision 0)
+++
buildroot-2007-05-17/package/unzip/unzip-5.52.patch
(revision 0)
@@ -0,0 +1,22 @@
+--- unzip-5.52/unix/Makefile 2005-02-26
12:58:34.000000000 -0700
++++ unzip-5.52.mipsel/unix/Makefile 2007-05-17
14:12:29.000000000 -0600
+@@ -42,13 +42,15 @@
+ # such as -DDOSWILD).
+
+ # UnZip flags
+-CC = cc# try using "gcc" target rather than
changing this (CC and LD
++ # use mipsel-linux- form for below
++TARGET_PREFIX?=
++STATIC?=
++CC = $(TARGET_PREFIX)gcc# try using "gcc" target
rather than changing this (CC and LD
+ LD = $(CC)# must match, else "unresolved symbol:
___main" is possible)
+-AS = as
++AS = $(TARGET_PREFIX)as
+ LOC = $(LOCAL_UNZIP)
+ AF = $(LOC)
+ CF = -O -I. -DUNIX $(LOC)
+-LF = -o unzip
++LF = $(STATIC) -o unzip
+ LF2 = -s
+
+ # UnZipSFX flags
Index: buildroot-2007-05-17/package/unzip/unzip.mk
===================================================================
--- buildroot-2007-05-17/package/unzip/unzip.mk
(revision 0)
+++ buildroot-2007-05-17/package/unzip/unzip.mk
(revision 0)
@@ -0,0 +1,58 @@
+#############################################################
+#
+# unzip
+#
http://easynews.dl.sourceforge.net/sourceforge/infozip/unzip552.tar.gz
+# http://www.info-zip.org/UnZip.html
+#############################################################
+# come on, folks, please name the file the same as
the dir!
+UNZIP_VTAR=552
+UNZIP_VDIR=5.52
+UNZIP_SOURCE:=unzip$(UNZIP_VTAR).tar.gz +UNZIP_PATCH:=unzip-$(UNZIP_VDIR).patch +UNZIP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/infozip +UNZIP_CAT:=$(ZCAT)
+UNZIP_DIR:=$(BUILD_DIR)/unzip-$(UNZIP_VDIR)
+UNZIP_BINARY:=unzip
+UNZIP_TARGET_BINARY:=bin/unzip
+
+$(DL_DIR)/$(UNZIP_SOURCE):
+ $(WGET) -P $(DL_DIR)
$(UNZIP_SITE)/$(UNZIP_SOURCE)
+
+unzip-source: $(DL_DIR)/$(UNZIP_SOURCE)
+
+$(UNZIP_DIR)/.unpacked: $(DL_DIR)/$(UNZIP_SOURCE)
+ $(UNZIP_CAT) $(DL_DIR)/$(UNZIP_SOURCE) | tar
-C $(BUILD_DIR) $(TAR_OPTIONS) -
+ toolchain/patch-kernel.sh $(UNZIP_DIR)
package/unzip/ unzip\*.patch
+ touch $(UNZIP_DIR)/.unpacked
+
+$(UNZIP_DIR)/.configured: $(UNZIP_DIR)/.unpacked
+ cp $(UNZIP_DIR)/unix/Makefile $(UNZIP_DIR)
+ touch $(UNZIP_DIR)/.configured
+
+$(UNZIP_DIR)/$(UNZIP_BINARY):
$(UNZIP_DIR)/.configured
+ifeq ($(strip $(BR2_PACKAGE_UNZIP_STATIC)),y)
+ $(MAKE) STATIC=-static
TARGET_PREFIX=$(GNU_TARGET_NAME)- -C $(UNZIP_DIR)
generic
+else
+ $(MAKE) TARGET_PREFIX=$(GNU_TARGET_NAME)- -C
$(UNZIP_DIR) generic
+endif
+
+$(TARGET_DIR)/$(UNZIP_TARGET_BINARY):
$(UNZIP_DIR)/$(UNZIP_BINARY)
+ cp -a $(UNZIP_DIR)/$(UNZIP_BINARY)
$(TARGET_DIR)/$(UNZIP_TARGET_BINARY)
+
+unzip: uclibc $(TARGET_DIR)/$(UNZIP_TARGET_BINARY)
+
+unzip-clean:
+ #$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC)
-C $(UNZIP_DIR) uninstall
+ -$(MAKE) -C $(UNZIP_DIR) clean
+
+unzip-dirclean:
+ rm -rf $(UNZIP_DIR)
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_UNZIP)),y)
+TARGETS+=unzip
+endif

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unzip.patch
Type: application/octet-stream
Size: 4232 bytes
Desc: 1460141012-unzip.patch
Url : http://busybox.net/lists/buildroot/attachments/20070517/eab838de/attachment-0001.obj

#1 lore raw
Quoted 73 lines · Doug the RockRat

This has encrypted support, which the busy box one does not, and pulls from source forge.

As this is the first package I've added, I would appreciate feedback on if it's done correctly or not.

Thanks,
Doug

Index: buildroot-2007-05-17/package/Config.in
===================================================================
--- buildroot-2007-05-17/package/Config.in
(revision 18643)
+++ buildroot-2007-05-17/package/Config.in
(working copy)

(quoted diff) +0 -0
@@ -311,6 +311,7 @@ endif

source "package/lzo/Config.in"
source "package/lzma/Config.in"
source "package/zlib/Config.in"
+source "package/unzip/Config.in"
endif

menuconfig BR2_SCRIPTING_SUPPORT
Index: buildroot-2007-05-17/package/unzip/Config.in
===================================================================
--- buildroot-2007-05-17/package/unzip/Config.in (revision 0)
+++ buildroot-2007-05-17/package/unzip/Config.in (revision 0)

(quoted diff) +5 -0
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_UNZIP
+       bool "unzip"
+       default n
+       help
+         list, test and extract compressed files in a

ZIP archive
+ unzip is the standard unzip utility used on
Linux.

(quoted diff) +8 -0
+
+config BR2_PACKAGE_UNZIP_STATIC
+       bool "Static Compile of unzip"
+       default n
+       depends on BR2_PACKAGE_UNZIP
+       help
+         Set this to statically compile unzip
+

Index:
buildroot-2007-05-17/package/unzip/unzip-5.52.patch
===================================================================
---
buildroot-2007-05-17/package/unzip/unzip-5.52.patch (revision 0)
+++
buildroot-2007-05-17/package/unzip/unzip-5.52.patch (revision 0)

(quoted diff) +1 -0
@@ -0,0 +1,22 @@
+--- unzip-5.52/unix/Makefile   2005-02-26

12:58:34.000000000 -0700
++++ unzip-5.52.mipsel/unix/Makefile 2007-05-17
14:12:29.000000000 -0600
+@@ -42,13 +42,15 @@
+ # such as -DDOSWILD).
+
+ # UnZip flags
+-CC = cc# try using "gcc" target rather than
changing this (CC and LD
++ # use mipsel-linux- form for below
++TARGET_PREFIX?=
++STATIC?=
++CC = $(TARGET_PREFIX)gcc# try using "gcc" target
rather than changing this (CC and LD
+ LD = $(CC)# must match, else "unresolved symbol:
___main" is possible)

Quoted 8 lines

+-AS = as
++AS = $(TARGET_PREFIX)as
+ LOC = $(LOCAL_UNZIP)
+ AF = $(LOC)
+ CF = -O -I. -DUNIX $(LOC)
+-LF = -o unzip
++LF = $(STATIC) -o unzip
+ LF2 = -s

Is this patch really needed?
It may not be; consider to build unzip with
$(UNZIP_DIR)/unzip: .../.configured

	$(MAKE) CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)" etc

if configure doesn't write CC and CFLAGS properly.

Quoted 18 lines

+
+ # UnZipSFX flags
Index: buildroot-2007-05-17/package/unzip/unzip.mk
===================================================================
--- buildroot-2007-05-17/package/unzip/unzip.mk (revision 0)
+++ buildroot-2007-05-17/package/unzip/unzip.mk (revision 0)

(quoted diff) +4 -0
@@ -0,0 +1,58 @@
+#############################################################
+#
+# unzip
+#

http://easynews.dl.sourceforge.net/sourceforge/infozip/unzip552.tar.gz

(quoted diff) +3 -0
+# http://www.info-zip.org/UnZip.html
+#############################################################
+# come on, folks, please name the file the same as

the dir!

Review

Quoted 5 lines
(quoted diff) +5 -0
+UNZIP_VTAR=552
+UNZIP_VDIR=5.52
+UNZIP_SOURCE:=unzip$(UNZIP_VTAR).tar.gz
+UNZIP_PATCH:=unzip-$(UNZIP_VDIR).patch
+UNZIP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/infozip

IIRC unzip is one of the packages that often has security issues, so i'd prefer using the debian version instead of unfixed upstream sources.

UNZIP_VERSION:=5.52 UNZIP_SOURCE:=unzip_$(UNZIP_VERSION).orig.tar.gz UNZIP_PATCH:=unzip_$(UNZIP_VERSION)-9.diff.gz UNZIP_SIZE:=http://ftp.debian.org/debian/pool/main/u/unzip/

Quoted 15 lines
(quoted diff) +7 -0
+UNZIP_CAT:=$(ZCAT)
+UNZIP_DIR:=$(BUILD_DIR)/unzip-$(UNZIP_VDIR)
+UNZIP_BINARY:=unzip
+UNZIP_TARGET_BINARY:=bin/unzip
+
+$(DL_DIR)/$(UNZIP_SOURCE):
+        $(WGET) -P $(DL_DIR)

$(UNZIP_SITE)/$(UNZIP_SOURCE)

(quoted diff) +6 -1
+
+unzip-source: $(DL_DIR)/$(UNZIP_SOURCE)
+
+$(UNZIP_DIR)/.unpacked: $(DL_DIR)/$(UNZIP_SOURCE)
+       $(UNZIP_CAT) $(DL_DIR)/$(UNZIP_SOURCE) | tar
-C $(BUILD_DIR) $(TAR_OPTIONS) -
+       toolchain/patch-kernel.sh $(UNZIP_DIR)
Quoted 2 lines

package/unzip/ unzip\*.patch
+ touch $(UNZIP_DIR)/.unpacked

Please use touch $@. Easier to avoid typos and easier to read, imo.

Quoted 10 lines
(quoted diff) +6 -0
+
+$(UNZIP_DIR)/.configured: $(UNZIP_DIR)/.unpacked
+       cp $(UNZIP_DIR)/unix/Makefile $(UNZIP_DIR)
+       touch  $(UNZIP_DIR)/.configured
+
+$(UNZIP_DIR)/$(UNZIP_BINARY):

$(UNZIP_DIR)/.configured

(quoted diff) +2 -0
+ifeq ($(strip $(BR2_PACKAGE_UNZIP_STATIC)),y)
+       $(MAKE) STATIC=-static

TARGET_PREFIX=$(GNU_TARGET_NAME)- -C $(UNZIP_DIR)

IIRC we have a CROSS_COMPILE_PREFIX (or the like) you can use as TARGET_PREFIX (perhaps TARGET_PREFIX is correctly set, even now? You should check that)

Quoted 9 lines

generic

(quoted diff) +2 -0
+else
+       $(MAKE) TARGET_PREFIX=$(GNU_TARGET_NAME)- -C

$(UNZIP_DIR) generic

(quoted diff) +3 -0
+endif
+
+$(TARGET_DIR)/$(UNZIP_TARGET_BINARY):

$(UNZIP_DIR)/$(UNZIP_BINARY)
+ cp -a $(UNZIP_DIR)/$(UNZIP_BINARY)

"cp -a" doesn't work on a variety of host OS (apple). Either use $(INSTALL) -D $@ TARGET_DIR/... or plain cp -dpf. Check the MacOS bug which cp flags are working.

Review

Quoted 8 lines

$(TARGET_DIR)/$(UNZIP_TARGET_BINARY)

(quoted diff) +6 -1
+
+unzip: uclibc $(TARGET_DIR)/$(UNZIP_TARGET_BINARY)
+
+unzip-clean:
+       #$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC)
-C $(UNZIP_DIR) uninstall
+       -$(MAKE) -C $(UNZIP_DIR) clean

IIRC -clean is supposed to uninstall/remove the package from the target_dir, so the uninstall line is needed. If uninstall does not work for this package, rm the files from the target_dir here.

Quoted 3 lines
(quoted diff) +3 -0
+
+unzip-dirclean:
+       rm -rf $(UNZIP_DIR)
#2 lore raw

I didn't look at debain.

This build does NOT have a configure, just a 'unix' make file - it appears very primitive to me - just copy the make file from the appropriate directory, then make. I can see if it will work without the patch.

Do you want me to fix per your suggestions and re-submit? How does this work?

Thanks,
Doug

Quoted 130 lines · --- Bernhard Fischer
Quoted 5 lines · Doug the RockRat

This has encrypted support, which the busy box one does not, and pulls from source forge.

As this is the first package I've added, I would
appreciate feedback on if it's done correctly or

not.

Quoted 5 lines

Thanks,
Doug

Index: buildroot-2007-05-17/package/Config.in

===================================================================

Quoted 11 lines

--- buildroot-2007-05-17/package/Config.in
(revision 18643)
+++ buildroot-2007-05-17/package/Config.in
(working copy)

(quoted diff) +0 -0
@@ -311,6 +311,7 @@ endif

source "package/lzo/Config.in"
source "package/lzma/Config.in"
source "package/zlib/Config.in"
+source "package/unzip/Config.in"
endif

Quoted 2 lines

menuconfig BR2_SCRIPTING_SUPPORT
Index: buildroot-2007-05-17/package/unzip/Config.in

===================================================================

Review line 5

Quoted 12 lines

--- buildroot-2007-05-17/package/unzip/Config.in

(revision 0)
+++ buildroot-2007-05-17/package/unzip/Config.in

(revision 0)

(quoted diff) +5 -0
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_UNZIP
+       bool "unzip"
+       default n
+       help
+         list, test and extract compressed files

in a

Quoted 2 lines

ZIP archive
+ unzip is the standard unzip utility used

on

Quoted 11 lines

Linux.

(quoted diff) +8 -0
+
+config BR2_PACKAGE_UNZIP_STATIC
+       bool "Static Compile of unzip"
+       default n
+       depends on BR2_PACKAGE_UNZIP
+       help
+         Set this to statically compile unzip
+

Index:
buildroot-2007-05-17/package/unzip/unzip-5.52.patch

===================================================================

Quoted 13 lines

---
buildroot-2007-05-17/package/unzip/unzip-5.52.patch (revision 0)
+++
buildroot-2007-05-17/package/unzip/unzip-5.52.patch (revision 0)

(quoted diff) +1 -0
@@ -0,0 +1,22 @@
+--- unzip-5.52/unix/Makefile   2005-02-26

12:58:34.000000000 -0700
++++ unzip-5.52.mipsel/unix/Makefile 2007-05-17
14:12:29.000000000 -0600
+@@ -42,13 +42,15 @@
+ # such as -DDOSWILD).

Quoted 8 lines

+
+ # UnZip flags
+-CC = cc# try using "gcc" target rather than
changing this (CC and LD
++ # use mipsel-linux- form for below
++TARGET_PREFIX?=
++STATIC?=
++CC = $(TARGET_PREFIX)gcc# try using "gcc"

target

Quoted 2 lines

rather than changing this (CC and LD
+ LD = $(CC)# must match, else "unresolved

symbol:

Quoted 9 lines

___main" is possible)
+-AS = as
++AS = $(TARGET_PREFIX)as
+ LOC = $(LOCAL_UNZIP)
+ AF = $(LOC)
+ CF = -O -I. -DUNIX $(LOC)
+-LF = -o unzip
++LF = $(STATIC) -o unzip
+ LF2 = -s

Is this patch really needed?
It may not be; consider to build unzip with
$(UNZIP_DIR)/unzip: .../.configured

	$(MAKE) CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)"

etc

if configure doesn't write CC and CFLAGS properly.

Quoted 3 lines

+
+ # UnZipSFX flags
Index: buildroot-2007-05-17/package/unzip/unzip.mk

===================================================================

Review

Quoted 5 lines

--- buildroot-2007-05-17/package/unzip/unzip.mk
(revision 0)
+++ buildroot-2007-05-17/package/unzip/unzip.mk
(revision 0)

(quoted diff) +0 -0
@@ -0,0 +1,58 @@

+#############################################################

Review line 3

Quoted 3 lines
(quoted diff) +3 -0
+#
+# unzip
+#

http://easynews.dl.sourceforge.net/sourceforge/infozip/unzip552.tar.gz

Review line 4

Quoted 1 line
(quoted diff) +1 -0
+# http://www.info-zip.org/UnZip.html

+#############################################################

Review

Quoted 6 lines
(quoted diff) +1 -0
+# come on, folks, please name the file the same as

the dir!

(quoted diff) +4 -0
+UNZIP_VTAR=552
+UNZIP_VDIR=5.52
+UNZIP_SOURCE:=unzip$(UNZIP_VTAR).tar.gz
+UNZIP_PATCH:=unzip-$(UNZIP_VDIR).patch

+UNZIP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/infozip

Quoted 9 lines

IIRC unzip is one of the packages that often has security issues, so i'd
prefer using the debian version instead of unfixed upstream sources.

UNZIP_VERSION:=5.52
UNZIP_SOURCE:=unzip_$(UNZIP_VERSION).orig.tar.gz
UNZIP_PATCH:=unzip_$(UNZIP_VERSION)-9.diff.gz

UNZIP_SIZE:=http://ftp.debian.org/debian/pool/main/u/unzip/

Quoted 64 lines
Quoted 9 lines
(quoted diff) +7 -0
+UNZIP_CAT:=$(ZCAT)
+UNZIP_DIR:=$(BUILD_DIR)/unzip-$(UNZIP_VDIR)
+UNZIP_BINARY:=unzip
+UNZIP_TARGET_BINARY:=bin/unzip
+
+$(DL_DIR)/$(UNZIP_SOURCE):
+        $(WGET) -P $(DL_DIR)

$(UNZIP_SITE)/$(UNZIP_SOURCE)

Review

Quoted 5 lines
(quoted diff) +5 -0
+
+unzip-source: $(DL_DIR)/$(UNZIP_SOURCE)
+
+$(UNZIP_DIR)/.unpacked: $(DL_DIR)/$(UNZIP_SOURCE)
+       $(UNZIP_CAT) $(DL_DIR)/$(UNZIP_SOURCE) |

tar

Quoted 4 lines
(quoted diff) +1 -1
-C $(BUILD_DIR) $(TAR_OPTIONS) -
+       toolchain/patch-kernel.sh $(UNZIP_DIR)

package/unzip/ unzip\*.patch
+ touch $(UNZIP_DIR)/.unpacked

Please use touch $@. Easier to avoid typos and
easier to read, imo.

Quoted 10 lines
(quoted diff) +6 -0
+
+$(UNZIP_DIR)/.configured: $(UNZIP_DIR)/.unpacked
+       cp $(UNZIP_DIR)/unix/Makefile $(UNZIP_DIR)
+       touch  $(UNZIP_DIR)/.configured
+
+$(UNZIP_DIR)/$(UNZIP_BINARY):

$(UNZIP_DIR)/.configured

(quoted diff) +2 -0
+ifeq ($(strip $(BR2_PACKAGE_UNZIP_STATIC)),y)
+       $(MAKE) STATIC=-static

TARGET_PREFIX=$(GNU_TARGET_NAME)- -C $(UNZIP_DIR)

IIRC we have a CROSS_COMPILE_PREFIX (or the like)
you can use as
TARGET_PREFIX (perhaps TARGET_PREFIX is correctly
set, even now? You
should check that)

Review

Quoted 3 lines

generic

(quoted diff) +2 -0
+else
+       $(MAKE) TARGET_PREFIX=$(GNU_TARGET_NAME)-

-C

Quoted 6 lines

$(UNZIP_DIR) generic

(quoted diff) +3 -0
+endif
+
+$(TARGET_DIR)/$(UNZIP_TARGET_BINARY):

$(UNZIP_DIR)/$(UNZIP_BINARY)
+ cp -a $(UNZIP_DIR)/$(UNZIP_BINARY)

"cp -a" doesn't work on a variety of host OS
(apple). Either use
$(INSTALL) -D $@ TARGET_DIR/... or plain cp -dpf.
Check the MacOS bug which cp flags are working.

Review

Quoted 6 lines

$(TARGET_DIR)/$(UNZIP_TARGET_BINARY)

(quoted diff) +5 -0
+
+unzip: uclibc $(TARGET_DIR)/$(UNZIP_TARGET_BINARY)
+
+unzip-clean:
+       #$(MAKE) DESTDIR=$(TARGET_DIR)

CC=$(TARGET_CC)

Review

Quoted 2 lines
(quoted diff) +1 -1
-C $(UNZIP_DIR) uninstall
+       -$(MAKE) -C $(UNZIP_DIR) clean
Quoted 7 lines

IIRC -clean is supposed to uninstall/remove the package from the
target_dir, so the uninstall line is needed. If uninstall does not work
for this package, rm the files from the target_dir here.

=== message truncated ===

____________________________________________________________________________________Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow