Fix to build in mock.
[fedora-mingw.git] / bzip2 / mingw32-bzip2.spec
index 19a7e4a..8cfb7b8 100644 (file)
@@ -6,9 +6,12 @@
 
 %define library_version 1.0.4
 
+# Running the tests requires Wine.
+%define run_tests 0
+
 Name:           mingw32-bzip2
 Version:        1.0.5
-Release:        1%{?dist}
+Release:        4%{?dist}
 Summary:        MinGW port of bzip2 file compression utility
 
 License:        BSD
@@ -30,8 +33,9 @@ BuildRequires:  mingw32-filesystem >= 26
 BuildRequires:  mingw32-gcc
 BuildRequires:  mingw32-binutils
 
-# This is needed to run the tests.
+%if %{run_tests}
 BuildRequires:  wine
+%endif
 
 
 %description
@@ -60,18 +64,23 @@ cross-compiling Windows software in Fedora.
 
 %build
 make -f Makefile-libbz2_so \
-       CC="%{_mingw32_cc}" \
-       AR="%{_mingw32_ar}" \
-       RANLIB="%{_mingw32_ranlib}" \
-        CFLAGS="%{_mingw32_cflags} -D_FILE_OFFSET_BITS=64" \
-        %{?_smp_mflags} all
+  CC="%{_mingw32_cc}" \
+  AR="%{_mingw32_ar}" \
+  RANLIB="%{_mingw32_ranlib}" \
+  CFLAGS="%{_mingw32_cflags} -D_FILE_OFFSET_BITS=64" \
+  %{?_smp_mflags} all
 
 rm -f *.o
 make CC="%{_mingw32_cc}" \
-     AR="%{_mingw32_ar}" \
-     RANLIB="%{_mingw32_ranlib}" \
-     CFLAGS="%{_mingw32_cflags} -D_FILE_OFFSET_BITS=64" \
-     %{?_smp_mflags} all
+  AR="%{_mingw32_ar}" \
+  RANLIB="%{_mingw32_ranlib}" \
+  CFLAGS="%{_mingw32_cflags} -D_FILE_OFFSET_BITS=64" \
+  %{?_smp_mflags} \
+%if %{run_tests}
+  all
+%else
+  libbz2.a bzip2 bzip2recover
+%endif
 
 
 %install
@@ -93,7 +102,8 @@ popd
 rm -rf $RPM_BUILD_ROOT%{_mingw32_prefix}/man
 
 # The Makefile doesn't install the DLL.
-install bz2.dll.a $RPM_BUILD_ROOT%{_mingw32_libdir}/
+# Rename the library so that libtool can find it.
+install bz2.dll.a $RPM_BUILD_ROOT%{_mingw32_libdir}/libbz2.dll.a
 install bz2-1.dll $RPM_BUILD_ROOT%{_mingw32_bindir}/
 
 # Remove the static library.
@@ -108,7 +118,7 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root)
 
 %{_mingw32_bindir}/bz2-1.dll
-%{_mingw32_libdir}/bz2.dll.a
+%{_mingw32_libdir}/libbz2.dll.a
 
 %{_mingw32_bindir}/bunzip2
 %{_mingw32_bindir}/bzcat
@@ -126,5 +136,14 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Sat Nov 22 2008 Richard Jones <rjones@redhat.com> - 1.0.5-4
+- Rename the implib as libbz2.dll.a so that libtool can find it.
+
+* Wed Oct 29 2008 Richard Jones <rjones@redhat.com> - 1.0.5-3
+- Fix mixed spaces/tabs in specfile.
+
+* Fri Oct 10 2008 Richard Jones <rjones@redhat.com> - 1.0.5-2
+- Allow the tests to be disabled selectively.
+
 * Thu Sep 25 2008 Richard Jones <rjones@redhat.com> - 1.0.5-1
 - Initial RPM release.