/[packages]/updates/3/openssl/current/SPECS/openssl.spec
ViewVC logotype

Annotation of /updates/3/openssl/current/SPECS/openssl.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 256937 - (hide annotations) (download)
Thu Jun 7 09:28:39 2012 UTC (11 years, 10 months ago) by guillomovitch
Original Path: cauldron/openssl/current/SPECS/openssl.spec
File size: 10245 byte(s)
- new version
- drop outdated pkcs11 engine patch

1 guillomovitch 256937 %define maj 1.0.1
2 blino 733 %define engines_name %mklibname openssl-engines %{maj}
3     %define libname %mklibname openssl %{maj}
4     %define develname %mklibname openssl -d
5     %define staticname %mklibname openssl -s -d
6    
7     %define conflict1 %mklibname openssl 0.9.7
8     %define conflict2 %mklibname openssl 0.9.8
9    
10     # Number of threads to spawn when testing some threading fixes.
11     #define thread_test_threads %{?threads:%{threads}}%{!?threads:1}
12    
13     %define with_krb5 %{?_with_krb5:1}%{!?_with_krb5:0}
14    
15     Summary: Secure Sockets Layer communications libs & utils
16     Name: openssl
17 guillomovitch 256937 Version: %{maj}c
18 guillomovitch 191618 Release: %mkrel 1
19 blino 733 License: BSD-like
20     Group: System/Libraries
21     URL: http://www.openssl.org/
22     Source0: ftp://ftp.openssl.org/source/%{name}-%{version}.tar.gz
23     Source1: ftp://ftp.openssl.org/source/%{name}-%{version}.tar.gz.asc
24     Source2: Makefile.certificate
25     Source3: make-dummy-cert
26     Source4: openssl-thread-test.c
27     # (gb) 0.9.7b-4mdk: Handle RPM_OPT_FLAGS in Configure
28 guillomovitch 256937 Patch2: openssl-1.0.1c-optflags.patch
29 blino 733 # (oe) support Brazilian Government OTHERNAME X509v3 field (#14158)
30     # http://www.iti.gov.br/resolucoes/RESOLU__O_13_DE_26_04_2002.PDF
31     Patch6: openssl-0.9.8-beta6-icpbrasil.diff
32 guillomovitch 256937 # http://qa.mandriva.com/show_bug.cgi?id=32621
33     Patch15: openssl-0.9.8e-crt.patch
34    
35     # fedora patches
36 guillomovitch 191618 Patch7: openssl-1.0.0f-defaults.patch
37 blino 733 Patch12: openssl-0.9.6-x509.patch
38 guillomovitch 256937 Patch13: openssl-0.9.8j-version-add-engines.patch
39     Patch16: openssl-1.0.0-beta5-enginesdir.patch
40    
41 blino 733 # MIPS and ARM support
42 guillomovitch 256937 Patch300: openssl-1.0.1c-mips.patch
43     Patch301: openssl-1.0.1c-arm.patch
44 blino 733 Requires: %{libname} = %{version}-%{release}
45     Requires: perl-base
46     Requires: rootcerts
47     %{?_with_krb5:BuildRequires: krb5-devel}
48     BuildRequires: multiarch-utils >= 1.0.3
49     BuildRequires: chrpath
50     BuildRequires: zlib-devel
51     # (tv) for test suite:
52     BuildRequires: bc
53    
54     %description
55     The openssl certificate management tool and the shared libraries that provide
56     various encryption and decription algorithms and protocols, including DES, RC4,
57     RSA and SSL.
58    
59     %package -n %{engines_name}
60     Summary: Engines for openssl
61     Group: System/Libraries
62     Obsoletes: openssl-engines < 1.0.0a-5
63     Provides: openssl-engines = %{version}-%{release}
64    
65     %description -n %{engines_name}
66     This package provides engines for openssl.
67    
68     %package -n %{libname}
69     Summary: Secure Sockets Layer communications libs
70     Group: System/Libraries
71     Requires: %{engines_name} >= %{version}-%{release}
72     Provides: %{libname} = %{version}-%{release}
73    
74     %description -n %{libname}
75     The libraries files are needed for various cryptographic algorithms
76     and protocols, including DES, RC4, RSA and SSL.
77    
78     %package -n %{develname}
79     Summary: Secure Sockets Layer communications libs & headers & utils
80     Group: Development/Other
81     Requires: %{libname} = %{version}-%{release}
82     Provides: libopenssl-devel
83     Provides: openssl-devel = %{version}-%{release}
84     Obsoletes: openssl-devel
85     # temporary opsolete, will be a conflict later. a compat package
86     # with openssl-0.9.7 devel libs will be provided soon
87     Obsoletes: %{conflict1}-devel
88     Obsoletes: %{conflict2}-devel
89     Obsoletes: %{mklibname openssl 1.0.0}-devel
90     Provides: %{name}-devel = %{version}-%{release}
91    
92     %description -n %{develname}
93     The libraries and include files needed to compile apps with support
94     for various cryptographic algorithms and protocols, including DES, RC4, RSA
95     and SSL.
96    
97     %package -n %{staticname}
98     Summary: Secure Sockets Layer communications static libs
99     Group: Development/Other
100     Requires: %{develname} = %{version}-%{release}
101     Provides: libopenssl-static-devel
102     Provides: openssl-static-devel = %{version}-%{release}
103     # temporary opsolete, will be a conflict later. a compat package
104     # with openssl-0.9.7 static-devel libs will be provided soon
105     Obsoletes: %{conflict1}-static-devel
106     Obsoletes: %{conflict2}-static-devel
107     Obsoletes: %{mklibname openssl 1.0.0}-static-devel
108     Provides: %{name}-static-devel = %{version}-%{release}
109    
110     %description -n %{staticname}
111     The static libraries needed to compile apps with support for various
112     cryptographic algorithms and protocols, including DES, RC4, RSA and SSL.
113    
114     %prep
115    
116     %setup -q -n %{name}-%{version}
117     %patch2 -p1 -b .optflags
118     %patch6 -p0 -b .icpbrasil
119     %patch7 -p1 -b .defaults
120     %{?_with_krb5:%patch8 -p1 -b .krb5}
121     %patch12 -p1 -b .x509
122     %patch13 -p1 -b .version-add-engines
123     %patch15 -p1 -b .crt
124 guillomovitch 256937 %patch16 -p1 -b .engines
125 blino 733
126     %patch300 -p1 -b .mips
127     %patch301 -p1 -b .arm
128    
129     perl -pi -e "s,^(OPENSSL_LIBNAME=).+$,\1%{_lib}," Makefile.org engines/Makefile
130    
131     cp %{SOURCE2} Makefile.certificate
132     cp %{SOURCE3} make-dummy-cert
133     cp %{SOURCE4} openssl-thread-test.c
134    
135     %build
136     %serverbuild
137    
138     # Figure out which flags we want to use.
139     # default
140     sslarch=%{_os}-%{_arch}
141     %ifarch %ix86
142     sslarch=linux-elf
143     if ! echo %{_target} | grep -q i[56]86 ; then
144     sslflags="no-asm"
145     fi
146     %endif
147     %ifarch sparcv9
148     sslarch=linux-sparcv9
149     %endif
150     %ifarch alpha
151     sslarch=linux-alpha-gcc
152     %endif
153     %ifarch s390
154     sslarch="linux-generic32 -DB_ENDIAN -DNO_ASM"
155     %endif
156     %ifarch s390x
157     sslarch="linux-generic64 -DB_ENDIAN -DNO_ASM"
158     %endif
159    
160     # ia64, x86_64, ppc, ppc64 are OK by default
161     # Configure the build tree. Override OpenSSL defaults with known-good defaults
162     # usable on all platforms. The Configure script already knows to use -fPIC and
163     # RPM_OPT_FLAGS, so we can skip specifiying them here.
164     ./Configure \
165 guillomovitch 256937 --prefix=%{_prefix} \
166 blino 733 --openssldir=%{_sysconfdir}/pki/tls ${sslflags} \
167     --enginesdir=%{_libdir}/openssl-%{version}/engines \
168 guillomovitch 256937 --libdir=%{_lib}/ \
169     %{?_with_krb5:--with-krb5-flavor=MIT -I%{_prefix}/kerberos/include -L%{_prefix}/kerberos/%{_lib}} \
170     zlib no-idea no-rc5 enable-camellia shared enable-tlsext ${sslarch}
171 blino 733
172     # Add -Wa,--noexecstack here so that libcrypto's assembler modules will be
173     # marked as not requiring an executable stack.
174     RPM_OPT_FLAGS="%{optflags} -Wa,--noexecstack"
175     make depend
176     make all build-shared
177    
178     # Generate hashes for the included certs.
179     make rehash build-shared
180    
181     %check
182     # Verify that what was compiled actually works.
183     export LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
184    
185     make -C test apps tests
186    
187     gcc -o openssl-thread-test \
188     %{?_with_krb5:`krb5-config --cflags`} \
189     -I./include \
190     %{optflags} \
191     openssl-thread-test.c \
192     -L. -lssl -lcrypto \
193     %{?_with_krb5:`krb5-config --libs`} \
194     -lpthread -lz -ldl
195    
196     ./openssl-thread-test --threads %{thread_test_threads}
197    
198     %install
199     rm -fr %{buildroot}
200    
201     %makeinstall \
202     INSTALL_PREFIX=%{buildroot} \
203     MANDIR=%{_mandir} \
204     build-shared
205    
206     # the makefiles is too borked...
207     install -d %{buildroot}%{_libdir}/openssl-%{version}
208     mv %{buildroot}%{_libdir}/engines %{buildroot}%{_libdir}/openssl-%{version}/engines
209    
210     # make the rootcerts dir
211     install -d %{buildroot}%{_sysconfdir}/pki/tls/rootcerts
212    
213     # Install a makefile for generating keys and self-signed certs, and a script
214     # for generating them on the fly.
215     install -d %{buildroot}%{_sysconfdir}/pki/tls/certs
216     install -m0644 Makefile.certificate %{buildroot}%{_sysconfdir}/pki/tls/certs/Makefile
217     install -m0755 make-dummy-cert %{buildroot}%{_sysconfdir}/pki/tls/certs/make-dummy-cert
218    
219     # Pick a CA script.
220     mv %{buildroot}%{_sysconfdir}/pki/tls/misc/CA.sh %{buildroot}%{_sysconfdir}/pki/tls/misc/CA
221    
222     install -d %{buildroot}%{_sysconfdir}/pki/CA
223     install -d %{buildroot}%{_sysconfdir}/pki/CA/private
224    
225     # openssl was named ssleay in "ancient" times.
226     ln -snf openssl %{buildroot}%{_bindir}/ssleay
227    
228     # The man pages rand.3 and passwd.1 conflict with other packages
229     # Rename them to ssl-* and also make a symlink from openssl-* to ssl-*
230     mv %{buildroot}%{_mandir}/man1/passwd.1 %{buildroot}%{_mandir}/man1/ssl-passwd.1
231     ln -sf ssl-passwd.1.bz2 %{buildroot}%{_mandir}/man1/openssl-passwd.1.bz2
232    
233     for i in rand err; do
234     mv %{buildroot}%{_mandir}/man3/$i.3 %{buildroot}%{_mandir}/man3/ssl-$i.3
235     ln -snf ssl-$i.3.bz2 %{buildroot}%{_mandir}/man3/openssl-$i.3.bz2
236     done
237    
238     rm -rf {main,devel}-doc-info
239     mkdir -p {main,devel}-doc-info
240 guillomovitch 191621 cat > main-doc-info/README.mga <<EOF
241 blino 733 Warning:
242     The man page of passwd, passwd.1, has been renamed to ssl-passwd.1
243     to avoid a conflict with passwd.1 man page from the package passwd.
244     EOF
245    
246 guillomovitch 191621 cat > devel-doc-info/README.mga <<EOF
247 blino 733 Warning:
248     The man page of rand, rand.3, has been renamed to ssl-rand.3
249     to avoid a conflict with rand.3 from the package man-pages
250     The man page of err, err.3, has been renamed to ssl-err.3
251     to avoid a conflict with err.3 from the package man-pages
252     EOF
253    
254     chmod 755 %{buildroot}%{_libdir}/pkgconfig
255    
256     %multiarch_includes %{buildroot}%{_includedir}/openssl/opensslconf.h
257    
258     # strip cannot touch these unless 755
259     chmod 755 %{buildroot}%{_libdir}/openssl-%{version}/engines/*.so*
260     chmod 755 %{buildroot}%{_libdir}/*.so*
261     chmod 755 %{buildroot}%{_bindir}/*
262    
263     # nuke a mistake
264     rm -f %{buildroot}%{_mandir}/man3/.3
265    
266     # nuke rpath
267     chrpath -d %{buildroot}%{_bindir}/openssl
268    
269     # Fix libdir.
270     pushd %{buildroot}%{_libdir}/pkgconfig
271     for i in *.pc ; do
272     sed 's,^libdir=${exec_prefix}/lib$,libdir=${exec_prefix}/%{_lib},g' \
273     $i >$i.tmp && \
274     cat $i.tmp >$i && \
275     rm -f $i.tmp
276     done
277     popd
278    
279     # adjust ssldir
280     perl -pi -e "s|^CATOP=.*|CATOP=%{_sysconfdir}/pki/tls|g" %{buildroot}%{_sysconfdir}/pki/tls/misc/CA
281     perl -pi -e "s|^\\\$CATOP\=\".*|\\\$CATOP\=\"%{_sysconfdir}/pki/tls\";|g" %{buildroot}%{_sysconfdir}/pki/tls/misc/CA.pl
282     perl -pi -e "s|\./demoCA|%{_sysconfdir}/pki/tls|g" %{buildroot}%{_sysconfdir}/pki/tls/openssl.cnf
283    
284     %files
285     %doc FAQ INSTALL LICENSE NEWS PROBLEMS main-doc-info/README*
286 guillomovitch 256937 %doc README README.ASN1 README.ENGINE
287 blino 733 %dir %{_sysconfdir}/pki
288     %dir %{_sysconfdir}/pki/CA
289     %dir %{_sysconfdir}/pki/CA/private
290     %dir %{_sysconfdir}/pki/tls
291     %dir %{_sysconfdir}/pki/tls/certs
292     %dir %{_sysconfdir}/pki/tls/misc
293     %dir %{_sysconfdir}/pki/tls/private
294     %dir %{_sysconfdir}/pki/tls/rootcerts
295 guillomovitch 191620 %config(noreplace) %{_sysconfdir}/pki/tls/openssl.cnf
296     %{_sysconfdir}/pki/tls/certs/make-dummy-cert
297     %{_sysconfdir}/pki/tls/certs/Makefile
298     %{_sysconfdir}/pki/tls/misc/*
299     %{_bindir}/*
300     %{_mandir}/man[157]/*
301 blino 733
302     %files -n %{libname}
303     %doc FAQ INSTALL LICENSE NEWS PROBLEMS README*
304 guillomovitch 191620 %{_libdir}/lib*.so.*
305 blino 733
306     %files -n %{engines_name}
307 guillomovitch 191620 %dir %{_libdir}/openssl-%{version}/engines
308     %{_libdir}/openssl-%{version}/engines/*.so
309 blino 733
310     %files -n %{develname}
311     %doc CHANGES doc/* devel-doc-info/README*
312 guillomovitch 191620 %dir %{_includedir}/openssl
313 blino 733 %multiarch %{multiarch_includedir}/openssl/opensslconf.h
314 guillomovitch 191620 %{_includedir}/openssl/*
315     %{_libdir}/lib*.so
316     %{_mandir}/man3/*
317     %{_libdir}/pkgconfig/*
318 blino 733
319     %files -n %{staticname}
320 guillomovitch 191620 %{_libdir}/lib*.a

  ViewVC Help
Powered by ViewVC 1.1.30