OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 12-Aug-2006 14:13:38
Branch: HEAD Handle: 2006081213133700
Added files:
openpkg-src/ncompress ncompress.patch ncompress.spec
Log:
new package: ncompress 4.2.4 (Classical Unix LZW Compression)
Summary:
Revision Changes Path
1.1 +185 -0 openpkg-src/ncompress/ncompress.patch
1.1 +92 -0 openpkg-src/ncompress/ncompress.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/ncompress/ncompress.patch
============================================================================
$ cvs diff -u -r0 -r1.1 ncompress.patch
--- /dev/null 2006-08-12 14:13:00 +0200
+++ ncompress.patch 2006-08-12 14:13:37 +0200
@@ -0,0 +1,185 @@
+Index: compress.1
+--- compress.1.orig 1992-08-31 16:46:53 +0200
++++ compress.1 2006-08-12 14:09:31 +0200
+@@ -1,7 +1,7 @@
+ .PU
+ .TH COMPRESS 1 local
+ .SH NAME
+-compress, uncompress, zcat \- compress and expand data (version 4.1)
++compress, uncompress \- compress and expand data (version 4.2)
+ .SH SYNOPSIS
+ .ll +8
+ .B compress
+@@ -36,12 +36,6 @@
+ .I "name \&..."
+ ]
+ .br
+-.B zcat
+-[
+-.B \-V
+-] [
+-.I "name \&..."
+-]
+ .SH DESCRIPTION
+ .I Compress
+ reduces the size of the named files using adaptive Lempel-Ziv coding.
+@@ -68,9 +62,7 @@
+ the user is prompted as to whether an existing file should be overwritten.
+ .PP
+ Compressed files can be restored to their original form using
+-.I uncompress
+-or
+-.I zcat.
++.I uncompress.
+ .PP
+ .I uncompress
+ takes a list of files on its command line and replaces each
+@@ -88,19 +80,6 @@
+ .I compress/uncompress
+ write to the standard output; no files are changed.
+ .PP
+-.I zcat
+-is identical to
+-.I uncompress
+-.B \-c.
+-.I zcat
+-uncompresses either a list of files on the command line or its
+-standard input and writes the uncompressed data on standard output.
+-.I zcat
+-will uncompress files that have the correct magic number whether
+-they have a
+-.B "\&.Z"
+-suffix or not.
+-.PP
+ If the
+ .B \-r
+ flag is specified,
+@@ -175,13 +154,13 @@
+ option,
+ a message is printed yielding the percentage of
+ reduction for each file compressed.
+-.PP
+-Exit status is normally 0;
+-if the last file is larger after (attempted) compression, the status is 2;
+-if an error occurs, exit status is 1.
+ .SH "SEE ALSO"
+ pack(1), compact(1)
+ .SH "DIAGNOSTICS"
++Exit status is normally 0;
++if the last file is larger after (attempted) compression, the status is 2;
++if an error occurs, exit status is 1.
++.PP
+ Usage: compress [\-dfvcVr] [\-b maxbits] [file ...]
+ .in +8
+ Invalid options were specified on the command line.
+@@ -272,13 +251,14 @@
+ a small process data space (64KB or less, as exhibited by the DEC PDP
+ series, the Intel 80286, etc.)
+ .PP
+-Invoking compress with a \-r
++Invoking compress with a
++.BR \-r
+ flag will occasionally cause it to produce spurious error warnings of the
form
+ .PP
+ .in 8
+ "<filename>.Z already has .Z suffix - ignored"
+ .in -8
+ .PP
+-These warnings can be ignored. See the comments in compress.c:compdir()
+-for an explanation.
++These warnings can be ignored. See the comments in compress42.c:compdir()
++in the source distribution for an explanation.
+
+Index: compress42.c
+--- compress42.c.orig 1992-10-28 12:10:53 +0100
++++ compress42.c 2006-08-12 14:10:40 +0200
+@@ -131,6 +131,8 @@
+ *
+ */
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <fcntl.h>
+ #include <ctype.h>
+ #include <signal.h>
+@@ -230,6 +232,8 @@
+
+ #define INIT_BITS 9 /* initial number of bits/code */
+
++#define MIN_MAXBITS 10 /* min value for -b maxbits (smaller
causes corruption) */
++
+ #ifndef SACREDMEM
+ /*
+ * SACREDMEM is the amount of physical memory saved for others; compress
+@@ -638,13 +642,13 @@
+ } ;
+ #endif
+
+-void main ARGS((int,char **));
++int 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));
++char *my_rindex ARGS((char *,int));
+ void read_error ARGS((void));
+ void write_error ARGS((void));
+ void abort_compress ARGS((void));
+@@ -691,7 +695,7 @@
+ * 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[];
+@@ -714,7 +718,7 @@
+ filelist = fileptr = (char **)malloc(argc*sizeof(char *));
+ *filelist = NULL;
+
+- if((progname = rindex(argv[0], '/')) != 0)
++ if((progname = my_rindex(argv[0], '/')) != 0)
+ progname++;
+ else
+ progname = argv[0];
+@@ -819,7 +823,7 @@
+ nextarg: continue;
+ }
+
+- if (maxbits < INIT_BITS) maxbits = INIT_BITS;
++ if (maxbits < MIN_MAXBITS) maxbits = MIN_MAXBITS;
+ if (maxbits > BITS) maxbits = BITS;
+
+ if (*filelist != NULL)
+@@ -883,6 +887,10 @@
+ int fdout;
+ char tempname[MAXPATHLEN];
+
++ if (strlen(*fileptr) > (MAXPATHLEN - 1)) {
++ fprintf(stderr, "Pathname too long: %s\n", *fileptr);
++ return;
++ }
+ strcpy(tempname,*fileptr);
+ errno = 0;
+
+@@ -1737,7 +1745,7 @@
+ code = oldcode;
+ }
+
+- while ((cmp_code_int)code >= (cmp_code_int)256)
++ while ((cmp_code_int)code >= (cmp_code_int)256
&& stackp > (char_type *)&htabof(0) /* CVE-2006-1168 */)
+ { /* Generate output characters in reverse
order */
+ *--stackp = tab_suffixof(code);
+ code = tab_prefixof(code);
+@@ -1799,7 +1807,7 @@
+ }
+
+ char *
+-rindex(s, c) /* For those who don't have it in libc.a */
++my_rindex(s, c) /* For those who don't have it in libc.a */
+ REG1 char *s;
+ REG2 int c;
+ {
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/ncompress/ncompress.spec
============================================================================
$ cvs diff -u -r0 -r1.1 ncompress.spec
--- /dev/null 2006-08-12 14:13:00 +0200
+++ ncompress.spec 2006-08-12 14:13:37 +0200
@@ -0,0 +1,92 @@
+##
+## ncompress.spec -- OpenPKG RPM Package Specification
+## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
+## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
+##
+## Permission to use, copy, modify, and distribute this software for
+## any purpose with or without fee is hereby granted, provided that
+## the above copyright notice and this permission notice appear in all
+## copies.
+##
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+## CONTRIBUTORS 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.
+##
+
+# package information
+Name: ncompress
+Summary: Classical Unix LZW Compression
+URL: ftp://ftp.ibiblio.org/pub/linux/utils/compress/
+Vendor: James A. Woods et al.
+Packager: OpenPKG
+Distribution: OpenPKG
+Class: EVAL
+Group: Compression
+License: Public Domain
+Version: 4.2.4
+Release: 20060812
+
+# list of sources
+Source0:
ftp://ftp.ibiblio.org/pub/linux/utils/compress/ncompress-%{version}.tar.Z
+Patch0: ncompress.patch
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20040130
+PreReq: OpenPKG, openpkg >= 20040130
+AutoReq: no
+AutoReqProv: no
+
+%description
+ Compress is a fast and simple LZW file compressor. Compress does
+ not have the highest compression rate, but it is one of the fastest
+ programs to compress data. Compress was the defacto standard in the
+ 1990's in the UNIX community for compressing files.
+
+%track
+ prog ncompress = {
+ version = %{version}
+ url = ftp://ftp.ibiblio.org/pub/linux/utils/compress/
+ regex = ncompress-(__VER__)\.tar\.gz
+ }
+
+%prep
+ %setup -q
+ %patch -p0
+
+%build
+ cp Makefile.def Makefile
+ %{l_make} %{l_mflags} \
+ CC="%{l_cc} %{l_cflags -O}" \
+ options="-DDIRENT=1 -DUSERMEM=800000 -DREGISTERS=3 -DNOFUNCDEF=1"
+
+%install
+ rm -rf $RPM_BUILD_ROOT
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/bin \
+ $RPM_BUILD_ROOT%{l_prefix}/man/man1
+ %{l_shtool} install -c -s -m 755 \
+ compress $RPM_BUILD_ROOT%{l_prefix}/bin/
+ %{l_shtool} install -c -m 644 \
+ compress.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
+ ln $RPM_BUILD_ROOT%{l_prefix}/bin/compress \
+ $RPM_BUILD_ROOT%{l_prefix}/bin/uncompress
+ ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/compress.1 \
+ $RPM_BUILD_ROOT%{l_prefix}/man/man1/uncompress.1
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]