diff options
Diffstat (limited to 'source/a/ncompress')
-rw-r--r-- | source/a/ncompress/ncompress-4.2.4-bssUnderflow.patch | 13 | ||||
-rw-r--r-- | source/a/ncompress/ncompress-4.2.4-endians.patch | 11 | ||||
-rw-r--r-- | source/a/ncompress/ncompress.2GB.diff | 11 | ||||
-rwxr-xr-x | source/a/ncompress/ncompress.SlackBuild | 81 | ||||
-rw-r--r-- | source/a/ncompress/ncompress.filenamelen.diff | 98 | ||||
-rw-r--r-- | source/a/ncompress/ncompress.lfs2.diff | 52 | ||||
-rw-r--r-- | source/a/ncompress/ncompress.make.diff | 60 | ||||
-rw-r--r-- | source/a/ncompress/ncompress.zerobyteforce.diff | 24 | ||||
-rw-r--r-- | source/a/ncompress/slack-desc | 19 |
9 files changed, 369 insertions, 0 deletions
diff --git a/source/a/ncompress/ncompress-4.2.4-bssUnderflow.patch b/source/a/ncompress/ncompress-4.2.4-bssUnderflow.patch new file mode 100644 index 00000000..0ae7ec59 --- /dev/null +++ b/source/a/ncompress/ncompress-4.2.4-bssUnderflow.patch @@ -0,0 +1,13 @@ +--- ncompress-4.2.4/compress42.c.bssUnderflow 2006-08-10 11:40:03.000000000 +0200 ++++ ncompress-4.2.4/compress42.c 2006-08-10 11:40:31.000000000 +0200 +@@ -1689,6 +1689,10 @@ + + if (oldcode == -1) + { ++ if (code >= 256) { ++ fprintf(stderr, "uncompress: corrupt input\n"); ++ abort_compress(); ++ } + outbuf[outpos++] = (char_type)(finchar = (int)(oldcode = code)); + continue; + } diff --git a/source/a/ncompress/ncompress-4.2.4-endians.patch b/source/a/ncompress/ncompress-4.2.4-endians.patch new file mode 100644 index 00000000..fdc96622 --- /dev/null +++ b/source/a/ncompress/ncompress-4.2.4-endians.patch @@ -0,0 +1,11 @@ +--- ncompress-4.2.4/compress42.c.endians 2006-09-19 13:53:58.000000000 +0200 ++++ ncompress-4.2.4/compress42.c 2006-09-19 13:57:54.000000000 +0200 +@@ -432,7 +432,7 @@ + + union bytes + { +- long word; ++ int word; + struct + { + #if BYTEORDER == 4321 diff --git a/source/a/ncompress/ncompress.2GB.diff b/source/a/ncompress/ncompress.2GB.diff new file mode 100644 index 00000000..8c545caf --- /dev/null +++ b/source/a/ncompress/ncompress.2GB.diff @@ -0,0 +1,11 @@ +--- ncompress-4.2.4/compress42.c.2GB 2004-07-14 12:16:19.000000000 -0400 ++++ ncompress-4.2.4/compress42.c 2004-07-14 12:16:59.000000000 -0400 +@@ -1329,7 +1329,7 @@ + REG11 int boff; + REG12 int n_bits; + REG13 int ratio; +- REG14 long checkpoint; ++ REG14 unsigned long long checkpoint; + REG15 code_int extcode; + union + { diff --git a/source/a/ncompress/ncompress.SlackBuild b/source/a/ncompress/ncompress.SlackBuild new file mode 100755 index 00000000..e8b1c68f --- /dev/null +++ b/source/a/ncompress/ncompress.SlackBuild @@ -0,0 +1,81 @@ +#!/bin/sh + +# Copyright 2005-2009 Patrick J. Volkerding, Sebeka, Minnesota, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +VERSION=4.2.4 +ARCH=${ARCH:-x86_64} +BUILD=${BUILD:-1} + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-ncompress + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf ncompress-${VERSION} +tar xzf $CWD/ncompress-${VERSION}.tar.gz +cd ncompress-${VERSION} +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +zcat $CWD/ncompress.make.diff.gz | patch -p1 --verbose || exit 1 +zcat $CWD/ncompress.lfs2.diff.gz | patch -p1 --verbose || exit 1 +zcat $CWD/ncompress.filenamelen.diff.gz | patch -p1 --verbose || exit 1 +zcat $CWD/ncompress.2GB.diff.gz | patch -p1 --verbose || exit 1 +zcat $CWD/ncompress.zerobyteforce.diff.gz | patch -p1 --verbose || exit 1 +zcat $CWD/ncompress-${VERSION}-bssUnderflow.patch.gz | patch -p1 --verbose || exit 1 +zcat $CWD/ncompress-${VERSION}-endians.patch.gz | patch -p1 --verbose || exit 1 + +make ENDIAN=4321 || exit 1 +mkdir -p $PKG/usr/bin +cat compress > $PKG/usr/bin/compress +chmod 755 $PKG/usr/bin/compress +( cd $PKG/usr/bin ; ln -sf compress uncompress ) +mkdir $PKG/bin +( cd $PKG/bin ; ln -sf /usr/bin/compress compress ) +( cd $PKG/bin ; ln -sf compress uncompress ) +mkdir -p $PKG/usr/man/man1 +cat compress.1 | gzip -9c > $PKG/usr/man/man1/compress.1.gz +echo '.so man1/compress.1' | gzip -9c > $PKG/usr/man/man1/uncompress.1.gz +mkdir -p $PKG/usr/doc/ncompress-${VERSION} +cp -a \ + Acknowleds LZW.INFO README \ + $PKG/usr/doc/ncompress-${VERSION} + +# Strip everything for good measure: +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +# Build the package: +cd $PKG +makepkg -l y -c n $TMP/ncompress-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/a/ncompress/ncompress.filenamelen.diff b/source/a/ncompress/ncompress.filenamelen.diff new file mode 100644 index 00000000..67676c7a --- /dev/null +++ b/source/a/ncompress/ncompress.filenamelen.diff @@ -0,0 +1,98 @@ +--- ncompress-4.2.4/compress42.c.filenamelen Wed Nov 21 12:19:38 2001 ++++ ncompress-4.2.4/compress42.c Wed Nov 21 12:20:03 2001 +@@ -140,6 +140,7 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <errno.h> ++#include <string.h> + + #ifdef DIRENT + # include <dirent.h> +@@ -213,7 +214,7 @@ + # define OBUFSIZ BUFSIZ /* Default output buffer size */ + #endif + +-#define MAXPATHLEN 1024 /* MAXPATHLEN - maximum length of a pathname we allow */ ++#define MAXPATHLEN PATH_MAX /* MAXPATHLEN - maximum length of a pathname we allow */ + #define SIZE_INNER_LOOP 256 /* Size of the inter (fast) compress loop */ + + /* Defines for third byte of header */ +@@ -641,13 +642,11 @@ + } ; + #endif + +-void main ARGS((int,char **)); + void Usage ARGS((void)); + void comprexx ARGS((char **)); + void compdir ARGS((char *)); + void compress ARGS((int,int)); + void decompress ARGS((int,int)); +-char *rindex ARGS((char *,int)); + void read_error ARGS((void)); + void write_error ARGS((void)); + void abort_compress ARGS((void)); +@@ -694,13 +693,15 @@ + * deterministic, and can be done on the fly. Thus, the decompression + * procedure needs no input table, but tracks the way the table was built. + */ +-void ++int + main(argc, argv) + REG1 int argc; + REG2 char *argv[]; + { + REG3 char **filelist; + REG4 char **fileptr; ++ int i; ++ + + if (fgnd_flag = (signal(SIGINT, SIG_IGN) != SIG_IGN)) + signal(SIGINT, (SIG_TYPE)abort_compress); +@@ -714,7 +715,14 @@ + nomagic = 1; /* Original didn't have a magic number */ + #endif + +- filelist = fileptr = (char **)malloc(argc*sizeof(char *)); ++ for(i=0;i<argc;i++){ ++ if(strlen(argv[i])>(MAXPATHLEN-1)){ ++ fprintf(stderr,"Filename too long\n"); ++ exit(1); ++ } ++ } ++ ++ filelist = fileptr = (char **)malloc(argc*sizeof(char *)); + *filelist = NULL; + + if((progname = rindex(argv[0], '/')) != 0) +@@ -853,8 +861,9 @@ + else + decompress(0, 1); + } +- ++ + exit((exit_code== -1) ? 1:exit_code); ++ return 0; + } + + void +@@ -1801,20 +1810,6 @@ + write_error(); + } + +-char * +-rindex(s, c) /* For those who don't have it in libc.a */ +- REG1 char *s; +- REG2 int c; +- { +- char *p; +- +- for (p = NULL; *s; s++) +- if (*s == (char)c) +- p = s; +- +- return(p); +- } +- + void + read_error() + { diff --git a/source/a/ncompress/ncompress.lfs2.diff b/source/a/ncompress/ncompress.lfs2.diff new file mode 100644 index 00000000..9da42eb5 --- /dev/null +++ b/source/a/ncompress/ncompress.lfs2.diff @@ -0,0 +1,52 @@ +--- ncompress-4.2.4/compress42.c.lfs 2002-06-19 19:19:33.000000000 -0400 ++++ ncompress-4.2.4/compress42.c 2002-06-19 19:20:48.000000000 -0400 +@@ -130,6 +130,7 @@ + * Add variable bit length output. + * + */ ++#include <unistd.h> + #include <stdio.h> + #include <fcntl.h> + #include <ctype.h> +@@ -168,30 +169,6 @@ + # define SIG_TYPE void (*)() + #endif + +-#ifndef NOFUNCDEF +- extern void *malloc LARGS((int)); +- extern void free LARGS((void *)); +-#ifndef _IBMR2 +- extern int open LARGS((char const *,int,...)); +-#endif +- extern int close LARGS((int)); +- extern int read LARGS((int,void *,int)); +- extern int write LARGS((int,void const *,int)); +- extern int chmod LARGS((char const *,int)); +- extern int unlink LARGS((char const *)); +- extern int chown LARGS((char const *,int,int)); +- extern int utime LARGS((char const *,struct utimbuf const *)); +- extern char *strcpy LARGS((char *,char const *)); +- extern char *strcat LARGS((char *,char const *)); +- extern int strcmp LARGS((char const *,char const *)); +- extern unsigned strlen LARGS((char const *)); +- extern void *memset LARGS((void *,char,unsigned int)); +- extern void *memcpy LARGS((void *,void const *,unsigned int)); +- extern int atoi LARGS((char const *)); +- extern void exit LARGS((int)); +- extern int isatty LARGS((int)); +-#endif +- + #define MARK(a) { asm(" .globl M.a"); asm("M.a:"); } + + #ifdef DEF_ERRNO +@@ -535,8 +512,8 @@ + char ofname[MAXPATHLEN]; /* Output filename */ + int fgnd_flag = 0; /* Running in background (SIGINT=SIGIGN) */ + +-long bytes_in; /* Total number of byte from input */ +-long bytes_out; /* Total number of byte to output */ ++long long bytes_in; /* Total number of byte from input */ ++long long bytes_out; /* Total number of byte to output */ + + /* + * 8086 & 80286 Has a problem with array bigger than 64K so fake the array diff --git a/source/a/ncompress/ncompress.make.diff b/source/a/ncompress/ncompress.make.diff new file mode 100644 index 00000000..2a0acc1c --- /dev/null +++ b/source/a/ncompress/ncompress.make.diff @@ -0,0 +1,60 @@ +--- ncompress-4.2.4/Makefile.orig Thu Oct 31 10:38:46 1996 ++++ ncompress-4.2.4/Makefile Thu Oct 31 10:39:12 1996 +@@ -0,0 +1,57 @@ ++# Makefile generated by build. ++ ++# C complier ++CC=cc $(RPM_OPT_FLAGS) ++ ++# Install directory for binarys ++BINDIR=/usr/bin ++ ++# Install directory for manual ++MANDIR=/usr/man/man1 ++ ++# compiler options: ++# options is a collection of: ++# ++# -DAMIGA=1 Amiga support. ++# -DNOFUNCDEF=1 Disable libary function definitions in ++# compress42.c ++# -DDIRENT=1 Use dirent.h ++# -DSYSDIR=1 Use sys/dir.h ++# -DLSTAT=1 Use lstat for finding symlinks. ++# -DUTIME_H=1 Use utime.h ++# -DUSERMEM=<size> Availble memory for compress (default 800k). ++# -DREGISTERS=<nbr> Number of registers (default 2). ++# -DIBUFSIZ=<size> Input buffer size (default BUFSIZ). ++# -DOBUFSIZ=<size> Output buffer size (default BUFSIZ) ++# -DBYTEORDER=<order> Byte order (default: unknown). ++# -DNOALLIGN=1 Data word allignment (default: yes). ++# -DDEF_ERRNO=1 Define error (not defined in errno.h). ++# -DMAXSEG_64K=1 -BITS=16 Support segment processsor like 80286. ++# ++options= -DDIRENT=1 -DSYSDIR=1 -DUTIME_H=1 -DUSERMEM=800000 -DREGISTERS=20 -DIBUFSIZ=1024 -DOBUFSIZ=1024 -DBYTEORDER=$(ENDIAN) ++ ++# libary options ++LBOPT= ++ ++ ++compress: Makefile compress42.c patchlevel.h ++ $(CC) -o compress $(options) "-DCOMPILE_DATE=\"`date`\"" compress42.c ++ ++install: compress ++ [ -f $(BINDIR)/compress ] && \ ++ { rm -f $(BINDIR)/compress.old ; \ ++ mv $(BINDIR)/compress $(BINDIR)/compress.old ; } ++ rm -f $(BINDIR)/uncompress $(BINDIR)/zcat ++ cp compress $(BINDIR)/compress ++ strip $(BINDIR)/compress ++ rm -f $(BINDIR)/uncompress ++ ln $(BINDIR)/compress $(BINDIR)/uncompress ++ rm -f $(BINDIR)/zcat ++ ln -f $(BINDIR)/compress $(BINDIR)/zcat ++ cp zcmp zdiff zmore $(BINDIR)/. ++ chmod 0755 $(BINDIR)/compress $(BINDIR)/zcmp $(BINDIR)/zdiff $(BINDIR)/zmore ++ cp compress.1 zcmp.1 zmore.1 $(MANDIR)/. ++ chmod 0644 $(MANDIR)/compress.1 $(MANDIR)/zcmp.1 $(MANDIR)/zmore.1 ++ ++cleanup: ++ rm -f compress compress.def comp.log diff --git a/source/a/ncompress/ncompress.zerobyteforce.diff b/source/a/ncompress/ncompress.zerobyteforce.diff new file mode 100644 index 00000000..465d67e3 --- /dev/null +++ b/source/a/ncompress/ncompress.zerobyteforce.diff @@ -0,0 +1,24 @@ +--- ncompress-4.2.4/compress42.c.zerobyteforce 2006-04-14 14:18:28.000000000 +0200 ++++ ncompress-4.2.4/compress42.c 2006-04-14 14:20:15.000000000 +0200 +@@ -1145,10 +1145,12 @@ + if (fdout != 1 && close(fdout)) + write_error(); + +- if (bytes_in == 0) ++ if ( (bytes_in == 0) && (force == 0 ) ) + { + if (remove_ofname) + { ++ if(!quiet) ++ fprintf(stderr, "No compression -- %s unchanged\n", ifname); + if (unlink(ofname)) /* Remove input file */ + { + fprintf(stderr, "\nunlink error (ignored) "); +@@ -1157,6 +1159,7 @@ + } + + remove_ofname = 0; ++ exit_code = 2; + } + } + else diff --git a/source/a/ncompress/slack-desc b/source/a/ncompress/slack-desc new file mode 100644 index 00000000..24bfa022 --- /dev/null +++ b/source/a/ncompress/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +ncompress: ncompress (the classic *nix compression utility) +ncompress: +ncompress: Compress reduces the size of the named files using adaptive Lempel-Ziv +ncompress: coding. Whenever possible, each file is replaced by one with the +ncompress: extension .Z, while keeping the same ownership modes, access and +ncompress: modification times. If no files are specified, the standard input is +ncompress: compressed to the standard output. Compressed files can be restored +ncompress: to their original form using uncompress or zcat. +ncompress: +ncompress: +ncompress: |