summaryrefslogtreecommitdiffstats
path: root/app-arch/ruszip
diff options
context:
space:
mode:
Diffstat (limited to 'app-arch/ruszip')
-rw-r--r--app-arch/ruszip/Manifest6
-rw-r--r--app-arch/ruszip/files/zip-2.3-unix_configure-pic.patch12
-rw-r--r--app-arch/ruszip/files/zip-2.31-exec-stack.patch20
-rw-r--r--app-arch/ruszip/files/zip-2.32-build.patch89
-rw-r--r--app-arch/ruszip/files/zip232-ds-recoderus.patch165
-rw-r--r--app-arch/ruszip/ruszip-2.32-r1.ebuild46
6 files changed, 338 insertions, 0 deletions
diff --git a/app-arch/ruszip/Manifest b/app-arch/ruszip/Manifest
new file mode 100644
index 0000000..367b9de
--- /dev/null
+++ b/app-arch/ruszip/Manifest
@@ -0,0 +1,6 @@
+AUX zip-2.3-unix_configure-pic.patch 444 RMD160 8fd81ff732abe0e6189cd593c98e0055a11dca36 SHA1 c08486c683a9a8d02dbb0d500f421b07c0bcc704 SHA256 3e348be7890f21280fceab6cb2a87f3020b08a31608ab93d1b5a53667760e556
+AUX zip-2.31-exec-stack.patch 407 RMD160 a27f0112dbbda418feef97b66240442190e8b5d7 SHA1 3043e8150222749b6f05fc10f8ab1c15da21c8d0 SHA256 108686d8854096422bd4895690a37202aee66757d0d2b43afa16d9fb914cbb29
+AUX zip-2.32-build.patch 2003 RMD160 3356051c53465fa70015818b6c8c364489bb5bf0 SHA1 34492ef0e226ff7912de01c9266580b148ff54f1 SHA256 3e4b94015c1448c8769d7154b308bd986e1d0e6e514da151d658d1b8ba3a774c
+AUX zip232-ds-recoderus.patch 4337 RMD160 506017b6a9be390a655e9e34a2c2d1cf91e85589 SHA1 52746bd086356085a1788547116c1132edd570a4 SHA256 a0e69f760c98fd900cffd31e8e02085189fc66c786be09784f64191401805530
+DIST zip232.tar.gz 807180 RMD160 6b9326c8a60bc6bf08825e416140fd0ca8a6a7f1 SHA1 5bc562bf95d9aee0cb6625e6038898e1f191a4aa SHA256 d0d3743f732a9baa162f80d0c4567b9c545b41a3385825042113810f2a56eb2f
+EBUILD ruszip-2.32-r1.ebuild 1041 RMD160 2dfe64ee0cd4e4dfe036746332f34aec14cf0c7b SHA1 6475d9f51b6afd11a9c1776c40bfcaecc40c04be SHA256 5232b35d2fddf8a207ba919b146847e8df9c8900f0627f9a70883d78211f6557
diff --git a/app-arch/ruszip/files/zip-2.3-unix_configure-pic.patch b/app-arch/ruszip/files/zip-2.3-unix_configure-pic.patch
new file mode 100644
index 0000000..45b137b
--- /dev/null
+++ b/app-arch/ruszip/files/zip-2.3-unix_configure-pic.patch
@@ -0,0 +1,12 @@
+--- unix/configure.orig 2004-09-28 06:45:33.000000000 +0000
++++ unix/configure 2004-09-28 06:54:53.000000000 +0000
+@@ -29,6 +29,9 @@
+
+ echo Check if we can use asm code
+ OBJA=""
++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/app-arch/ruszip/files/zip-2.31-exec-stack.patch b/app-arch/ruszip/files/zip-2.31-exec-stack.patch
new file mode 100644
index 0000000..d3efbd9
--- /dev/null
+++ b/app-arch/ruszip/files/zip-2.31-exec-stack.patch
@@ -0,0 +1,20 @@
+--- zip-2.31/crc_i386.S
++++ zip-2.31/crc_i386.S
+@@ -238,3 +238,7 @@
+ #endif /* i386 || _i386 || _I386 || __i386 */
+
+ #endif /* !USE_ZLIB */
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",@progbits
++#endif
+--- zip-2.31/match.S
++++ zip-2.31/match.S
+@@ -405,3 +405,7 @@
+ #endif /* i386 || _I386 || _i386 || __i386 */
+
+ #endif /* !USE_ZLIB */
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",@progbits
++#endif
diff --git a/app-arch/ruszip/files/zip-2.32-build.patch b/app-arch/ruszip/files/zip-2.32-build.patch
new file mode 100644
index 0000000..61a2bae
--- /dev/null
+++ b/app-arch/ruszip/files/zip-2.32-build.patch
@@ -0,0 +1,89 @@
+respect build environment settings
+
+--- zip/unix/Makefile
++++ zip/unix/Makefile
+@@ -12,15 +12,15 @@
+
+ list: all
+
+-MAKE = make -f unix/Makefile
++MAKE := $(MAKE) -f unix/Makefile
+ SHELL = /bin/sh
+ LN = ln -s
+
+ # (to use the Gnu compiler, change cc to gcc in CC)
+-CC = cc
++CC ?= gcc
+ BIND = $(CC)
+ AS = $(CC) -c
+-CPP = /lib/cpp
++CPP ?= $(CC)
+ EXE =
+
+ # probably can change this to 'install' if you have it
+@@ -47,7 +47,7 @@
+ # LFLAGS1 flags after output file spec, before obj file list
+ # LFLAGS2 flags after obj file list (libraries, etc)
+ CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP)
+-CFLAGS = -O2 $(CFLAGS_NOOPT)
++CFLAGS ?= -O2 $(CFLAGS_NOOPT)
+ LFLAGS1 =
+ LFLAGS2 = -s
+
+--- zip/unix/configure
++++ zip/unix/configure
+@@ -13,52 +13,13 @@
+
+ CC=${1-cc}
+-CFLAGS=${2-"-I. -DUNIX"}
+-LFLAGS1=""
++CFLAGS="${2--I. -DUNIX} ${CFLAGS} ${CPPFLAGS}"
++LFLAGS1="${LDFLAGS}"
+ LN="ln -s"
+-echo "Check C compiler type (optimization option)"
+-cat > conftest.c << _EOF_
+-int main()
+-{
+-#ifndef __SUNPRO_C
+- bad code
+-#endif
+- return 0;
+-}
+-_EOF_
+-$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
+-if test $? -eq 0; then
+- echo ' Sun C (-xO3)'
+- CFLAGS="${CFLAGS} -xO3"
+-else
+- cat > conftest.c << _EOF_
+-int main()
+-{
+-#ifndef __DECC
+- bad code
+-#endif
+- return 0;
+-}
+-_EOF_
+- $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
+- if test $? -eq 0; then
+- echo ' DEC C (-O3)'
+- CFLAGS="${CFLAGS} -O3"
+- else
+- echo ' Other (gcc?) (-O2)'
+- CFLAGS="${CFLAGS} -O2"
+- fi
+-fi
+
+ 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/app-arch/ruszip/files/zip232-ds-recoderus.patch b/app-arch/ruszip/files/zip232-ds-recoderus.patch
new file mode 100644
index 0000000..de3e337
--- /dev/null
+++ b/app-arch/ruszip/files/zip232-ds-recoderus.patch
@@ -0,0 +1,165 @@
+diff -dPNur zip-2.32/unix/dsrecode.h zip-2.32-2/unix/dsrecode.h
+--- zip-2.32/unix/dsrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ zip-2.32-2/unix/dsrecode.h 2008-10-07 11:22:48.000000000 +0200
+@@ -0,0 +1,130 @@
++/******* WARNING: Multi-byte output encodings isn't supported! Comments
++may been striped!!!!
++I don't close 2 opened iconv descriptors. I think this wouldn't cause any
++problem. *******/
++
++#include <iconv.h>
++#include <errno.h>
++#include <locale.h>
++
++#define CHARSET_MAX_STRING_SIZE 4096
++#define LOCALE_STRING_LENGTH 64
++#define CHARSET_MAX_ERRORS 0
++#define ENV_VARIABLE "LC_CTYPE"
++#define LOCALE_VARIABLE LC_CTYPE
++
++static iconv_t ds_oem = (iconv_t)-1;
++static iconv_t ds_iso = (iconv_t)-1;
++
++extern int errno;
++static char xmms_charset_tmp[CHARSET_MAX_STRING_SIZE];
++static char charset_default[LOCALE_STRING_LENGTH]="";
++
++// Multi-byte strings still unsupported
++static void iconv_copysymbol(char **in_buf, size_t *in_left, char **out_buf, size_t *out_left) {
++ if ((out_left>0)&&(in_left>0)) {
++ (**out_buf)=(**in_buf);
++ (*out_buf)++;
++ (*in_buf)++;
++ (*in_left)--;
++ (*out_left)--;
++ }
++}
++
++static char *ds_recode(iconv_t icnv, char *buf, size_t len, size_t *rlen) {
++ char *in_buf, *out_buf, *res, err;
++ size_t in_left, out_left, olen;
++ int errors=0;
++
++ if (!len) {
++ len=strlen(buf);
++ } else {
++ olen=strlen(buf);
++ if (olen<len) len=olen;
++ }
++
++ if (iconv(icnv, NULL, NULL, NULL, NULL) == -1) return NULL;
++
++ in_buf = buf;
++ in_left = len;
++ out_buf = xmms_charset_tmp;
++ out_left = CHARSET_MAX_STRING_SIZE;
++
++loop:
++ err=iconv(icnv, &in_buf, &in_left, &out_buf, &out_left);
++ if (err<0) {
++ if (errno==E2BIG) {
++ *(int*)(xmms_charset_tmp+(CHARSET_MAX_STRING_SIZE-sizeof(int)))=0;
++ } else if (errno==EILSEQ) {
++ if (errors<CHARSET_MAX_ERRORS) {
++ errors++;
++ iconv_copysymbol(&in_buf, &in_left, &out_buf, &out_left);
++ if (in_left>0) goto loop;
++ } else return NULL;
++ } else return NULL;
++ }
++
++ olen = CHARSET_MAX_STRING_SIZE - out_left;
++ res = malloc(olen+1);
++ if (!res) return NULL;
++
++ memcpy(res,xmms_charset_tmp,olen);
++ res[olen]=0;
++ if (rlen) *rlen=olen;
++ return res;
++}
++
++
++static void charset_setdefault() {
++ char *str1, *str2;
++ str1 = (char*)setlocale(LOCALE_VARIABLE, NULL);
++ if (str1) {
++ if (!strcasecmp(str1,"C")) {
++ setlocale(LC_ALL, "");
++ str1 = setlocale(LOCALE_VARIABLE, NULL);
++ }
++ } else str1 = getenv(ENV_VARIABLE);
++ if (str1) {
++ str2 = strrchr(str1,'.');
++ if (str2) {
++ strncpy(charset_default,str2+1,LOCALE_STRING_LENGTH);
++ charset_default[LOCALE_STRING_LENGTH-1]=0;
++ str2 = strchr(charset_default,'@');
++ if (str2) *str2 = 0;
++ } else {
++ strcpy(charset_default,"KOI8-R");
++ }
++ } else {
++ strcpy(charset_default,"KOI8-R");
++ }
++}
++
++void ds_ex2in(char *string) {
++ char *str;
++ if (ds_oem == (iconv_t)-1) {
++ if (!charset_default[0]) charset_setdefault();
++ ds_oem = iconv_open("CP866",charset_default);
++ if (!ds_oem) return;
++ }
++ str=ds_recode(ds_oem,string,0,NULL);
++ if (str) {
++ strncpy(string,str,strlen(string)+1);
++ free(str);
++ }
++}
++
++void ds_in2ex(char *dst, char *string) {
++ char *str;
++ if (ds_iso == (iconv_t)-1) {
++ if (!charset_default[0]) charset_setdefault();
++ ds_iso = iconv_open(charset_default, "CP866");
++ if (!ds_iso) return;
++ }
++ str=ds_recode(ds_iso,string,0,NULL);
++ if (str) {
++ strncpy(dst,str,strlen(string)+1);
++ free(str);
++ } else {
++ strncpy(dst,string,strlen(string)+1);
++ }
++}
+diff -dPNur zip-2.32/unix/unix.c zip-2.32-2/unix/unix.c
+--- zip-2.32/unix/unix.c 2006-05-30 00:35:00.000000000 +0200
++++ zip-2.32-2/unix/unix.c 2008-10-07 11:23:45.000000000 +0200
+@@ -219,6 +219,8 @@
+ return ZE_OK;
+ }
+
++#include "dsrecode.h"
++
+ char *ex2in(x, isdir, pdosflag)
+ char *x; /* external file name */
+ int isdir; /* input: x is a directory */
+@@ -266,6 +268,8 @@
+
+ #ifdef EBCDIC
+ strtoasc(n, n); /* here because msname() needs native coding */
++#else
++ ds_ex2in(n);
+ #endif
+
+ /* Returned malloc'ed name */
+@@ -288,7 +292,8 @@
+ #ifdef EBCDIC
+ strtoebc(x, n);
+ #else
+- strcpy(x, n);
++// strcpy(x, n);
++ ds_in2ex(x,n);
+ #endif
+ return x;
+ }
diff --git a/app-arch/ruszip/ruszip-2.32-r1.ebuild b/app-arch/ruszip/ruszip-2.32-r1.ebuild
new file mode 100644
index 0000000..a38b851
--- /dev/null
+++ b/app-arch/ruszip/ruszip-2.32-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/zip/zip-2.32-r1.ebuild,v 1.8 2008/03/17 16:06:43 jer Exp $
+
+inherit toolchain-funcs eutils flag-o-matic
+
+DESCRIPTION="Info ZIP (encryption support) with CP866 recoding"
+HOMEPAGE="http://www.info-zip.org/"
+SRC_URI="ftp://ftp.info-zip.org/pub/infozip/src/zip${PV//.}.tar.gz"
+
+LICENSE="Info-ZIP"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE="crypt"
+
+DEPEND=""
+
+#SDS
+S=${WORKDIR}/zip-${PV}
+#EDS
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/zip-2.3-unix_configure-pic.patch
+ epatch "${FILESDIR}"/zip-2.31-exec-stack.patch
+ epatch "${FILESDIR}"/zip-2.32-build.patch
+
+#SDS
+ epatch "${FILESDIR}"/zip232-ds-recoderus.patch
+#EDS
+}
+
+src_compile() {
+ tc-export CC CPP
+ use crypt || append-flags -DNO_CRYPT
+ append-lfs-flags
+ emake -f unix/Makefile generic || die
+}
+
+src_install() {
+#SDS
+ mv zip ruszip
+ dobin ruszip || die
+#EDS
+}