This is a data dump only. Sorry I can't be of more help and actually be
a packager.
The existing patch #7 from the Fedora SRPM was made incorrectly (used
post-patch source instead of original source). I've corrected that.
Spec and three patches are attached. I doubt the spec meets Fedora's
guidelines, but it should be close.
The only caveat is that the program doesn't interpret argv[0] correctly
and I haven't spent the time investigating why. You can use
"compress.exe -d" to uncompress as I've left out uncompress.exe since it
functions the same as compress.exe.
Mike
--- mingw32-ncompress-4.2.4/Makefile.orig 2009-08-05 12:23:37.728445792 -0500
+++ mingw32-ncompress-4.2.4/Makefile 2009-08-05 12:23:18.641693401 -0500
@@ -0,0 +1,54 @@
+# Makefile generated by build.
+
+# 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
--- mingw32-ncompress-4.2.4/compress42.c.orig 1992-10-28 05:10:53.000000000 -0600
+++ mingw32-ncompress-4.2.4/compress42.c 2009-08-05 12:36:30.446442550 -0500
@@ -285,6 +285,10 @@
# define COMPILE_DATE __DATE__
#endif /* DOS */
+#ifdef WIN32
+# define SIGHUP 1
+#endif /* MINGW32 */
+
#ifndef O_BINARY
# define O_BINARY 0 /* System has no binary mode */
#endif
@@ -1225,9 +1229,11 @@
exit_code = 1;
}
#ifndef DOS
+#ifndef WIN32
chown(ofname, infstat.st_uid, infstat.st_gid); /* Copy ownership */
#endif
#endif
+#endif
remove_ofname = 0;
if (unlink(ifname)) /* Remove input file */
diff -urNp ncompress-4.2.4-orig/compress42.c ncompress-4.2.4/compress42.c
--- ncompress-4.2.4-orig/compress42.c 2008-12-01 13:50:17.000000000 +0100
+++ ncompress-4.2.4/compress42.c 2008-12-01 13:53:03.000000000 +0100
@@ -134,6 +134,8 @@
#include <fcntl.h>
#include <ctype.h>
#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
@@ -711,7 +717,13 @@
nomagic = 1; /* Original didn't have a magic number */
#endif
- filelist = fileptr = (char **)malloc(argc*sizeof(char *));
+ filelist = (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 = rindex(argv[0], '/')) != 0)
@@ -851,6 +863,7 @@
decompress(0, 1);
}
+ free(filelist);
exit((exit_code== -1) ? 1:exit_code);
}
%define __strip %{_mingw32_strip}
%define __objdump %{_mingw32_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_mingw32_findrequires}
%define __find_provides %{_mingw32_findprovides}
Name: mingw32-ncompress
Summary: Fast compression and decompression utilities
Version: 4.2.4
Release: 1%{?dist}
License: Public Domain
Group: Applications/File
URL: http://ncompress.sourceforge.net/
Source: ftp://metalab.unc.edu/pub/Linux/utils/compress/%{name}-%{version}.tar.Z
Patch0: mingw32-ncompress-make.patch
Patch1: mingw32-ncompress-mingw.patch
Patch2: ncompress-4.2.4-lfs2.patch
Patch3: ncompress-2GB.patch
Patch4: ncompress-4.2.4-zerobyteforce.patch
Patch5: ncompress-4.2.4-bssUnderflow.patch
Patch6: ncompress-4.2.4-endians.patch
Patch7: ncompress-4.2.4-uncheckedmalloc.patch
BuildRequires: gcc glibc-devel fileutils
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%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
%patch0 -p1
%patch1 -p1 -b .mingw
%patch2 -p1 -b .lfs
%patch3 -p1 -b .2GB
%patch4 -p1 -b .zerobyteforce
%patch5 -p1 -b .bssUnderflow
%patch6 -p1 -b .endians
%patch7 -p1 -b .malloccheck
%build
ENDIAN=4321
%ifarch sparc m68k armv4l ppc s390 s390x ppc64 sparc64
ENDIAN=1234
%endif
%{_mingw32_env}
make ENDIAN="$ENDIAN"
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_mingw32_bindir}
mkdir -p $RPM_BUILD_ROOT/%{_mingw32_mandir}/man1
install -p -m755 compress $RPM_BUILD_ROOT/%{_mingw32_bindir}/compress.exe
install -p -m644 compress.1 $RPM_BUILD_ROOT%{_mingw32_mandir}/man1
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_mingw32_bindir}/compress.exe
%{_mingw32_mandir}/man1/compress.1
%doc LZW.INFO README
%changelog
* Wed Aug 5 2009 Michael Cronenworth <[email protected]> - 4.2.4-1
- Initial build for mingw32.
_______________________________________________
fedora-mingw mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/fedora-mingw