# # Conditional build: %bcond_without asmopt # without assmbler optimization for i586+ # # disable asmopt where not applicable %ifarch i386 i486 %undefine with_asmopt %endif %ifnarch %{ix86} %undefine with_asmopt %endif %define realname zlib Summary: Library for compression and decompression - Ming32 cross version Summary(pl.UTF-8): Biblioteka z podprogramami do kompresji i dekompresji - wersja skrośna dla Ming32 Name: crossmingw32-%{realname} Version: 1.2.3 Release: 3 License: BSD Group: Development/Libraries Source0: http://www.zlib.net/%{realname}-%{version}.tar.gz # Source0-md5: debc62758716a169df9f62e6ab2bc634 Patch0: %{realname}-asmopt.patch Patch1: %{name}-shared.patch URL: http://www.zlib.org/ BuildRequires: crossmingw32-gcc BuildRequires: sed >= 4.0 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 _sysprefix /usr %define _prefix %{_sysprefix}/%{target} %define _dlldir /usr/share/wine/windows/system %define __cc %{target}-gcc %define __cxx %{target}-g++ %ifarch alpha sparc sparc64 sparcv9 %define optflags -O2 %endif %description The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms may be added later and will have the same stream interface. This package contains the cross version for Win32. %description -l pl.UTF-8 Biblioteka zlib udostępnia podprogramy do kompresji i dekompresji w pamięci operacyjnej włącznie ze sprawdzaniem integralności w trakcie dekompresji. Ta wersja biblioteki udostępnia tylko jedną metodę kompresji o nazwie deflation niemniej inne algorytmy mogą być dodawane udostępniając taki sam interfejs funkcji operujących na strumieniu danych. Ten pakiet zawiera wersję skrośną dla Win32. %package static Summary: Static zlib library (cross mingw32 version) Summary(pl.UTF-8): Statyczna biblioteka zlib (wersja skrośna mingw32) Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description static Static zlib library (cross mingw32 version). %description static -l pl.UTF-8 Statyczna biblioteka zlib (wersja skrośna mingw32). %package dll Summary: zlib - DLL library for Windows Summary(pl.UTF-8): zlib - biblioteka DLL dla Windows Group: Applications/Emulators Requires: wine %description dll zlib - DLL library for Windows. %description dll -l pl.UTF-8 zlib - biblioteka DLL dla Windows. %prep %setup -q -n %{realname}-%{version} %patch1 -p1 %if %{with asmopt} %patch0 -p1 %ifarch i686 athlon cp contrib/asm686/match.S . %endif %ifarch i586 cp contrib/asm586/match.S . %endif %endif # fix for underline test #sed -i -e 's/nm/%{target}-nm/' configure # but it's broken anyway (tries to use mmap test remains, but there is no mmap # in mingw32) - so hardcode that underline is needed sed -i -e 's/.*grep _hello.*/if false; then/' configure # vim ' %build CC="%{__cc}" \ CXX="%{__cxx}" \ AR="%{target}-ar rc" \ RANLIB="%{target}-ranlib" \ CFLAGS="-D_REENTRANT %{rpmcflags}%{?with_asmopt: -DASMV}" \ ./configure \ --prefix=%{_prefix} %{__make} %{__make} z.dll # used by libtool to detect dependencies cat << "EOF" >> libz.la # libz.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/libz.dll' # Names of this library. library_names='libz.dll.a' # The name of the static archive. old_library='libz.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 # Files to dlopen/dlpreopen dlopen='' dlpreopen='' # Directory that this library needs to be installed in: libdir='%{_libdir}' EOF %if 0%{!?debug:1} %{target}-strip -R.comment -R.note z.dll %{target}-strip -g -R.comment -R.note *.a %endif %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir},%{_dlldir}} %{__make} install \ prefix=$RPM_BUILD_ROOT%{_prefix} install zutil.h $RPM_BUILD_ROOT%{_includedir} install libz.dll.a $RPM_BUILD_ROOT%{_libdir} install libz.la $RPM_BUILD_ROOT%{_libdir} install z.dll $RPM_BUILD_ROOT%{_dlldir}/libz.dll rm -rf $RPM_BUILD_ROOT%{_datadir}/man %clean rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %{_libdir}/libz.dll.a %{_libdir}/libz.la %{_includedir}/*.h %files static %defattr(644,root,root,755) %{_libdir}/libz.a %files dll %defattr(644,root,root,755) %{_dlldir}/libz.dll