- updated shared patch, replaced one pseudo-libtool hack with another using real...
[packages/crossmingw32-libjpeg.git] / crossmingw32-libjpeg.spec
index 12c2764fdf7ff8e7c083e08e1044d4dcf1b74c9b..65d1092d08e688da4ec314fdc7aad3b4bed3f76f 100644 (file)
@@ -1,11 +1,11 @@
 %define                realname        libjpeg
 Summary:       Library for handling different jpeg files - Mingw32 cross version
-Summary(pl):   Biblioteka do manipulacji plikami w formacie jpeg - wersja skro¶na dla Mingw32
+Summary(pl.UTF-8):     Biblioteka do manipulacji plikami w formacie jpeg - wersja skrośna dla Mingw32
 Name:          crossmingw32-%{realname}
 Version:       6b
-Release:       4
+Release:       5
 License:       distributable
-Group:         Libraries
+Group:         Development/Libraries
 Source0:       ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{version}.tar.gz
 # Source0-md5: dbd5f3b47ed13132f04c685d608a7547
 Patch0:                %{realname}-DESTDIR.patch
@@ -13,24 +13,27 @@ Patch1:             %{realname}-include.patch
 Patch2:                %{realname}-c++.patch
 Patch3:                %{name}-shared.patch
 URL:           http://www.ijg.org/
-Requires:      crossmingw32-runtime
+BuildRequires: autoconf >= 2.50
+BuildRequires: automake
 BuildRequires: crossmingw32-gcc
-BuildRequires: crossmingw32-w32api
 BuildRequires: libtool
+Requires:      crossmingw32-runtime
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                no_install_post_strip   1
 
-%define                target          i386-mingw32
-%define                target_platform i386-pc-mingw32
-%define                arch            %{_prefix}/%{target}
-%define                gccarch         %{_prefix}/lib/gcc-lib/%{target}
-%define                gcclib          %{_prefix}/lib/gcc-lib/%{target}/%{version}
+%define                target                  i386-mingw32
+%define                target_platform         i386-pc-mingw32
 
-%define                __cc            %{target}-gcc
-%define                __cxx           %{target}-g++
+%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
 
@@ -38,18 +41,35 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 The libjpeg package contains a library of functions for manipulating
 JPEG images.
 
-%description -l pl
-Ten pakiet zawiera bibliotekê funkcji do manipulacji plikami jpeg.
+This package contains the cross version for Win32.
+
+%description -l pl.UTF-8
+Ten pakiet zawiera bibliotekę funkcji do manipulacji plikami jpeg.
+
+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)
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description static
+Static libjpeg library (cross mingw32 version).
+
+%description static -l pl.UTF-8
+Statyczna biblioteka libjpeg (wersja skrośna mingw32).
 
 %package dll
 Summary:       libjpeg - DLL library for Windows
-Summary(pl):   libjpeg - biblioteka DLL dla Windows
+Summary(pl.UTF-8):     libjpeg - biblioteka DLL dla Windows
 Group:         Applications/Emulators
+Requires:      wine
 
 %description dll
 libjpeg - DLL library for Windows.
 
-%description dll -l pl
+%description dll -l pl.UTF-8
 libjpeg - biblioteka DLL dla Windows.
 
 %prep
@@ -59,47 +79,71 @@ libjpeg - biblioteka DLL dla Windows.
 %patch2 -p1
 %patch3 -p1
 
+cp /usr/share/automake/config.* .
+
+# hack: use recent libtool by configuring for mingw32 in separate dir
+# (cannot regenerate main ac/lt because of missing configure.in)
+mkdir lthack
+cd lthack
+cat >configure.ac <<EOF
+AC_INIT(lthack, 0)
+AC_CONFIG_AUX_DIR(..)
+AC_PROG_LIBTOOL
+EOF
+
 %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
+cd lthack
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%configure \
+       --target=%{target} \
+       --host=%{target}
+cd ..
 
 %configure \
        --target=%{target} \
        --host=%{target} \
-       --build=i386-linux \
-       --prefix=%{arch}
+       --enable-shared \
+       --enable-static
 
-%{__make}
-%{__make} jpeg.dll
+cp -f lthack/libtool .
 
-%{target}-strip jpeg.dll
-%{target}-strip -g -R.comment -R.note *.a
+%{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{arch}/{include,lib}
-install -d $RPM_BUILD_ROOT%{_datadir}/wine/windows/system
+install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_dlldir}}
 
-install jconfig.h jerror.h jmorecfg.h jpeglib.h jversion.h $RPM_BUILD_ROOT%{arch}/include
-install *.a $RPM_BUILD_ROOT%{arch}/lib
-install jpeg.dll $RPM_BUILD_ROOT%{_datadir}/wine/windows/system
+%{__make} install-headers install-lib \
+       libdir=%{_libdir} \
+       DESTDIR=$RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT%{_dlldir}
+mv -f $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
+
+%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)
-%{arch}/include/*
-%{arch}/lib/*
+%doc README change.log
+%{_libdir}/libjpeg.dll.a
+%{_libdir}/libjpeg.la
+%{_includedir}/jconfig.h
+%{_includedir}/jerror.h
+%{_includedir}/jmorecfg.h
+%{_includedir}/jpeglib.h
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libjpeg.a
 
 %files dll
 %defattr(644,root,root,755)
-%{_datadir}/wine/windows/system/*
+%{_dlldir}/libjpeg-*.dll
This page took 0.045426 seconds and 4 git commands to generate.