Subject: [alpine-devel] new aport zip

From: "Carlo Landmeter" <[email-masked]>
Date: Wed, 28 Jan 2009 22:46:53 +0000

see attached git patch.

carlo

From 7c3ef62d592ef393542415dfee1184b3fa402b7a Mon Sep 17 00:00:00 2001
From: Carlo Landmeter <[email-masked]>
Date: Wed, 28 Jan 2009 22:44:48 +0000
Subject: [PATCH] extra/zip: new aport

---
 extra/zip/10-zip-3.0-build.patch      |   36 +++++++++++++++++++++++++++++++++
 extra/zip/20-zip-3.0-exec-stack.patch |   22 ++++++++++++++++++++
 extra/zip/30-zip-3.0-pic.patch        |   15 +++++++++++++
 extra/zip/APKBUILD                    |   30 +++++++++++++++++++++++++++
 4 files changed, 103 insertions(+), 0 deletions(-)
 create mode 100644 extra/zip/10-zip-3.0-build.patch
 create mode 100644 extra/zip/20-zip-3.0-exec-stack.patch
 create mode 100644 extra/zip/30-zip-3.0-pic.patch
 create mode 100644 extra/zip/APKBUILD

diff --git a/extra/zip/10-zip-3.0-build.patch b/extra/zip/10-zip-3.0-build.patch
new file mode 100644
index 0000000..5ddad23
--- /dev/null
+++ b/extra/zip/10-zip-3.0-build.patch
@@ -0,0 +1,36 @@
+respect build environment settings
+
+--- unix/configure	Wed Jan 28 22:22:13 2009
++++ unix/configure	Wed Jan 28 22:23:54 2009
+@@ -18,7 +18,7 @@
+ 
+ CC=${1-cc}
+ CFLAGS=${2-"-I. -DUNIX"}
+-LFLAGS1=''
++LFLAGS1="${LDFLAGS}"
+ LFLAGS2=''
+ LN="ln -s"
+ 
+@@ -118,7 +118,7 @@
+ fi
+ 
+ # optimization flags
+-if test -n "${CFLAGS_OPT}"; then
++if false; then
+   CFLAGS="${CFLAGS} ${CFLAGS_OPT}"
+   CFLAGS_BZ="${CFLAGS_BZ} ${CFLAGS_OPT}"
+ fi
+@@ -220,13 +220,6 @@
+ echo Check for the C preprocessor
+ # on SVR4, cc -E does not produce correct assembler files. Need /lib/cpp.
+ CPP="${CC} -E"
+-# solaris as(1) needs -P, maybe others as well ?
+-[ -f /usr/ccs/lib/cpp ] && CPP="/usr/ccs/lib/cpp -P"
+-[ -f /usr/lib/cpp ] && CPP=/usr/lib/cpp
+-[ -f /lib/cpp ] && CPP=/lib/cpp
+-[ -f /usr/bin/cpp ] && CPP=/usr/bin/cpp
+-[ -f /xenix ] && CPP="${CC} -E"
+-[ -f /lynx.os ] && CPP="${CC} -E"
+ 
+ echo "#include <stdio.h>" > conftest.c
+ $CPP conftest.c >/dev/null 2>/dev/null || CPP="${CC} -E"
diff --git a/extra/zip/20-zip-3.0-exec-stack.patch b/extra/zip/20-zip-3.0-exec-stack.patch
new file mode 100644
index 0000000..d85fb11
--- /dev/null
+++ b/extra/zip/20-zip-3.0-exec-stack.patch
@@ -0,0 +1,22 @@
+add proper GNU stack markings so we dont get the default: executable
+
+--- crc_i386.S	Wed Jan 28 22:22:13 2009
++++ crc_i386.S	Wed Jan 28 22:27:04 2009
+@@ -302,3 +302,7 @@
+ #endif /* i386 || _i386 || _I386 || __i386 */
+ 
+ #endif /* !USE_ZLIB && !CRC_TABLE_ONLY */
++
++#if defined __ELF__ && defined __linux__
++.section .note.GNU-stack,"",@progbits
++#endif
+--- match.S	Wed Jan 28 22:22:13 2009
++++ match.S	Wed Jan 28 22:27:04 2009
+@@ -405,3 +405,7 @@
+ #endif /* i386 || _I386 || _i386 || __i386  */
+ 
+ #endif /* !USE_ZLIB */
++
++#if defined __ELF__ && defined __linux__
++.section .note.GNU-stack,"",@progbits
++#endif
diff --git a/extra/zip/30-zip-3.0-pic.patch b/extra/zip/30-zip-3.0-pic.patch
new file mode 100644
index 0000000..14a8821
--- /dev/null
+++ b/extra/zip/30-zip-3.0-pic.patch
@@ -0,0 +1,15 @@
+if our toolchain generates PIC by default, then do not use the hand written
+assembly files as none of it is PIC friendly.
+
+--- unix/configure	Wed Jan 28 22:23:54 2009
++++ unix/configure	Wed Jan 28 22:29:51 2009
+@@ -228,6 +228,9 @@
+ echo Check if we can use asm code
+ OBJA=""
+ OCRCU8=""
++piclib="$(echo | $CPP -dM $CFLAGS - | grep -i __pic__)"
++echo "Checking if compiler wants to create pic code"
++[ "$piclib" == "" ] && \
+ if eval "$CPP match.S > _match.s 2>/dev/null"; then
+   if test ! -s _match.s || grep error < _match.s > /dev/null; then
+     :
diff --git a/extra/zip/APKBUILD b/extra/zip/APKBUILD
new file mode 100644
index 0000000..4eab1bf
--- /dev/null
+++ b/extra/zip/APKBUILD
@@ -0,0 +1,30 @@
+# Maintainer: Carlo Landmeter <clandmeter at gmail.com>
+pkgname=zip
+pkgver=3.0
+pkgrel=0
+pkgdesc="Creates PKZIP-compatible .zip files"
+url="http://www.info-zip.org/pub/infozip/Zip.html"
+license="AS IS"
+depends="uclibc"
+makedepends=""
+source="ftp://ftp.info-${pkgname}.org/pub/info${pkgname}/src/${pkgname}30.zip
+10-zip-3.0-build.patch
+20-zip-3.0-exec-stack.patch
+30-zip-3.0-pic.patch"
+subpackages="$pkgname-doc"
+
+build () 
+{ 
+	cd "${srcdir}/${pkgname}30"
+        for i in ../*.patch; do
+		msg "Applying $i"
+		patch -p0 < $i || return 1
+	done
+	make -f unix/Makefile LOCAL_ZIP="${CFLAGS} ${CPPFLAGS}" prefix=/usr generic || return 1
+	make -f unix/Makefile prefix=${pkgdir}/usr MANDIR=${pkgdir}/usr/share/man install
+}
+
+md5sums="e88492c8abd68fa9cfba72bc08757dba  zip30.zip
+397f4e5e8e1df5ea87b576b6214ec07c  10-zip-3.0-build.patch
+aad98faa5fb4e608d6d898aba1a8ab27  20-zip-3.0-exec-stack.patch
+da61b00db253904323321b0e1ddd5301  30-zip-3.0-pic.patch"
-- 
1.6.1

---

From: Natanael Copa <[email-masked]>
Date: Thu, 29 Jan 2009 10:26:23 +0100

> carlo

nice! I committed. the checksum seemed to be wrong for the patches so i
updated them.

now we have only 485 packages left :)
http://dev.alpinelinux.org/~ncopa/alpine/pkg-todo.txt

Thanks!

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---