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}
8 # These only work some of the time, but fail randomly at other times
9 # (although I have had them complete a few times, so I don't think
10 # there is any actual problem with the binaries).
16 Summary: MinGW port of the OpenSSL toolkit
19 Group: Development/Libraries
20 URL: http://www.openssl.org/
22 # Use the hobble-openssl script to create the source file.
23 Source0: openssl-%{version}-usa.tar.bz2
25 Source1: hobble-openssl
26 Source2: Makefile.certificate
27 Source6: make-dummy-cert
28 Source8: openssl-thread-test.c
29 Source9: opensslconf-new.h
30 Source10: opensslconf-new-warning.h
32 # Patches from Fedora native package.
33 Patch0: openssl-0.9.8g-redhat.patch
34 Patch1: openssl-0.9.8a-defaults.patch
35 Patch2: openssl-0.9.8a-link-krb5.patch
36 Patch3: openssl-0.9.8g-soversion.patch
37 Patch4: openssl-0.9.8a-enginesdir.patch
38 Patch5: openssl-0.9.8a-no-rpath.patch
39 Patch6: openssl-0.9.8b-test-use-localhost.patch
40 Patch7: openssl-0.9.8g-shlib-version.patch
41 Patch21: openssl-0.9.8b-aliasing-bug.patch
42 Patch22: openssl-0.9.8b-x509-name-cmp.patch
43 Patch23: openssl-0.9.8g-default-paths.patch
44 Patch24: openssl-0.9.8g-no-extssl.patch
45 Patch32: openssl-0.9.8g-ia64.patch
46 Patch33: openssl-0.9.7f-ca-dir.patch
47 Patch34: openssl-0.9.6-x509.patch
48 Patch35: openssl-0.9.7-beta5-version-add-engines.patch
49 Patch38: openssl-0.9.8a-reuse-cipher-change.patch
50 # Disabled this because it uses getaddrinfo which is lacking on Windows.
51 #Patch39: openssl-0.9.8g-ipv6-apps.patch
52 Patch50: openssl-0.9.8g-speed-bug.patch
53 Patch51: openssl-0.9.8g-bn-mul-bug.patch
54 Patch52: openssl-0.9.8g-cve-2008-0891.patch
55 Patch53: openssl-0.9.8g-cve-2008-1671.patch
57 # MinGW-specific patches.
58 Patch100: mingw32-openssl-0.9.8g-header-files.patch
59 Patch101: mingw32-openssl-0.9.8g-configure.patch
60 Patch102: mingw32-openssl-0.9.8g-shared.patch
61 Patch103: mingw32-openssl-0.9.8g-global.patch
62 Patch104: mingw32-openssl-0.9.8g-sfx.patch
64 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
68 BuildRequires: mingw32-filesystem >= 26
69 BuildRequires: mingw32-gcc
70 BuildRequires: mingw32-binutils
72 BuildRequires: mingw32-zlib
75 #BuildRequires: krb5-devel
78 BuildRequires: /usr/bin/cmp
79 BuildRequires: /usr/bin/rename
81 # Required both to build, and to run the tests.
85 # Required to run the tests.
86 BuildRequires: xorg-x11-server-Xvfb
89 #Requires: ca-certificates >= 2008-5
94 The OpenSSL toolkit provides support for secure communications between
95 machines. OpenSSL includes a certificate management tool and shared
96 libraries which provide various cryptographic algorithms and
99 This package contains Windows (MinGW) libraries and development tools.
103 %setup -q -n openssl-%{version}
105 %{SOURCE1} > /dev/null
106 %patch0 -p1 -b .redhat
107 %patch1 -p1 -b .defaults
108 # Fix link line for libssl (bug #111154).
110 %patch3 -p1 -b .soversion
111 %patch4 -p1 -b .enginesdir
112 %patch5 -p1 -b .no-rpath
113 %patch6 -p1 -b .use-localhost
114 %patch7 -p1 -b .shlib-version
116 %patch21 -p1 -b .aliasing-bug
117 %patch22 -p1 -b .name-cmp
118 %patch23 -p1 -b .default-paths
119 %patch24 -p1 -b .no-extssl
121 %patch32 -p1 -b .ia64
122 #patch33 is applied after make test
123 %patch34 -p1 -b .x509
124 %patch35 -p1 -b .version-add-engines
125 %patch38 -p1 -b .cipher-change
126 #%patch39 -p1 -b .ipv6-apps
127 %patch50 -p1 -b .speed-bug
128 %patch51 -p1 -b .bn-mul-bug
129 %patch52 -p0 -b .srvname-crash
130 %patch53 -p0 -b .srv-kex-crash
132 %patch100 -p1 -b .mingw-header-files
133 %patch101 -p1 -b .mingw-configure
134 %patch102 -p1 -b .mingw-shared
135 %patch103 -p1 -b .mingw-global
136 %patch104 -p1 -b .mingw-sfx
138 # Modify the various perl scripts to reference perl in the right location.
139 perl util/perlpath.pl `dirname %{__perl}`
141 # Generate a table with the compile settings for my perusal.
143 make TABLE PERL=%{__perl}
150 %{_bindir}/i686-pc-mingw32-gcc -m32 "$@"
154 # NB: 'no-hw' is vital. MinGW cannot build the hardware drivers
155 # and if you don't have this you'll get an obscure link error.
157 --prefix=%{_mingw32_prefix} \
158 --openssldir=%{_mingw32_sysconfdir}/pki/tls \
159 zlib enable-camellia enable-seed enable-tlsext enable-rfc3779 \
160 no-idea no-mdc2 no-rc5 no-ec no-ecdh no-ecdsa no-hw shared \
161 --enginesdir=%{_mingw32_libdir}/openssl/engines \
163 # --with-krb5-flavor=MIT
164 # -I%{_mingw32_prefix}/kerberos/include -L%{_mingw32_prefix}/kerberos/%{_lib}
166 make all build-shared
167 make rehash build-shared
170 #----------------------------------------------------------------------
171 # Run some tests. I don't know why this isn't in a %-check section
172 # but this is how it is in the native RPM.
174 # This is a bit of a hack, but the test scripts look for 'openssl'
177 ln -s openssl.exe openssl
180 # This is useful for diagnosing Wine problems.
184 # Make sure we can find the installed DLLs.
185 WINEDLLPATH=%{_mingw32_bindir}
188 # The tests run Wine and require an X server (but don't really use
189 # it). Therefore we create a virtual framebuffer for the duration of
191 # XXX There is no good way to choose a random, unused display.
194 Xvfb $display -ac -noreset & xpid=$!
195 trap "kill -TERM $xpid ||:" EXIT
200 make LDCMD=%{_mingw32_cc} -C test apps tests
202 # Disable this thread test, because we don't have pthread on Windows.
203 #%-{_mingw32_cc} -o openssl-thread-test \
205 # %-{_mingw32_cflags} \
211 ## `krb5-config --cflags`
212 ## `krb5-config --libs`
214 #./openssl-thread-test --threads %{thread_test_threads}
216 #----------------------------------------------------------------------
219 # Patch33 must be patched after tests otherwise they will fail
220 patch -p1 -b -z .ca-dir < %{PATCH33}
222 if ! iconv -f UTF-8 -t ASCII//TRANSLIT CHANGES >/dev/null 2>&1 ; then
223 iconv -f ISO-8859-1 -t UTF-8 -o CHANGES.utf8 CHANGES && \
224 mv -f CHANGES.utf8 CHANGES
229 rm -rf $RPM_BUILD_ROOT
230 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
231 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}/openssl
232 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
233 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
234 mkdir -p $RPM_BUILD_ROOT%{_mingw32_mandir}
235 make INSTALL_PREFIX=$RPM_BUILD_ROOT install build-shared
237 # Install the actual DLLs.
238 install libcrypto-7.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
239 install libssl-7.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
241 # Remove static libraries but DON'T remove *.dll.a files.
242 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libcrypto.a
243 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libssl.a
245 # I have no idea why it installs the manpages in /etc, but
246 # we remove them anyway.
247 rm -r $RPM_BUILD_ROOT%{_mingw32_sysconfdir}/pki/tls/man
249 # Set permissions on lib*.dll.a so that strip works.
250 chmod 0755 $RPM_BUILD_ROOT%{_mingw32_libdir}/libcrypto.dll.a
251 chmod 0755 $RPM_BUILD_ROOT%{_mingw32_libdir}/libssl.dll.a
255 rm -rf $RPM_BUILD_ROOT
259 %defattr(-,root,root)
260 %{_mingw32_bindir}/openssl.exe
261 %{_mingw32_bindir}/c_rehash
262 %{_mingw32_bindir}/libcrypto-7.dll
263 %{_mingw32_bindir}/libssl-7.dll
264 %{_mingw32_libdir}/libcrypto.dll.a
265 %{_mingw32_libdir}/libssl.dll.a
266 %{_mingw32_libdir}/engines
267 %{_mingw32_libdir}/pkgconfig/*.pc
268 %{_mingw32_includedir}/openssl
269 %config(noreplace) %{_mingw32_sysconfdir}/pki
273 * Tue Sep 30 2008 Richard W.M. Jones <rjones@redhat.com> - 0.9.8g-1
274 - Initial RPM release.