diff --git a/.ncompress.metadata b/.ncompress.metadata new file mode 100644 index 0000000..d5e86b6 --- /dev/null +++ b/.ncompress.metadata @@ -0,0 +1 @@ +5f43cc6cfe5f70a8a58fdcf0fc40f4ab2168ee2f SOURCES/ncompress-4.2.4.4.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/ncompress-4.2.4.4-2GB.patch b/SOURCES/ncompress-4.2.4.4-2GB.patch new file mode 100644 index 0000000..cf1ac52 --- /dev/null +++ b/SOURCES/ncompress-4.2.4.4-2GB.patch @@ -0,0 +1,13 @@ +diff --git a/compress42.c b/compress42.c +index 4d33342..495bdf3 100644 +--- a/compress42.c ++++ b/compress42.c +@@ -1373,7 +1373,7 @@ compress(fdin, fdout) + 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/SOURCES/ncompress-4.2.4.4-endians.patch b/SOURCES/ncompress-4.2.4.4-endians.patch new file mode 100644 index 0000000..fdc9662 --- /dev/null +++ b/SOURCES/ncompress-4.2.4.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/SOURCES/ncompress-4.2.4.4-filenamelen.patch b/SOURCES/ncompress-4.2.4.4-filenamelen.patch new file mode 100644 index 0000000..49b7841 --- /dev/null +++ b/SOURCES/ncompress-4.2.4.4-filenamelen.patch @@ -0,0 +1,60 @@ +diff --git a/compress42.c b/compress42.c +index b3b3add..6878046 100644 +--- a/compress42.c ++++ b/compress42.c +@@ -141,6 +141,7 @@ + #include + #include + #include ++#include + + #ifdef DIRENT + # include +@@ -214,7 +215,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 */ +@@ -701,6 +702,7 @@ main(argc, 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,13 +716,18 @@ main(argc, argv) + nomagic = 1; /* Original didn't have a magic number */ + #endif + +- filelist = (char **)malloc(argc*sizeof(char *)); ++ for (i=0; i(MAXPATHLEN-1)) { ++ fprintf(stderr,"Filename too long\n"); ++ exit(1); ++ } ++ } ++ filelist = fileptr = (char **)malloc(argc*sizeof(char *)); + if (filelist == NULL) + { + fprintf(stderr, "Cannot allocate memory for file list.\n"); + exit (1); + } +- fileptr = filelist; + *filelist = NULL; + + if((progname = strrchr(argv[0], '/')) != 0) +@@ -860,7 +867,9 @@ nextarg: continue; + decompress(0, 1); + } + ++ free(filelist); + exit((exit_code== -1) ? 1:exit_code); ++ return 0; + } + + void diff --git a/SOURCES/ncompress-4.2.4.4-lfs.patch b/SOURCES/ncompress-4.2.4.4-lfs.patch new file mode 100644 index 0000000..2559799 --- /dev/null +++ b/SOURCES/ncompress-4.2.4.4-lfs.patch @@ -0,0 +1,23 @@ +diff --git a/compress42.c b/compress42.c +index 804d099..b3b3add 100644 +--- a/compress42.c ++++ b/compress42.c +@@ -130,6 +130,7 @@ + * Add variable bit length output. + * + */ ++#include + #include + #include + #include +@@ -538,8 +539,8 @@ int remove_ofname = 0; /* Remove output file on a error */ + 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/SOURCES/ncompress-4.2.4.4-make.patch b/SOURCES/ncompress-4.2.4.4-make.patch new file mode 100644 index 0000000..3d1878f --- /dev/null +++ b/SOURCES/ncompress-4.2.4.4-make.patch @@ -0,0 +1,20 @@ +diff --git a/Makefile.def b/Makefile.def +index e493d7c..1e6612f 100644 +--- a/Makefile.def ++++ b/Makefile.def +@@ -31,7 +31,14 @@ MANDIR=/usr/local/man/man1 + # -DDEF_ERRNO=1 Define error (not defined in errno.h). + # -DMAXSEG_64K=1 -BITS=16 Support segment processsor like 80286. + # +-options= $(CFLAGS) $(CPPFLAGS) -DDIRENT=1 -DUSERMEM=800000 -DREGISTERS=3 ++options= $(CFLAGS) $(CPPFLAGS) -DDIRENT=1 -DUSERMEM=800000 -DREGISTERS=20 \ ++ -D_FILE_OFFSET_BITS=64 \ ++ -D_LARGEFILE_SOURCE \ ++ -DNOFUNCDEF=1 \ ++ -DOBUFSIZ=1024 \ ++ -DUTIME_H \ ++ -DSYSDIR=1 \ ++ $(ARCH_FLAGS) + + # libary options + LBOPT= $(LDFLAGS) diff --git a/SOURCES/ncompress-4.2.4.4-memmove.patch b/SOURCES/ncompress-4.2.4.4-memmove.patch new file mode 100644 index 0000000..d8fec3e --- /dev/null +++ b/SOURCES/ncompress-4.2.4.4-memmove.patch @@ -0,0 +1,12 @@ +diff -urNp ncompress-4.2.4-orig/compress42.c ncompress-4.2.4/compress42.c +--- ncompress-4.2.4-orig/compress42.c 2012-01-03 15:13:58.014222927 +0100 ++++ ncompress-4.2.4/compress42.c 2012-01-03 15:15:17.117097419 +0100 +@@ -1441,7 +1441,7 @@ compress(fdin, fdout) + boff = -(((OBUFSIZ<<3)-boff)%(n_bits<<3)); + bytes_out += OBUFSIZ; + +- memcpy(outbuf, outbuf+OBUFSIZ, (outbits>>3)+1); ++ memmove(outbuf, outbuf+OBUFSIZ, (outbits>>3)+1); + memset(outbuf+(outbits>>3)+1, '\0', OBUFSIZ); + } + diff --git a/SOURCES/ncompress-4.2.4.4-silence-gcc.patch b/SOURCES/ncompress-4.2.4.4-silence-gcc.patch new file mode 100644 index 0000000..738ce80 --- /dev/null +++ b/SOURCES/ncompress-4.2.4.4-silence-gcc.patch @@ -0,0 +1,33 @@ +diff --git a/compress42.c b/compress42.c +index c3f6b35..834c2f2 100644 +--- a/compress42.c ++++ b/compress42.c +@@ -704,7 +704,7 @@ main(argc, argv) + REG4 char **fileptr; + int i; + +- if (fgnd_flag = (signal(SIGINT, SIG_IGN) != SIG_IGN)) ++ if ((fgnd_flag = (signal(SIGINT, SIG_IGN)) != SIG_IGN)) + signal(SIGINT, (SIG_TYPE)abort_compress); + + signal(SIGTERM, (SIG_TYPE)abort_compress); +@@ -1016,8 +1016,8 @@ comprexx(fileptr) + + if (infstat.st_nlink > 1 && (!force)) + { +- fprintf(stderr, "%s has %d other links: unchanged\n", +- tempname, infstat.st_nlink - 1); ++ fprintf(stderr, "%s has %ld other links: unchanged\n", ++ tempname, (long)(infstat.st_nlink - 1)); + exit_code = 1; + return; + } +@@ -1318,7 +1318,7 @@ compdir(dir) + ** think it's worth it. -- Dave Mack + */ + +- while (dp = readdir(dirp)) ++ while ((dp = readdir(dirp))) + { + if (dp->d_ino == 0) + continue; diff --git a/SPECS/ncompress.spec b/SPECS/ncompress.spec new file mode 100644 index 0000000..74a7383 --- /dev/null +++ b/SPECS/ncompress.spec @@ -0,0 +1,263 @@ +Summary: Fast compression and decompression utilities +Name: ncompress +Version: 4.2.4.4 +Release: 1%{?dist} +License: Public Domain +Group: Applications/File +URL: http://ncompress.sourceforge.net/ +Source: http://prdownloads.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz + +# allow to build ncompress +# ~> downstream +Patch0: ncompress-4.2.4.4-make.patch + +# from dist-git commit 0539779d937 +# (praiskup: removed redundant part as -DNOFUNCDEF is defined) +# ~> downstream +Patch1: ncompress-4.2.4.4-lfs.patch + +# exit when too long filename is given (do not segfault) +# ~> #unknown +# ~> downstream +Patch2: ncompress-4.2.4.4-filenamelen.patch + +# permit files > 2GB to be compressed +# ~> #126775 +Patch3: ncompress-4.2.4.4-2GB.patch + +# do not fail to compress on ppc/s390x +# ~> #207001 +Patch4: ncompress-4.2.4.4-endians.patch + +# use memmove instead of memcpy +# ~> 760657 +# ~> downstream +Patch5: ncompress-4.2.4.4-memmove.patch + +# silence gcc warnings +# ~> downstream +Patch6: ncompress-4.2.4.4-silence-gcc.patch + +BuildRequires: glibc-devel fileutils + +%description +The ncompress package contains the compress and uncompress file +compression and decompression utilities, which are compatible with the +original UNIX compress utility (.Z file extensions). These utilities +can't handle gzipped (.gz file extensions) files, but gzip can handle +compressed files. + +Install ncompress if you need compression/decompression utilities +which are compatible with the original UNIX compress utility. + +%prep +%setup -q + +# configure build system +# ~> downstream +%patch0 -p1 -b .configure-buildsystem + +%ifarch sparc m68k armv4l ppc s390 s390x ppc64 sparc64 +ARCH_FLAGS="$ARCH_FLAGS -DBYTEORDER=1234" +%endif + +%ifarch alpha ia64 +ARCH_FLAGS="$ARCH_FLAGS -DNOALLIGN=0" +%endif + +sed "s/\$(ARCH_FLAGS)/$ARCH_FLAGS/" Makefile.def > Makefile + +%patch1 -p1 -b .lfs +%patch2 -p1 -b .filenamelen +%patch3 -p1 -b .2GB +%patch4 -p1 -b .endians +%patch5 -p1 -b .memmove +%patch6 -p1 -b .silence-gcc + +%build +make CFLAGS="%{optflags} %{?nc_endian} %{?nc_align}" + +%install +mkdir -p $RPM_BUILD_ROOT/%{_bindir} +mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1 +install -p -m755 compress $RPM_BUILD_ROOT/%{_bindir} +ln -sf compress $RPM_BUILD_ROOT/%{_bindir}/uncompress +install -p -m644 compress.1 $RPM_BUILD_ROOT%{_mandir}/man1 +ln -sf compress.1 $RPM_BUILD_ROOT%{_mandir}/man1/uncompress.1 + +%files +%{_bindir}/compress +%{_bindir}/uncompress +%{_mandir}/man1/* +%doc LZW.INFO README + +%changelog +* Fri Mar 01 2013 Pavel Raiskup - 4.2.4.4-1 +- upstream is dead -> rebase to fork of Mike Frysinger +- silence gcc warnings, fedora-review fixes + +* Thu Feb 14 2013 Fedora Release Engineering - 4.2.4-59 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Jul 20 2012 Fedora Release Engineering - 4.2.4-58 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 4.2.4-57 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Jan 03 2012 Ondrej Vasik - 4.2.4-56 +- use memmove instead of memcpy to prevent memory overlap corruption + (#760657) + +* Tue Feb 08 2011 Fedora Release Engineering - 4.2.4-55 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Feb 23 2010 Ondrej Vasik - 4.2.4-54 +- do patch original Makefile.def instead of creating new Makefile + +* Sat Jul 25 2009 Fedora Release Engineering - 4.2.4-53 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 4.2.4-52 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Dec 01 2008 Ondrej Vasik - 4.2.4-51 +- check malloc success (#473488) +- fix few compiler warnings, free malloc memory before exit +- new URL + +* Tue Feb 19 2008 Fedora Release Engineering - 4.2.4-50 +- Autorebuild for GCC 4.3 + +* Fri Feb 09 2007 Peter Vrabec 4.2.4-49 +- fix spec file to meet Fedora standards (#226185) + +* Wed Jan 10 2007 Peter Vrabec 4.2.4-48 +- fix some rpmlint issues + +* Sun Oct 01 2006 Jesse Keating - 4.2.4-47 +- rebuilt for unwind info generation, broken in gcc-4.1.1-21 + +* Tue Sep 19 2006 Peter Vrabec 4.2.4-46 +- fix endian problem (#207001) + +* Thu Aug 10 2006 Peter Vrabec 4.2.4-45 +- fix bss buffer underflow CVE-2006-1168 (#201919) + +* Wed Jul 12 2006 Jesse Keating - 4.2.4-44.1 +- rebuild + +* Fri Apr 21 2006 Peter Vrabec 4.2.4-44 +- fix problems with compressing zero-sized files (#189215, #189216) + +* Fri Feb 10 2006 Jesse Keating - 4.2.4-43.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 4.2.4-43.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Thu Sep 22 2005 Peter Vrabec 4.2.4-43 +- compress zero-sized files when -f is used(#167615) + +* Fri Mar 18 2005 Peter Vrabec +- rebuilt + +* Thu Feb 08 2005 Peter Vrabec +- rebuilt + +* Tue Oct 05 2004 Than Ngo 4.2.4-40 +- permit files > 2GB to be compressed (#126775). + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Thu Dec 12 2002 Tim Powers 4.2.4-32 +- rebuild on all arches + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Wed Jun 19 2002 Trond Eivind Glomsrod 4.2.4-30 +- Don't strip when installing + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Wed Feb 27 2002 Trond Eivind Glomsrod 4.2.4-28 +- Rebuild + +* Wed Jan 09 2002 Tim Powers +- automated rebuild + +* Mon Nov 26 2001 Trond Eivind Glomsrod 4.2.4-26 +- Rebuild, to fix problem with broken man page (#56654) + +* Wed Nov 21 2001 Trond Eivind Glomsrod 4.2.4-25 +- Exit, don't segfault, when given too long filenames + +* Sat Jun 09 2001 Florian La Roche +- s390x change + +* Tue May 8 2001 Trond Eivind Glomsrod +- Make it support large files (structs, stats, opens and of course: + _don't use signed longs for file size before and after compression_.) + This should fix #39470 + +* Thu Apr 26 2001 Florian La Roche +- add s390x, patch from Oliver Paukstadt + +* Mon Nov 13 2000 Oliver Paukstadt +- add s390 to the bigendian arch list + +* Thu Aug 17 2000 Trond Eivind Glomsrod +- change category to Applications/File, to match + gzip and bzip2 +- rename the spec file to ncompress.spec +- add ppc to the bigendian arch list + +* Fri Jul 21 2000 Trond Eivind Glomsrod +- rebuild + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Tue Jun 13 2000 Trond Eivind Glomsrod +- update URL +- use %%{_mandir} + +* Wed May 5 2000 Bill Nottingham +- fix "build" for ia64 + +* Mon Feb 7 2000 Bill Nottingham +- handle compressed manpages + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 14) + +* Tue Jan 12 1999 Cristian Gafton +- build on armv4l too +- build for 6.0 + +* Thu Aug 13 1998 Jeff Johnson +- build root + +* Mon Apr 27 1998 Prospector System +- translations modified for de, fr, tr + +* Wed Oct 21 1997 Cristian Gafton +- fixed the spec file + +* Mon Jun 02 1997 Erik Troan +- built against glibc