3 %bcond_with asmopt # without assembler optimization for i686+
4 # (asm is unsupported by upstream and unmaintained)
6 # disable asmopt where not applicable
14 Summary: Library for compression and decompression - MinGW32 cross version
15 Summary(pl.UTF-8): Biblioteka z podprogramami do kompresji i dekompresji - wersja skrośna dla MinGW32
16 Name: crossmingw32-%{realname}
20 Group: Development/Libraries
21 Source0: https://www.zlib.net/%{realname}-%{version}.tar.gz
22 # Source0-md5: 9855b6d802d7fe5b7bd5b196a2271655
23 URL: https://www.zlib.net/
24 BuildRequires: crossmingw32-gcc
25 BuildRequires: sed >= 4.0
26 Requires: crossmingw32-runtime
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define no_install_post_strip 1
30 %define _enable_debug_packages 0
32 %define target i386-mingw32
33 %define target_platform i386-pc-mingw32
35 %define _sysprefix /usr
36 %define _prefix %{_sysprefix}/%{target}
37 %define _libdir %{_prefix}/lib
38 %define _pkgconfigdir %{_prefix}/lib/pkgconfig
39 %define _dlldir /usr/share/wine/windows/system
40 %define __cc %{target}-gcc
41 %define __cxx %{target}-g++
42 %define __pkgconfig_provides %{nil}
43 %define __pkgconfig_requires %{nil}
45 %ifarch alpha sparc sparc64 sparcv9
49 # -z options are invalid for mingw linker, most of -f options are Linux-specific
50 %define filterout_ld -Wl,-z,.*
51 %define filterout_c -f[-a-z0-9=]*
54 The 'zlib' compression library provides in-memory compression and
55 decompression functions, including integrity checks of the
56 uncompressed data. This version of the library supports only one
57 compression method (deflation) but other algorithms may be added later
58 and will have the same stream interface.
60 This package contains the cross version for Win32.
62 %description -l pl.UTF-8
63 Biblioteka zlib udostępnia podprogramy do kompresji i dekompresji w
64 pamięci operacyjnej włącznie ze sprawdzaniem integralności w trakcie
65 dekompresji. Ta wersja biblioteki udostępnia tylko jedną metodę
66 kompresji o nazwie deflation niemniej inne algorytmy mogą być
67 dodawane udostępniając taki sam interfejs funkcji operujących na
70 Ten pakiet zawiera wersję skrośną dla Win32.
73 Summary: Static zlib library (cross MinGW32 version)
74 Summary(pl.UTF-8): Statyczna biblioteka zlib (wersja skrośna MinGW32)
75 Group: Development/Libraries
76 Requires: %{name} = %{version}-%{release}
79 Static zlib library (cross MinGW32 version).
81 %description static -l pl.UTF-8
82 Statyczna biblioteka zlib (wersja skrośna MinGW32).
85 Summary: zlib - DLL library for Windows
86 Summary(pl.UTF-8): zlib - biblioteka DLL dla Windows
87 Group: Applications/Emulators
91 zlib - DLL library for Windows.
93 %description dll -l pl.UTF-8
94 zlib - biblioteka DLL dla Windows.
97 %setup -q -n %{realname}-%{version}
101 cp contrib/asm686/match.S .
106 %{__make} -fwin32/Makefile.gcc all \
110 RANLIB="%{target}-ranlib" \
111 CFLAGS="-D_REENTRANT -D_LARGEFILE64_SOURCE=1 %{rpmcflags}%{?with_asmopt: -DASMV}" \
112 DLLWRAP="%{target}-dllwrap" \
113 RC="%{target}-windres" \
115 IMPLIB="libz.dll.a" \
116 prefix="%{_prefix}" \
117 %{?with_asmopt:OBJA=match.o}
119 # used by libtool to detect dependencies
120 cat << "EOF" >> libz.la
121 # libz.la - a libtool library file
122 # Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
123 # ^^^^ This line needs to stay
124 # Made by czarny czarny at pld-linux.org
126 # The name that we can dlopen(3).
127 dlname='%{_dlldir}/zlib1.dll'
129 # Names of this library.
130 library_names='libz.dll.a'
132 # The name of the static archive.
135 # Libraries that this one depends upon.
138 # Version information for libz.
143 # Is this an already installed library?
146 # Should we warn about portability when linking against -modules?
149 # Files to dlopen/dlpreopen
153 # Directory that this library needs to be installed in:
157 sed -e 's=@prefix@=%{_prefix}=;s=@exec_prefix@=%{_prefix}=;s=@\(shared\)\?libdir@=%{_libdir}=;s=@includedir@=%{_includedir}=;s=@VERSION@=%{version}=' \
158 < zlib.pc.in > zlib.pc
161 %{target}-strip -R.comment -R.note zlib1.dll
162 %{target}-strip -g -R.comment -R.note *.a
166 rm -rf $RPM_BUILD_ROOT
167 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir},%{_dlldir},%{_pkgconfigdir}}
169 install zlib.h $RPM_BUILD_ROOT%{_includedir}
170 install zconf.h $RPM_BUILD_ROOT%{_includedir}
171 install libz.dll.a $RPM_BUILD_ROOT%{_libdir}
172 install libz.a $RPM_BUILD_ROOT%{_libdir}
173 install libz.la $RPM_BUILD_ROOT%{_libdir}
174 install zlib1.dll $RPM_BUILD_ROOT%{_dlldir}
175 install zlib.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
178 rm -rf $RPM_BUILD_ROOT
181 %defattr(644,root,root,755)
182 %{_libdir}/libz.dll.a
184 %{_includedir}/zconf.h
185 %{_includedir}/zlib.h
186 %{_pkgconfigdir}/zlib.pc
189 %defattr(644,root,root,755)
193 %defattr(644,root,root,755)