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

  ViewVC Help
Powered by ViewVC 1.1.30