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}
10 Summary: MinGW port of the OpenSSL toolkit
13 Group: Development/Libraries
14 URL: http://www.openssl.org/
16 # Use the hobble-openssl script to create the source file.
17 Source0: openssl-%{version}-usa.tar.bz2
19 Source1: hobble-openssl
20 Source2: Makefile.certificate
21 Source6: make-dummy-cert
22 Source8: openssl-thread-test.c
23 Source9: opensslconf-new.h
24 Source10: opensslconf-new-warning.h
26 # Patches from Fedora native package.
27 Patch0: openssl-0.9.8g-redhat.patch
28 Patch1: openssl-0.9.8a-defaults.patch
29 Patch2: openssl-0.9.8a-link-krb5.patch
30 Patch3: openssl-0.9.8g-soversion.patch
31 Patch4: openssl-0.9.8a-enginesdir.patch
32 Patch5: openssl-0.9.8a-no-rpath.patch
33 Patch6: openssl-0.9.8b-test-use-localhost.patch
34 Patch7: openssl-0.9.8g-shlib-version.patch
35 Patch21: openssl-0.9.8b-aliasing-bug.patch
36 Patch22: openssl-0.9.8b-x509-name-cmp.patch
37 Patch23: openssl-0.9.8g-default-paths.patch
38 Patch24: openssl-0.9.8g-no-extssl.patch
39 Patch32: openssl-0.9.8g-ia64.patch
40 Patch33: openssl-0.9.7f-ca-dir.patch
41 Patch34: openssl-0.9.6-x509.patch
42 Patch35: openssl-0.9.7-beta5-version-add-engines.patch
43 Patch38: openssl-0.9.8a-reuse-cipher-change.patch
44 # Disabled this because it uses getaddrinfo which is lacking on Windows.
45 #Patch39: openssl-0.9.8g-ipv6-apps.patch
46 Patch50: openssl-0.9.8g-speed-bug.patch
47 Patch51: openssl-0.9.8g-bn-mul-bug.patch
48 Patch52: openssl-0.9.8g-cve-2008-0891.patch
49 Patch53: openssl-0.9.8g-cve-2008-1671.patch
51 # MinGW-specific patches.
52 Patch100: mingw32-openssl-0.9.8g-header-files.patch
53 Patch101: mingw32-openssl-0.9.8g-configure.patch
54 Patch102: mingw32-openssl-0.9.8g-shared.patch
55 Patch103: mingw32-openssl-0.9.8g-global.patch
57 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
61 BuildRequires: mingw32-filesystem >= 26
62 BuildRequires: mingw32-gcc
63 BuildRequires: mingw32-binutils
65 BuildRequires: mingw32-zlib
68 #BuildRequires: krb5-devel
71 BuildRequires: /usr/bin/cmp
72 BuildRequires: /usr/bin/rename
74 # Required to run the tests.
76 BuildRequires: xorg-x11-server-Xvfb
78 #Requires: ca-certificates >= 2008-5
83 The OpenSSL toolkit provides support for secure communications between
84 machines. OpenSSL includes a certificate management tool and shared
85 libraries which provide various cryptographic algorithms and
88 This package contains Windows (MinGW) libraries and development tools.
92 %setup -q -n openssl-%{version}
94 %{SOURCE1} > /dev/null
95 %patch0 -p1 -b .redhat
96 %patch1 -p1 -b .defaults
97 # Fix link line for libssl (bug #111154).
99 %patch3 -p1 -b .soversion
100 %patch4 -p1 -b .enginesdir
101 %patch5 -p1 -b .no-rpath
102 %patch6 -p1 -b .use-localhost
103 %patch7 -p1 -b .shlib-version
105 %patch21 -p1 -b .aliasing-bug
106 %patch22 -p1 -b .name-cmp
107 %patch23 -p1 -b .default-paths
108 %patch24 -p1 -b .no-extssl
110 %patch32 -p1 -b .ia64
111 #patch33 is applied after make test
112 %patch34 -p1 -b .x509
113 %patch35 -p1 -b .version-add-engines
114 %patch38 -p1 -b .cipher-change
115 #%patch39 -p1 -b .ipv6-apps
116 %patch50 -p1 -b .speed-bug
117 %patch51 -p1 -b .bn-mul-bug
118 %patch52 -p0 -b .srvname-crash
119 %patch53 -p0 -b .srv-kex-crash
121 %patch100 -p1 -b .mingw-header-files
122 %patch101 -p1 -b .mingw-configure
123 %patch102 -p1 -b .mingw-shared
124 %patch103 -p1 -b .mingw-global
126 # Modify the various perl scripts to reference perl in the right location.
127 perl util/perlpath.pl `dirname %{__perl}`
129 # Generate a table with the compile settings for my perusal.
131 make TABLE PERL=%{__perl}
138 %{_bindir}/i686-pc-mingw32-gcc -m32 "$@"
142 # NB: 'no-hw' is vital. MinGW cannot build the hardware drivers
143 # and if you don't have this you'll get an obscure link error.
145 --openssldir=%{_mingw32_sysconfdir}/pki/tls \
146 zlib enable-camellia enable-seed enable-tlsext enable-rfc3779 \
147 no-idea no-mdc2 no-rc5 no-ec no-ecdh no-ecdsa no-hw shared \
148 --enginesdir=%{_mingw32_libdir}/openssl/engines \
150 # --with-krb5-flavor=MIT
151 # -I%{_mingw32_prefix}/kerberos/include -L%{_mingw32_prefix}/kerberos/%{_lib}
153 make all build-shared
154 make rehash build-shared
156 #----------------------------------------------------------------------
157 # Run some tests. I don't know why this isn't in a %-check section
158 # but this is how it is in the native RPM.
160 # This is a bit of a hack, but the test scripts look for 'openssl'
163 ln -s openssl.exe openssl
166 # This is useful for diagnosing Wine problems.
170 # Make sure we can find the installed DLLs.
171 WINEDLLPATH=%{_mingw32_bindir}
174 # The tests run Wine and require an X server (but don't really use
175 # it). Therefore we create a virtual framebuffer for the duration of
177 # XXX There is no good way to choose a random, unused display.
179 Xvfb $display & xpid=$!
180 trap "kill -TERM $xpid ||:" EXIT
185 make LDCMD=%{_mingw32_cc} -C test apps tests
187 # Disable this thread test, because we don't have pthread on Windows.
188 #%{_mingw32_cc} -o openssl-thread-test \
190 # %{_mingw32_cflags} \
196 ## `krb5-config --cflags`
197 ## `krb5-config --libs`
199 #./openssl-thread-test --threads %{thread_test_threads}
201 # Patch33 must be patched after tests otherwise they will fail
202 patch -p1 -b -z .ca-dir < %{PATCH33}
204 if ! iconv -f UTF-8 -t ASCII//TRANSLIT CHANGES >/dev/null 2>&1 ; then
205 iconv -f ISO-8859-1 -t UTF-8 -o CHANGES.utf8 CHANGES && \
206 mv -f CHANGES.utf8 CHANGES
211 rm -rf $RPM_BUILD_ROOT
213 make DESTDIR=$RPM_BUILD_ROOT install
215 # Remove static libraries but DON'T remove *.dll.a files.
216 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libfoo.a
220 rm -rf $RPM_BUILD_ROOT
224 %defattr(-,root,root)
225 %{_mingw32_bindir}/foo.dll
226 %{_mingw32_libdir}/foo.dll.a
231 * Wed Sep 24 2008 Your Name <you@example.com> - 1.2.3-1
232 - Initial RPM release.