Removed gnutls - it's now in Fedora.
[fedora-mingw.git] / cross-zlib / mingw32-zlib.spec
1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
6
7 Name:           mingw32-zlib
8 Version:        1.2.3
9 Release:        14%{?dist}
10 Summary:        Cross-compiled zlib compression library
11
12 License:        zlib
13 Group:          Development/Libraries
14 URL:            http://www.zlib.net/
15 Source0:        http://www.zlib.net/zlib-%{version}.tar.gz
16 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17 BuildArch:      noarch
18
19 # From Fedora native package, none is applicable to us.
20 #Patch3:        zlib-1.2.3-autotools.patch
21 #Patch4:        minizip-1.2.3-autotools.patch
22 #Patch5:        zlib-1.2.3-minizip.patch
23
24 # MinGW-specific patches.
25 Patch100:       zlib-win32.patch
26
27 BuildRequires:  mingw32-filesystem >= 23
28 BuildRequires:  mingw32-gcc
29 BuildRequires:  mingw32-binutils
30 BuildRequires:  mingw64-filesystem >= 10
31 BuildRequires:  mingw64-gcc
32 BuildRequires:  mingw64-binutils
33
34
35 %description
36 Cross-compiled zlib compression library.
37
38
39 %package -n mingw64-zlib
40 Summary:        Cross-compiled zlib compression library
41 Group:          Development/Libraries
42
43
44 %description -n mingw64-zlib
45 Cross-compiled zlib compression library.
46
47
48 %prep
49 %setup -q -c -n %{name}-%{version} -a 0
50 mv zlib-%{version} mingw32
51 %setup -q -c -D -n %{name}-%{version} -a 0
52 mv zlib-%{version} mingw64
53
54 pushd mingw32
55 %patch100 -p1
56 popd
57
58 pushd mingw64
59 %patch100 -p1
60 popd
61
62
63 %build
64 pushd mingw32
65
66 CC=%{_mingw32_cc} \
67 CFLAGS="%{_mingw32_cflags}" \
68 RANLIB=%{_mingw32_ranlib} \
69 ./configure
70
71 make -f win32/Makefile.gcc \
72   CFLAGS="%{_mingw32_cflags}" \
73   CC=%{_mingw32_cc} \
74   AR=%{_mingw32_ar} \
75   RC=%{_mingw32_windres} \
76   DLLWRAP=%{_mingw32_dllwrap} \
77   STRIP=%{_mingw32_strip} \
78   all
79
80 popd
81
82 pushd mingw64
83
84 CC=%{_mingw64_cc} \
85 CFLAGS="%{_mingw64_cflags}" \
86 RANLIB=%{_mingw64_ranlib} \
87 ./configure
88
89 make -f win32/Makefile.gcc \
90   CFLAGS="%{_mingw64_cflags}" \
91   CC=%{_mingw64_cc} \
92   AR=%{_mingw64_ar} \
93   RC=%{_mingw64_windres} \
94   DLLWRAP=%{_mingw64_dllwrap} \
95   STRIP=%{_mingw64_strip} \
96   all
97
98 popd
99
100
101 %install
102 rm -rf $RPM_BUILD_ROOT
103
104 pushd mingw32
105
106 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
107 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
108 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
109
110 make -f win32/Makefile.gcc \
111      INCLUDE_PATH=$RPM_BUILD_ROOT%{_mingw32_includedir} \
112      LIBRARY_PATH=$RPM_BUILD_ROOT%{_mingw32_libdir} \
113      BINARY_PATH=$RPM_BUILD_ROOT%{_mingw32_bindir} \
114      install
115
116 # .dll.a file is misnamed for some reason - fix that.
117 mv $RPM_BUILD_ROOT%{_mingw32_libdir}/libzdll.a \
118    $RPM_BUILD_ROOT%{_mingw32_libdir}/libz.dll.a
119
120 # Remove static library.
121 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libz.a
122
123 popd
124
125 pushd mingw64
126
127 mkdir -p $RPM_BUILD_ROOT%{_mingw64_bindir}
128 mkdir -p $RPM_BUILD_ROOT%{_mingw64_includedir}
129 mkdir -p $RPM_BUILD_ROOT%{_mingw64_libdir}
130
131 make -f win32/Makefile.gcc \
132      INCLUDE_PATH=$RPM_BUILD_ROOT%{_mingw64_includedir} \
133      LIBRARY_PATH=$RPM_BUILD_ROOT%{_mingw64_libdir} \
134      BINARY_PATH=$RPM_BUILD_ROOT%{_mingw64_bindir} \
135      install
136
137 # .dll.a file is misnamed for some reason - fix that.
138 mv $RPM_BUILD_ROOT%{_mingw64_libdir}/libzdll.a \
139    $RPM_BUILD_ROOT%{_mingw64_libdir}/libz.dll.a
140
141 # Remove static library.
142 rm $RPM_BUILD_ROOT%{_mingw64_libdir}/libz.a
143
144 popd
145
146
147 %clean
148 rm -rf $RPM_BUILD_ROOT
149
150
151 %files
152 %defattr(-,root,root)
153 %{_mingw32_includedir}/zconf.h
154 %{_mingw32_includedir}/zlib.h
155 %{_mingw32_libdir}/libz.dll.a
156 %{_mingw32_bindir}/zlib1.dll
157
158
159 %files -n mingw64-zlib
160 %defattr(-,root,root)
161 %{_mingw64_includedir}/zconf.h
162 %{_mingw64_includedir}/zlib.h
163 %{_mingw64_libdir}/libz.dll.a
164 %{_mingw64_bindir}/zlib1.dll
165
166
167 %changelog
168 * Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-14
169 - Rebuild for mingw32-gcc 4.4
170
171 * Mon Jan 19 2009 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-12
172 - Force rebuild to test maintenance account.
173
174 * Thu Dec 18 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-11
175 - Pass correct CFLAGS to build.
176
177 * Thu Oct 16 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-10
178 - Consider native patches.
179
180 * Wed Sep 24 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-9
181 - Rename mingw -> mingw32.
182
183 * Sun Sep 21 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-8
184 - Remove manpage.
185
186 * Wed Sep 10 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-7
187 - Remove static library.
188
189 * Fri Sep  5 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-5
190 - Fix misnamed file: zlibdll.a -> zlib.dll.a
191 - Explicitly provide mingw(zlib1.dll).
192
193 * Thu Sep  4 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-3
194 - Initial RPM release, largely based on earlier work from several sources.