+ BZ2_bzflush@4\r
+ BZ2_bzclose@4\r
+ BZ2_bzerror@8\r
---- bzip2-1.0.2/Makefile.orig 2002-01-26 00:34:53.000000000 +0100
-+++ bzip2-1.0.2/Makefile 2003-12-01 23:22:57.502761240 +0100
-@@ -23,7 +23,7 @@
+--- bzip2-1.0.6/Makefile.orig 2010-09-11 00:46:02.000000000 +0200
++++ bzip2-1.0.6/Makefile 2013-06-23 09:39:59.263591821 +0200
+@@ -35,7 +35,7 @@
decompress.o \
bzlib.o
bzip2: libbz2.a bzip2.o
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
-@@ -33,12 +33,7 @@
-
+@@ -46,11 +46,8 @@
libbz2.a: $(OBJS)
rm -f libbz2.a
-- $(AR) cq libbz2.a $(OBJS)
+ $(AR) cq libbz2.a $(OBJS)
- @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
- -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
- echo $(RANLIB) libbz2.a ; \
- $(RANLIB) libbz2.a ; \
- fi
-+ i386-mingw32-dllwrap --def libbz2.def --implib libbz2.a -o libbz2.dll $(OBJS)
++ $(RANLIB) libbz2.a
++ $(CC) -shared $(LDFLAGS) -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--out-implib,libbz2.dll.a -o bzip2.dll libbz2.def $(OBJS)
check: test
test: bzip2
# arch-specific flags (like alpha's -mieee) are not valid for i386 gcc
%define optflags -O2
%endif
+# -z options are invalid for mingw linker, most of -f options are Linux-specific
+%define filterout_ld -Wl,-z,.*
+%define filterout_c -f[-a-z0-9=]*
%description
Bzip2 compresses files using the Burrows-Wheeler block-sorting text
%patch0 -p1
%build
-AR=%{target}-ar
-RANLIB=%{target}-ranlib
-
%{__make} \
- AR="$AR" \
- RANLIB="$RANLIB" \
+ AR="%{target}-ar" \
+ RANLIB="%{target}-ranlib" \
CC="%{__cc}" \
CFLAGS="%{rpmcflags} -Wall \$(BIGFILES)"
-# makefile made libbz2.a as DLL import library...
-# recreate libbz2.dll.a as import library and libbz2.a as static
-%{__rm} libbz2.a libbz2.dll
-
-OBJS="blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o"
-$AR cru libbz2.a $OBJS
-$RANLIB libbz2.a
-%{target}-dllwrap --def libbz2.def --implib libbz2.dll.a -o bzip2.dll $OBJS
-
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir},%{_dlldir}}