- Disable static libraries.
[fedora-mingw.git] / libjpeg / mingw32-libjpeg.spec
index 9fdcff3..a87dc93 100644 (file)
@@ -6,7 +6,7 @@
 
 Name:           mingw32-libjpeg
 Version:        6b
-Release:        5%{?dist}
+Release:        7%{?dist}
 Summary:        MinGW Windows Libjpeg library
 
 License:        IJG
@@ -26,12 +26,14 @@ Patch100:       jpeg-mingw32.patch
 BuildArch:      noarch
 
 BuildRequires:  mingw32-filesystem >= 23
+BuildRequires:  mingw32-dlfcn
 BuildRequires:  mingw32-gcc
 BuildRequires:  mingw32-binutils
 BuildRequires:  mingw32-libpng
 BuildRequires:  mingw32-zlib
 BuildRequires:  autoconf, libtool
 
+
 %description
 MinGW Windows Libjpeg library.
 
@@ -54,13 +56,32 @@ cp %{SOURCE1} configure.in
 # libjpeg 6b includes a horribly obsolete version of libtool.
 # Blow it away and replace with build system's version.
 rm -f config.guess config.sub ltmain.sh ltconfig aclocal.m4
-cp /usr/share/aclocal/libtool.m4 aclocal.m4
+
+cat /usr/share/aclocal/libtool.m4 > aclocal.m4
+# If this is the new libtool 2.x, we need to append some additional
+# files.  Rather than hard-coding a version of libtool, just test
+# if the files exist and append them:
+for f in \
+  /usr/share/aclocal/ltoptions.m4 \
+  /usr/share/aclocal/ltversion.m4 \
+  /usr/share/aclocal/ltsugar.m4 \
+  /usr/share/aclocal/lt~obsolete.m4; do
+  if [ -f $f ]; then cat $f >> aclocal.m4; fi
+done
+
+# Now we can run libtool.
 libtoolize
+
+# Automake can fail - we only need this to get config.sub and config.guess.
+automake -a ||:
+
+# Finally because we replaced configure.in:
 autoconf
 
+
 %build
-%{_mingw32_configure} --enable-shared --enable-static
-make libdir=%{_mingw32_libdir}
+%{_mingw32_configure} --enable-shared --disable-static
+make %{?_smp_mflags}
 
 
 %install
@@ -69,15 +90,12 @@ rm -rf $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
-mkdir -p $RPM_BUILD_ROOT%{_mingw32_prefix}/man/man1
-
-make prefix=$RPM_BUILD_ROOT%{_mingw32_prefix} install
+mkdir -p $RPM_BUILD_ROOT%{_mingw32_mandir}/man1
 
-# Remove static library.
-rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libjpeg.a
+%{_mingw32_makeinstall}
 
 # Remove manual pages which duplicate Fedora native.
-rm -rf $RPM_BUILD_ROOT%{_mingw32_prefix}/man
+rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}
 
 
 %clean
@@ -86,6 +104,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root)
+%doc README
 %{_mingw32_bindir}/cjpeg
 %{_mingw32_bindir}/djpeg
 %{_mingw32_bindir}/jpegtran
@@ -101,6 +120,17 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Jan 23 2009 Richard W.M. Jones <rjones@redhat.com> - 6b-7
+- Disable static libraries.
+- Use _smp_mflags.
+- Update for new libtool 2.
+- +BR mingw32-dlfcn.
+- Added documentation (README includes the license).
+
+* Thu Nov 20 2008 Richard W.M. Jones <rjones@redhat.com> - 6b-6
+- Don't set libdir in the make step.
+- Fix path to mandir.
+
 * Wed Sep 24 2008 Richard W.M. Jones <rjones@redhat.com> - 6b-5
 - Rename mingw -> mingw32.