]> git.pld-linux.org Git - packages/crossmingw32-zlib.git/blobdiff - crossmingw32-zlib.spec
- updated to 1.3.1
[packages/crossmingw32-zlib.git] / crossmingw32-zlib.spec
index 6ee50f48773ce38bea130ce16ec5798f08b56553..2dae197f02856d247a930d7b58444759c22efb59 100644 (file)
@@ -1,50 +1,55 @@
 #
 # Conditional build:
-%bcond_without asmopt  # without assmbler optimization for i586+
+%bcond_with    asmopt  # without assembler optimization for i686+
+                       # (asm is unsupported by upstream and unmaintained)
 #
 # disable asmopt where not applicable
-%ifarch i386 i486
+%ifarch i386 i486 i586
 %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
+Summary:       Library for compression and decompression - MinGW32 cross version
+Summary(pl.UTF-8):     Biblioteka z podprogramami do kompresji i dekompresji - wersja skrośna dla MinGW32
 Name:          crossmingw32-%{realname}
-Version:       1.2.3
-Release:       2
+Version:       1.3.1
+Release:       1
 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/
+Source0:       https://www.zlib.net/%{realname}-%{version}.tar.gz
+# Source0-md5: 9855b6d802d7fe5b7bd5b196a2271655
+URL:           https://www.zlib.net/
 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                _enable_debug_packages  0
 
 %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                _libdir                 %{_prefix}/lib
+%define                _pkgconfigdir           %{_prefix}/lib/pkgconfig
 %define                _dlldir                 /usr/share/wine/windows/system
 %define                __cc                    %{target}-gcc
 %define                __cxx                   %{target}-g++
+%define                __pkgconfig_provides    %{nil}
+%define                __pkgconfig_requires    %{nil}
 
 %ifarch alpha sparc sparc64 sparcv9
 %define                optflags        -O2
 %endif
 
+# -z options are invalid for mingw linker, most of -f options are Linux-specific
+%define                filterout_ld    -Wl,-z,.*
+%define                filterout_c             -f[-a-z0-9=]*
+
 %description
 The 'zlib' compression library provides in-memory compression and
 decompression functions, including integrity checks of the
@@ -65,16 +70,16 @@ 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)
+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).
+Static zlib library (cross MinGW32 version).
 
 %description static -l pl.UTF-8
-Statyczna biblioteka zlib (wersja skrośna mingw32).
+Statyczna biblioteka zlib (wersja skrośna MinGW32).
 
 %package dll
 Summary:       zlib - DLL library for Windows
@@ -90,36 +95,26 @@ 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
+%{__make} -fwin32/Makefile.gcc all \
+       CC="%{__cc}" \
+       CXX="%{__cxx}" \
+       AR="%{target}-ar" \
+       RANLIB="%{target}-ranlib" \
+       CFLAGS="-D_REENTRANT -D_LARGEFILE64_SOURCE=1 %{rpmcflags}%{?with_asmopt: -DASMV}" \
+       DLLWRAP="%{target}-dllwrap" \
+       RC="%{target}-windres" \
+       CP="install" \
+       IMPLIB="libz.dll.a" \
+       prefix="%{_prefix}" \
+       %{?with_asmopt:OBJA=match.o}
 
 # used by libtool to detect dependencies
 cat << "EOF" >> libz.la
@@ -129,7 +124,7 @@ cat << "EOF" >> libz.la
 # Made by czarny czarny at pld-linux.org
 
 # The name that we can dlopen(3).
-dlname='../bin/libz.dll'
+dlname='%{_dlldir}/zlib1.dll'
 
 # Names of this library.
 library_names='libz.dll.a'
@@ -159,24 +154,25 @@ dlpreopen=''
 libdir='%{_libdir}'
 EOF
 
+sed -e 's=@prefix@=%{_prefix}=;s=@exec_prefix@=%{_prefix}=;s=@\(shared\)\?libdir@=%{_libdir}=;s=@includedir@=%{_includedir}=;s=@VERSION@=%{version}=' \
+       < zlib.pc.in > zlib.pc
+
 %if 0%{!?debug:1}
-%{target}-strip -R.comment -R.note z.dll
+%{target}-strip -R.comment -R.note zlib1.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 -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir},%{_dlldir},%{_pkgconfigdir}}
 
-install zutil.h $RPM_BUILD_ROOT%{_includedir}
+install zlib.h $RPM_BUILD_ROOT%{_includedir}
+install zconf.h $RPM_BUILD_ROOT%{_includedir}
 install libz.dll.a $RPM_BUILD_ROOT%{_libdir}
+install libz.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
+install zlib1.dll $RPM_BUILD_ROOT%{_dlldir}
+install zlib.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -185,7 +181,9 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %{_libdir}/libz.dll.a
 %{_libdir}/libz.la
-%{_includedir}/*.h
+%{_includedir}/zconf.h
+%{_includedir}/zlib.h
+%{_pkgconfigdir}/zlib.pc
 
 %files static
 %defattr(644,root,root,755)
@@ -193,4 +191,4 @@ rm -rf $RPM_BUILD_ROOT
 
 %files dll
 %defattr(644,root,root,755)
-%{_dlldir}/libz.dll
+%{_dlldir}/zlib1.dll
This page took 0.066452 seconds and 4 git commands to generate.