7ab1a940795366fc401389dff6f54150e1045769
[fedora-mingw.git] / zlib / mingw-zlib.spec
1 %include /usr/lib/rpm/mingw-defs
2
3 Name:           mingw-zlib
4 Version:        1.2.3
5 Release:        6%{?dist}
6 Summary:        MinGW Windows zlib compression library
7
8 License:        zlib
9 Group:          Development/Libraries
10 URL:            http://www.zlib.net/
11 Source0:        http://www.zlib.net/zlib-%{version}.tar.gz
12 Patch1:         zlib-win32.patch
13 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
14 BuildArch:      noarch
15
16 BuildRequires:  mingw-filesystem >= 12
17 BuildRequires:  mingw-gcc
18 BuildRequires:  mingw-binutils
19
20 # For some reason mingw-find-provides doesn't get this.
21 Provides:       mingw(zlib1.dll)
22
23 %description
24 MinGW Windows zlib compression library.
25
26
27 %prep
28 %setup -q -n zlib-1.2.3
29 %patch1 -p1
30
31
32 %build
33 CC=%{_mingw_cc} \
34 CFLAGS="%{_mingw_cflags}" \
35 RANLIB=%{_mingw_ranlib} \
36 ./configure
37
38 make -f win32/Makefile.gcc \
39   CC=%{_mingw_cc} \
40   AR=%{_mingw_ar} \
41   RC=i686-pc-mingw32-windres \
42   DLLWRAP=i686-pc-mingw32-dllwrap \
43   STRIP=%{_mingw_strip} \
44   all
45
46
47 %install
48 rm -rf $RPM_BUILD_ROOT
49
50 mkdir -p $RPM_BUILD_ROOT%{_mingw_bindir}
51 mkdir -p $RPM_BUILD_ROOT%{_mingw_includedir}
52 mkdir -p $RPM_BUILD_ROOT%{_mingw_libdir}
53 mkdir -p $RPM_BUILD_ROOT%{_mingw_mandir}/man3
54
55 make -f win32/Makefile.gcc \
56      INCLUDE_PATH=$RPM_BUILD_ROOT%{_mingw_includedir} \
57      LIBRARY_PATH=$RPM_BUILD_ROOT%{_mingw_libdir} \
58      BINARY_PATH=$RPM_BUILD_ROOT%{_mingw_bindir} \
59      install
60
61 # .dll.a file is misnamed for some reason - fix that.
62 mv $RPM_BUILD_ROOT%{_mingw_libdir}/libzdll.a \
63    $RPM_BUILD_ROOT%{_mingw_libdir}/libz.dll.a
64
65 # Remove static library.
66 rm $RPM_BUILD_ROOT%{_mingw_libdir}/libz.a
67
68 %__install zlib.3 $RPM_BUILD_ROOT%{_mingw_mandir}/man3
69
70
71 %clean
72 rm -rf $RPM_BUILD_ROOT
73
74
75 %files
76 %defattr(-,root,root)
77 %{_mingw_includedir}/zconf.h
78 %{_mingw_includedir}/zlib.h
79 %{_mingw_libdir}/libz.dll.a
80 %{_mingw_bindir}/zlib1.dll
81 %{_mingw_mandir}/man3/zlib.3
82
83
84 %changelog
85 * Wed Sep 10 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-6
86 - Remove static library.
87
88 * Fri Sep  5 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-5
89 - Fix misnamed file: zlibdll.a -> zlib.dll.a
90 - Explicitly provide mingw(zlib1.dll).
91
92 * Thu Sep  4 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-3
93 - Initial RPM release, largely based on earlier work from several sources.