]> git.pld-linux.org Git - packages/crossmingw32-zlib.git/blob - crossmingw32-zlib.spec
- force %{_lib}-independent libdir
[packages/crossmingw32-zlib.git] / crossmingw32-zlib.spec
1 #
2 # Conditional build:
3 %bcond_without  asmopt  # without assmbler optimization for i586+
4 #
5 # disable asmopt where not applicable
6 %ifarch i386 i486
7 %undefine       with_asmopt
8 %endif
9 %ifnarch %{ix86}
10 %undefine       with_asmopt
11 %endif
12 %define         realname                zlib
13 Summary:        Library for compression and decompression - Ming32 cross version
14 Summary(pl.UTF-8):      Biblioteka z podprogramami do kompresji i dekompresji - wersja skrośna dla Ming32
15 Name:           crossmingw32-%{realname}
16 Version:        1.2.3
17 Release:        4
18 License:        BSD
19 Group:          Development/Libraries
20 Source0:        http://www.zlib.net/%{realname}-%{version}.tar.gz
21 # Source0-md5:  debc62758716a169df9f62e6ab2bc634
22 Patch0:         %{realname}-asmopt.patch
23 Patch1:         %{name}-shared.patch
24 URL:            http://www.zlib.org/
25 BuildRequires:  crossmingw32-gcc
26 BuildRequires:  sed >= 4.0
27 Requires:       crossmingw32-runtime
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %define         no_install_post_strip   1
31
32 %define         target                  i386-mingw32
33 %define         target_platform         i386-pc-mingw32
34
35 %define         _sysprefix              /usr
36 %define         _prefix                 %{_sysprefix}/%{target}
37 %define         _libdir                 %{_prefix}/lib
38 %define         _dlldir                 /usr/share/wine/windows/system
39 %define         __cc                    %{target}-gcc
40 %define         __cxx                   %{target}-g++
41
42 %ifarch alpha sparc sparc64 sparcv9
43 %define         optflags        -O2
44 %endif
45
46 %description
47 The 'zlib' compression library provides in-memory compression and
48 decompression functions, including integrity checks of the
49 uncompressed data. This version of the library supports only one
50 compression method (deflation) but other algorithms may be added later
51 and will have the same stream interface.
52
53 This package contains the cross version for Win32.
54
55 %description -l pl.UTF-8
56 Biblioteka zlib udostępnia podprogramy do kompresji i dekompresji w
57 pamięci operacyjnej włącznie ze sprawdzaniem integralności w trakcie
58 dekompresji. Ta wersja biblioteki udostępnia tylko jedną metodę
59 kompresji o nazwie deflation niemniej inne algorytmy mogą być
60 dodawane udostępniając taki sam interfejs funkcji operujących na
61 strumieniu danych.
62
63 Ten pakiet zawiera wersję skrośną dla Win32.
64
65 %package static
66 Summary:        Static zlib library (cross mingw32 version)
67 Summary(pl.UTF-8):      Statyczna biblioteka zlib (wersja skrośna mingw32)
68 Group:          Development/Libraries
69 Requires:       %{name} = %{version}-%{release}
70
71 %description static
72 Static zlib library (cross mingw32 version).
73
74 %description static -l pl.UTF-8
75 Statyczna biblioteka zlib (wersja skrośna mingw32).
76
77 %package dll
78 Summary:        zlib - DLL library for Windows
79 Summary(pl.UTF-8):      zlib - biblioteka DLL dla Windows
80 Group:          Applications/Emulators
81 Requires:       wine
82
83 %description dll
84 zlib - DLL library for Windows.
85
86 %description dll -l pl.UTF-8
87 zlib - biblioteka DLL dla Windows.
88
89 %prep
90 %setup -q -n %{realname}-%{version}
91 %patch1 -p1
92
93 %if %{with asmopt}
94 %patch0 -p1
95 %ifarch i686 athlon
96 cp contrib/asm686/match.S .
97 %endif
98 %ifarch i586
99 cp contrib/asm586/match.S .
100 %endif
101 %endif
102
103 # fix for underline test
104 #sed -i -e 's/nm/%{target}-nm/' configure
105 # but it's broken anyway (tries to use mmap test remains, but there is no mmap
106 # in mingw32) - so hardcode that underline is needed
107 sed -i -e 's/.*grep _hello.*/if false; then/' configure
108 # vim '
109
110 %build
111 CC="%{__cc}" \
112 CXX="%{__cxx}" \
113 AR="%{target}-ar rc" \
114 RANLIB="%{target}-ranlib" \
115 CFLAGS="-D_REENTRANT %{rpmcflags}%{?with_asmopt: -DASMV}" \
116 ./configure \
117         --prefix=%{_prefix}
118
119 %{__make}
120 %{__make} z.dll
121
122 # used by libtool to detect dependencies
123 cat << "EOF" >> libz.la
124 # libz.la - a libtool library file
125 # Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
126 # ^^^^ This line needs to stay
127 # Made by czarny czarny at pld-linux.org
128
129 # The name that we can dlopen(3).
130 dlname='../bin/libz.dll'
131
132 # Names of this library.
133 library_names='libz.dll.a'
134
135 # The name of the static archive.
136 old_library='libz.a'
137
138 # Libraries that this one depends upon.
139 dependency_libs=''
140
141 # Version information for libz.
142 current=0
143 age=0
144 revision=0
145
146 # Is this an already installed library?
147 installed=yes
148
149 # Should we warn about portability when linking against -modules?
150 shouldnotlink=no
151
152 # Files to dlopen/dlpreopen
153 dlopen=''
154 dlpreopen=''
155
156 # Directory that this library needs to be installed in:
157 libdir='%{_libdir}'
158 EOF
159
160 %if 0%{!?debug:1}
161 %{target}-strip -R.comment -R.note z.dll
162 %{target}-strip -g -R.comment -R.note *.a
163 %endif
164
165 %install
166 rm -rf $RPM_BUILD_ROOT
167 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir},%{_dlldir}}
168
169 %{__make} install \
170         prefix=$RPM_BUILD_ROOT%{_prefix}
171
172 install zutil.h $RPM_BUILD_ROOT%{_includedir}
173 install libz.dll.a $RPM_BUILD_ROOT%{_libdir}
174 install libz.la $RPM_BUILD_ROOT%{_libdir}
175 install z.dll $RPM_BUILD_ROOT%{_dlldir}/libz.dll
176
177 rm -rf $RPM_BUILD_ROOT%{_datadir}/man
178
179 %clean
180 rm -rf $RPM_BUILD_ROOT
181
182 %files
183 %defattr(644,root,root,755)
184 %{_libdir}/libz.dll.a
185 %{_libdir}/libz.la
186 %{_includedir}/*.h
187
188 %files static
189 %defattr(644,root,root,755)
190 %{_libdir}/libz.a
191
192 %files dll
193 %defattr(644,root,root,755)
194 %{_dlldir}/libz.dll
This page took 0.149303 seconds and 4 git commands to generate.