Build static subpackages (Erik van Pienbroek)
[fedora-mingw.git] / curl / mingw32-curl.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-curl
8 Version:        7.19.4
9 Release:        1%{?dist}
10 Summary:        MinGW Windows port of curl and libcurl
11
12 License:        MIT
13 Group:          Development/Libraries
14 URL:            http://curl.haxx.se/
15 Source0:        http://curl.haxx.se/download/curl-%{version}.tar.bz2
16 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17
18 BuildArch:      noarch
19
20 # Patches from native Fedora package.
21 Patch1:         curl-7.15.3-multilib.patch
22 Patch2:         curl-7.16.0-privlibs.patch
23 Patch3:         curl-7.17.1-badsocket.patch
24 Patch4:         curl-7.19.4-tool-leak.patch
25 Patch5:         curl-7.19.4-enable-aes.patch
26
27 # MinGW-specific patches.
28 Patch1000:      mingw-curl-7.18.2-getaddrinfo.patch
29
30 BuildRequires:  mingw32-filesystem >= 35
31 BuildRequires:  mingw32-gcc
32 BuildRequires:  mingw32-binutils
33 BuildRequires:  pkgconfig
34 BuildRequires:  mingw32-gettext
35 BuildRequires:  mingw32-iconv
36 BuildRequires:  mingw32-zlib
37 BuildRequires:  mingw32-libidn
38 BuildRequires:  mingw32-libssh2
39
40 # See nss/README for the status of this package.
41 #BuildRequires:  mingw32-nss
42 # Temporarily we can use OpenSSL instead of NSS:
43 BuildRequires:  mingw32-openssl
44
45 # Not started porting this package yet.
46 #BuildRequires:  mingw32-openldap
47
48 # Not started porting this package yet.
49 #BuildRequires:  mingw32-krb5
50
51 Requires:       pkgconfig
52
53
54 %description
55 cURL is a tool for getting files from HTTP, FTP, FILE, LDAP, LDAPS,
56 DICT, TELNET and TFTP servers, using any of the supported protocols.
57 cURL is designed to work without user interaction or any kind of
58 interactivity. cURL offers many useful capabilities, like proxy
59 support, user authentication, FTP upload, HTTP post, and file transfer
60 resume.
61
62 This is the MinGW cross-compiled Windows library.
63
64
65 %package static
66 Summary:        Static version of the MinGW Windows Curl library
67 Requires:       %{name} = %{version}-%{release}
68 Group:          Development/Libraries
69
70 %description static
71 Static version of the MinGW Windows Curl library.
72
73
74 %prep
75 %setup -q -n curl-%{version}
76
77 %patch1 -p1 -b .multilib
78 %patch2 -p1 -b .privlibs
79 %patch3 -p1 -b .badsocket
80 %patch4 -p1 -b .toolleak
81 %patch5 -p1 -b .enableaes
82
83 %patch1000 -p1 -b .getaddrinfo
84
85
86 %build
87 %{_mingw32_configure} \
88   --with-ssl --enable-ipv6 \
89   --with-ca-bundle=%{_mingw32_sysconfdir}/pki/tls/certs/ca-bundle.crt \
90   --with-libidn \
91   --enable-static --with-libssh2 \
92   --without-random
93
94 # It's not clear where to set the --with-ca-bundle path.  This is the
95 # default for CURLOPT_CAINFO.  If this doesn't exist, you'll get an
96 # error from all https transfers unless the program sets
97 # CURLOPT_CAINFO to point to the correct ca-bundle.crt file.
98
99 # --without-random disables random number collection (eg. from
100 # /dev/urandom).  There isn't an obvious alternative for Windows:
101 # Perhaps we can port EGD or use a library such as Yarrow.
102
103 # These are the original flags that we'll work towards as
104 # more of the dependencies get ported to Fedora MinGW.
105 #
106 #  --without-ssl --with-nss=%{_mingw32_prefix} --enable-ipv6
107 #  --with-ca-bundle=%{_mingw32_sysconfdir}/pki/tls/certs/ca-bundle.crt
108 #  --with-gssapi=%{_mingw32_prefix}/kerberos --with-libidn
109 #  --enable-ldaps --disable-static --with-libssh2
110
111 make %{?_smp_mflags}
112
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116 make DESTDIR=$RPM_BUILD_ROOT install
117
118 # Remove the man pages which duplicate documentation in the
119 # native Fedora package.
120 rm -r $RPM_BUILD_ROOT%{_mingw32_mandir}/man{1,3}
121
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126
127 %files
128 %defattr(-,root,root,-)
129 %doc COPYING
130 %{_mingw32_bindir}/curl-config
131 %{_mingw32_bindir}/curl.exe
132 %{_mingw32_bindir}/libcurl-4.dll
133 %{_mingw32_libdir}/libcurl.dll.a
134 %{_mingw32_libdir}/libcurl.la
135 %{_mingw32_libdir}/pkgconfig/libcurl.pc
136 %{_mingw32_includedir}/curl/
137
138
139 %files static
140 %defattr(-,root,root,-)
141 %{_mingw32_libdir}/libcurl.a
142
143 %changelog
144 * Fri Apr  3 2009 Erik van Pienbroek <epienbro@fedoraproject.org> - 7.19.4-1
145 - Update to version 7.19.4
146 - Fixed %%defattr line
147 - Added -static subpackage. Applications which want to use this
148   static library need to add -DCURL_STATICLIB to the CFLAGS
149 - Merged the patches of the native .spec file (7.19.4-5)
150
151 * Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 7.18.2-6
152 - Rebuild for mingw32-gcc 4.4
153
154 * Fri Feb  6 2009 Richard W.M. Jones <rjones@redhat.com> - 7.18.2-5
155 - Include license.
156
157 * Fri Feb  6 2009 Richard W.M. Jones <rjones@redhat.com> - 7.18.2-4
158 - Rebuild against new OpenSSH (because of soname bump).
159
160 * Fri Jan 30 2009 Richard W.M. Jones <rjones@redhat.com> - 7.18.2-3
161 - Requires pkgconfig.
162
163 * Thu Nov 13 2008 Richard W.M. Jones <rjones@redhat.com> - 7.18.2-2
164 - Requires mingw32-filesystem >= 35.
165
166 * Thu Nov 13 2008 Richard W.M. Jones <rjones@redhat.com> - 7.18.2-1
167 - Initial RPM release.