%define realname libjpeg
-Summary: Library for handling different jpeg files - Mingw32 cross version
-Summary(pl.UTF-8): Biblioteka do manipulacji plikami w formacie jpeg - wersja skrośna dla Mingw32
+Summary: Library for handling different jpeg files - MinGW32 cross version
+Summary(pl.UTF-8): Biblioteka do manipulacji plikami w formacie jpeg - wersja skrośna dla MinGW32
Name: crossmingw32-%{realname}
-Version: 6b
-Release: 5
+Version: 8d
+Release: 1
License: distributable
Group: Development/Libraries
-Source0: ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{version}.tar.gz
-# Source0-md5: dbd5f3b47ed13132f04c685d608a7547
-Patch0: %{realname}-DESTDIR.patch
-Patch1: %{realname}-include.patch
-Patch2: %{realname}-c++.patch
-Patch3: %{name}-shared.patch
+Source0: http://www.ijg.org/files/jpegsrc.v%{version}.tar.gz
+# Source0-md5: 52654eb3b2e60c35731ea8fc87f1bd29
+Patch0: %{realname}-maxmem-sysconf.patch
URL: http://www.ijg.org/
+BuildRequires: autoconf >= 2.50
+BuildRequires: automake
BuildRequires: crossmingw32-gcc
+BuildRequires: libtool
Requires: crossmingw32-runtime
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define target i386-mingw32
%define target_platform i386-pc-mingw32
-%define arch %{_prefix}/%{target}
%define _sysprefix /usr
%define _prefix %{_sysprefix}/%{target}
+%define _libdir %{_prefix}/lib
%define _dlldir /usr/share/wine/windows/system
%define __cc %{target}-gcc
%define __cxx %{target}-g++
-%ifarch alpha sparc sparc64 sparcv9
+%ifnarch %{ix86}
+# arch-specific flags (like alpha's -mieee) are not valid for i386 gcc
%define optflags -O2
%endif
+# -z options are invalid for mingw linker
+%define filterout_ld -Wl,-z,.*
%description
The libjpeg package contains a library of functions for manipulating
Ten pakiet zawiera wersję skrośną dla Win32.
%package static
-Summary: Static libjpeg library (cross mingw32 version)
-Summary(pl.UTF-8): Statyczna biblioteka libjpeg (wersja skrośna mingw32)
+Summary: Static libjpeg library (cross MinGW32 version)
+Summary(pl.UTF-8): Statyczna biblioteka libjpeg (wersja skrośna MinGW32)
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description static
-Static libjpeg library (cross mingw32 version).
+Static libjpeg library (cross MinGW32 version).
%description static -l pl.UTF-8
-Statyczna biblioteka libjpeg (wersja skrośna mingw32).
+Statyczna biblioteka libjpeg (wersja skrośna MinGW32).
%package dll
Summary: libjpeg - DLL library for Windows
%prep
%setup -q -n jpeg-%{version}
%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
%build
-CC=%{target}-gcc ; export CC
-CXX=%{target}-g++ ; export CXX
-LD=%{target}-ld ; export LD
-AR=%{target}-ar ; export AR
-AS=%{target}-as ; export AS
-CROSS_COMPILE=1 ; export CROSS_COMPILE
-CPPFLAGS="-I%{arch}/include" ; export CPPFLAGS
-RANLIB=%{target}-ranlib ; export RANLIB
-LDSHARED="%{target}-gcc -shared" ; export LDSHARED
-TARGET="%{target}" ; export TARGET
-
%configure \
--target=%{target} \
--host=%{target} \
- --build=i386-linux \
- --prefix=%{arch}
+ --disable-silent-rules
%{__make}
-%{__make} jpeg.dll
-
-cat << "EOF" >> libjpeg.la
-# libjpeg.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-# ^^^^ This line needs to stay
-# Made by czarny czarny at pld-linux.org
-
-# The name that we can dlopen(3).
-dlname='../bin/libjpeg.dll'
-
-# Names of this library.
-library_names='libjpeg.dll.a'
-
-# The name of the static archive.
-old_library='libjpeg.a'
-
-# Libraries that this one depends upon.
-dependency_libs=''
-
-# Version information for libz.
-current=0
-age=0
-revision=0
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
+%install
+rm -rf $RPM_BUILD_ROOT
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
-# Directory that this library needs to be installed in:
-libdir='%{_libdir}'
-EOF
+install jversion.h $RPM_BUILD_ROOT%{_includedir}
-%{target}-strip jpeg.dll
-%{target}-strip -g -R.comment -R.note *.a
+# remove HAVE_STD{DEF,LIB}_H
+# (not necessary but may generate warnings confusing autoconf)
+sed -i -e 's#.*HAVE_STD..._H.*##g' $RPM_BUILD_ROOT%{_includedir}/jconfig.h
-%install
-rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_prefix}/{include,lib,bin}
+install -d $RPM_BUILD_ROOT%{_dlldir}
+mv -f $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
-install jconfig.h jerror.h jmorecfg.h jpeglib.h jversion.h $RPM_BUILD_ROOT%{_includedir}
-install *.a $RPM_BUILD_ROOT%{_libdir}
-install jpeg.dll $RPM_BUILD_ROOT%{_bindir}/libjpeg.dll
-install libjpeg.la $RPM_BUILD_ROOT%{_libdir}
+%if 0%{!?debug:1}
+%{target}-strip --strip-unneeded -R.comment -R.note $RPM_BUILD_ROOT%{_dlldir}/*.dll
+%{target}-strip -g -R.comment -R.note $RPM_BUILD_ROOT%{_libdir}/*.a
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
+%doc README change.log
%{_libdir}/libjpeg.dll.a
%{_libdir}/libjpeg.la
-%{_includedir}/*.h
+%{_includedir}/jconfig.h
+%{_includedir}/jerror.h
+%{_includedir}/jmorecfg.h
+%{_includedir}/jpeglib.h
+%{_includedir}/jversion.h
%files static
%defattr(644,root,root,755)
%files dll
%defattr(644,root,root,755)
-%{_bindir}/libjpeg.dll
+%{_dlldir}/libjpeg-*.dll