| 1 | # For the curious:
|
|---|
| 2 | # 0.9.5a soversion = 0
|
|---|
| 3 | # 0.9.6 soversion = 1
|
|---|
| 4 | # 0.9.6a soversion = 2
|
|---|
| 5 | # 0.9.6c soversion = 3
|
|---|
| 6 | # 0.9.7a soversion = 4
|
|---|
| 7 | # 0.9.7ef soversion = 5
|
|---|
| 8 | # 0.9.8ab soversion = 6
|
|---|
| 9 | # 0.9.8g soversion = 7
|
|---|
| 10 | # 0.9.8jk + EAP-FAST soversion = 8
|
|---|
| 11 | # 1.0.0 soversion = 10
|
|---|
| 12 | %define soversion 10
|
|---|
| 13 |
|
|---|
| 14 | # Number of threads to spawn when testing some threading fixes.
|
|---|
| 15 | %define thread_test_threads %{?threads:%{threads}}%{!?threads:1}
|
|---|
| 16 |
|
|---|
| 17 | # Arches on which we need to prevent arch conflicts on opensslconf.h, must
|
|---|
| 18 | # also be handled in opensslconf-new.h.
|
|---|
| 19 | %define multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x sparcv9 sparc64 x86_64
|
|---|
| 20 |
|
|---|
| 21 | Summary: A general purpose cryptography library with TLS implementation
|
|---|
| 22 | Name: openssl
|
|---|
| 23 | Version: 1.0.0a
|
|---|
| 24 | Release: 5%{?dist}
|
|---|
| 25 |
|
|---|
| 26 | Source: openssl-%{version}.tar.gz
|
|---|
| 27 |
|
|---|
| 28 | # Build changes
|
|---|
| 29 | Patch0: openssl-os2.diff
|
|---|
| 30 | Patch1: openssl-find.pl
|
|---|
| 31 |
|
|---|
| 32 | License: OpenSSL
|
|---|
| 33 | Group: System Environment/Libraries
|
|---|
| 34 | URL: http://www.openssl.org/
|
|---|
| 35 | BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|---|
| 36 |
|
|---|
| 37 | #BuildRequires: mktemp, krb5-devel, perl, sed, zlib-devel, /usr/bin/cmp
|
|---|
| 38 | BuildRequires: zlib-devel
|
|---|
| 39 | #BuildRequires: /usr/bin/rename
|
|---|
| 40 | #Requires: mktemp
|
|---|
| 41 | Requires: ca-certificates
|
|---|
| 42 |
|
|---|
| 43 | %description
|
|---|
| 44 | The OpenSSL toolkit provides support for secure communications between
|
|---|
| 45 | machines. OpenSSL includes a certificate management tool and shared
|
|---|
| 46 | libraries which provide various cryptographic algorithms and
|
|---|
| 47 | protocols.
|
|---|
| 48 |
|
|---|
| 49 | %package devel
|
|---|
| 50 | Summary: Files for development of applications which will use OpenSSL
|
|---|
| 51 | Group: Development/Libraries
|
|---|
| 52 | Requires: %{name} = %{version}-%{release}, zlib-devel
|
|---|
| 53 | Requires: pkgconfig
|
|---|
| 54 |
|
|---|
| 55 | %description devel
|
|---|
| 56 | OpenSSL is a toolkit for supporting cryptography. The openssl-devel
|
|---|
| 57 | package contains include files needed to develop applications which
|
|---|
| 58 | support various cryptographic algorithms and protocols.
|
|---|
| 59 |
|
|---|
| 60 | %package static
|
|---|
| 61 | Summary: Libraries for static linking of applications which will use OpenSSL
|
|---|
| 62 | Group: Development/Libraries
|
|---|
| 63 | Requires: %{name}-devel = %{version}-%{release}
|
|---|
| 64 |
|
|---|
| 65 | %description static
|
|---|
| 66 | OpenSSL is a toolkit for supporting cryptography. The openssl-static
|
|---|
| 67 | package contains static libraries needed for static linking of
|
|---|
| 68 | applications which support various cryptographic algorithms and
|
|---|
| 69 | protocols.
|
|---|
| 70 |
|
|---|
| 71 | %package perl
|
|---|
| 72 | Summary: Perl scripts provided with OpenSSL
|
|---|
| 73 | Group: Applications/Internet
|
|---|
| 74 | Requires: perl
|
|---|
| 75 | Requires: %{name} = %{version}-%{release}
|
|---|
| 76 |
|
|---|
| 77 | %description perl
|
|---|
| 78 | OpenSSL is a toolkit for supporting cryptography. The openssl-perl
|
|---|
| 79 | package provides Perl scripts for converting certificates and keys
|
|---|
| 80 | from other formats to the formats used by the OpenSSL toolkit.
|
|---|
| 81 |
|
|---|
| 82 | %prep
|
|---|
| 83 | %setup -q -n %{name}-%{version}
|
|---|
| 84 | %patch0 -p1 -b .os2~
|
|---|
| 85 | %patch1 -p0 -b .os2~
|
|---|
| 86 |
|
|---|
| 87 | # Modify the various perl scripts to reference perl in the right location.
|
|---|
| 88 | perl util/perlpath.pl `dirname %{__perl}`
|
|---|
| 89 |
|
|---|
| 90 | # Generate a table with the compile settings for my perusal.
|
|---|
| 91 | touch Makefile
|
|---|
| 92 | make TABLE PERL=%{__perl}
|
|---|
| 93 |
|
|---|
| 94 | %build
|
|---|
| 95 | # Figure out which flags we want to use.
|
|---|
| 96 | # default
|
|---|
| 97 | sslarch=OS2-KNIX
|
|---|
| 98 |
|
|---|
| 99 | # Configure the build tree. Override OpenSSL defaults with known-good defaults
|
|---|
| 100 | # usable on all platforms. The Configure script already knows to use -fPIC and
|
|---|
| 101 | # RPM_OPT_FLAGS, so we can skip specifiying them here.
|
|---|
| 102 | export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe"
|
|---|
| 103 | export MAKESHELL="/@unixroot/usr/bin/sh.exe"
|
|---|
| 104 | export CFLAGS="${CFLAGS:-%optflags}" ; \
|
|---|
| 105 | ./Configure \
|
|---|
| 106 | --prefix=%{_usr} --openssldir=%{_sysconfdir}/pki/tls ${sslflags} \
|
|---|
| 107 | zlib enable-camellia enable-seed enable-tlsext enable-rfc3779 \
|
|---|
| 108 | enable-cms no-idea no-mdc2 no-rc5 no-ec no-ecdh no-ecdsa \
|
|---|
| 109 | no-krb5 \
|
|---|
| 110 | ${sslarch} shared
|
|---|
| 111 |
|
|---|
| 112 | # Add -Wa,--noexecstack here so that libcrypto's assembler modules will be
|
|---|
| 113 | # marked as not requiring an executable stack.
|
|---|
| 114 | #RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wa,--noexecstack"
|
|---|
| 115 | make depend
|
|---|
| 116 | # YD smp build not supported
|
|---|
| 117 | make all
|
|---|
| 118 |
|
|---|
| 119 | # Generate hashes for the included certs.
|
|---|
| 120 | make rehash
|
|---|
| 121 |
|
|---|
| 122 | # Overwrite FIPS README
|
|---|
| 123 | #cp -f %{SOURCE11} .
|
|---|
| 124 |
|
|---|
| 125 | %check
|
|---|
| 126 | # Verify that what was compiled actually works.
|
|---|
| 127 |
|
|---|
| 128 | # We must revert patch33 before tests otherwise they will fail
|
|---|
| 129 | #patch -p1 -R < %{PATCH33}
|
|---|
| 130 |
|
|---|
| 131 | #LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
|
|---|
| 132 | #export LD_LIBRARY_PATH
|
|---|
| 133 | #make -C test apps tests
|
|---|
| 134 | #%{__cc} -o openssl-thread-test \
|
|---|
| 135 | # `krb5-config --cflags` \
|
|---|
| 136 | # -I./include \
|
|---|
| 137 | # $RPM_OPT_FLAGS \
|
|---|
| 138 | # %{SOURCE8} \
|
|---|
| 139 | # -L. \
|
|---|
| 140 | # -lssl -lcrypto \
|
|---|
| 141 | # `krb5-config --libs` \
|
|---|
| 142 | # -lpthread -lz -ldl
|
|---|
| 143 | #./openssl-thread-test --threads %{thread_test_threads}
|
|---|
| 144 |
|
|---|
| 145 | # Add generation of HMAC checksum of the final stripped library
|
|---|
| 146 | #%define __spec_install_post \
|
|---|
| 147 | # %{?__debug_package:%{__debug_install_post}} \
|
|---|
| 148 | # %{__arch_install_post} \
|
|---|
| 149 | # %{__os_install_post} \
|
|---|
| 150 | # crypto/fips/fips_standalone_sha1 $RPM_BUILD_ROOT/%{_lib}/libcrypto.so.%{version} >$RPM_BUILD_ROOT/%{_lib}/.libcrypto.so.%{version}.hmac \
|
|---|
| 151 | # ln -sf .libcrypto.so.%{version}.hmac $RPM_BUILD_ROOT/%{_lib}/.libcrypto.so.%{soversion}.hmac \
|
|---|
| 152 | # crypto/fips/fips_standalone_sha1 $RPM_BUILD_ROOT%{_libdir}/libssl.so.%{version} >$RPM_BUILD_ROOT%{_libdir}/.libssl.so.%{version}.hmac \
|
|---|
| 153 | # ln -sf .libssl.so.%{version}.hmac $RPM_BUILD_ROOT%{_libdir}/.libssl.so.%{soversion}.hmac \
|
|---|
| 154 | #%{nil}
|
|---|
| 155 |
|
|---|
| 156 | %install
|
|---|
| 157 | [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
|---|
| 158 |
|
|---|
| 159 | export MAKESHELL="/@unixroot/usr/bin/sh.exe"
|
|---|
| 160 |
|
|---|
| 161 | # Install OpenSSL.
|
|---|
| 162 | install -d $RPM_BUILD_ROOT%{_bindir}
|
|---|
| 163 | install -d $RPM_BUILD_ROOT%{_includedir}
|
|---|
| 164 | install -d $RPM_BUILD_ROOT%{_libdir}
|
|---|
| 165 | install -d $RPM_BUILD_ROOT%{_mandir}
|
|---|
| 166 | install -d $RPM_BUILD_ROOT%{_libdir}/openssl
|
|---|
| 167 | make INSTALL_PREFIX=$RPM_BUILD_ROOT install
|
|---|
| 168 | make INSTALL_PREFIX=$RPM_BUILD_ROOT install_docs
|
|---|
| 169 |
|
|---|
| 170 | cp ssl_s.a $RPM_BUILD_ROOT%{_libdir}
|
|---|
| 171 | cp ssl%{soversion}.dll $RPM_BUILD_ROOT%{_libdir}
|
|---|
| 172 | cp crypto_s.a $RPM_BUILD_ROOT%{_libdir}
|
|---|
| 173 | cp crypto%{soversion}.dll $RPM_BUILD_ROOT%{_libdir}
|
|---|
| 174 |
|
|---|
| 175 | mv $RPM_BUILD_ROOT%{_libdir}/engines $RPM_BUILD_ROOT%{_libdir}/openssl
|
|---|
| 176 | mv $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/man/* $RPM_BUILD_ROOT%{_mandir}/
|
|---|
| 177 | rmdir $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/man
|
|---|
| 178 |
|
|---|
| 179 | #rename so.%{soversion} so.%{version} $RPM_BUILD_ROOT%{_libdir}/*.so.%{soversion}
|
|---|
| 180 | #mkdir $RPM_BUILD_ROOT/%{_lib}
|
|---|
| 181 | #mv $RPM_BUILD_ROOT%{_libdir}/libcrypto.so.%{version} $RPM_BUILD_ROOT/%{_lib}
|
|---|
| 182 | #for lib in $RPM_BUILD_ROOT%{_libdir}/*.so.%{version} ; do
|
|---|
| 183 | # chmod 755 ${lib}
|
|---|
| 184 | # ln -s -f `basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`
|
|---|
| 185 | # ln -s -f `basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`.%{soversion}
|
|---|
| 186 | #done
|
|---|
| 187 | #for lib in $RPM_BUILD_ROOT/%{_lib}/*.so.%{version} ; do
|
|---|
| 188 | # chmod 755 ${lib}
|
|---|
| 189 | # ln -s -f ../../%{_lib}/`basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`
|
|---|
| 190 | # ln -s -f `basename ${lib}` $RPM_BUILD_ROOT/%{_lib}/`basename ${lib} .%{version}`.%{soversion}
|
|---|
| 191 | #done
|
|---|
| 192 |
|
|---|
| 193 | # Install a makefile for generating keys and self-signed certs, and a script
|
|---|
| 194 | # for generating them on the fly.
|
|---|
| 195 | mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs
|
|---|
| 196 | #install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs/Makefile
|
|---|
| 197 | #install -m755 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs/make-dummy-cert
|
|---|
| 198 |
|
|---|
| 199 | # Make sure we actually include the headers we built against.
|
|---|
| 200 | for header in $RPM_BUILD_ROOT%{_includedir}/openssl/* ; do
|
|---|
| 201 | if [ -f ${header} -a -f include/openssl/$(basename ${header}) ] ; then
|
|---|
| 202 | install -m644 include/openssl/`basename ${header}` ${header}
|
|---|
| 203 | fi
|
|---|
| 204 | done
|
|---|
| 205 |
|
|---|
| 206 | # Rename man pages so that they don't conflict with other system man pages.
|
|---|
| 207 | #pushd $RPM_BUILD_ROOT%{_mandir}
|
|---|
| 208 | for manpage in $RPM_BUILD_ROOT%{_mandir}/man*/* ; do
|
|---|
| 209 | if [ -L ${manpage} ]; then
|
|---|
| 210 | TARGET=`ls -l ${manpage} | awk '{ print $NF }'`
|
|---|
| 211 | ln -snf ${TARGET}ssl ${manpage}ssl
|
|---|
| 212 | rm -f ${manpage}
|
|---|
| 213 | else
|
|---|
| 214 | mv ${manpage} ${manpage}ssl
|
|---|
| 215 | fi
|
|---|
| 216 | done
|
|---|
| 217 | #for conflict in passwd rand ; do
|
|---|
| 218 | # rename ${conflict} ssl${conflict} man*/${conflict}*
|
|---|
| 219 | #done
|
|---|
| 220 | #popd
|
|---|
| 221 |
|
|---|
| 222 | # Pick a CA script.
|
|---|
| 223 | #pushd $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/misc
|
|---|
| 224 | mv $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/misc/CA.sh $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/misc/CA
|
|---|
| 225 | #popd
|
|---|
| 226 |
|
|---|
| 227 | mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA
|
|---|
| 228 | mkdir -m700 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/private
|
|---|
| 229 | mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/certs
|
|---|
| 230 | mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/crl
|
|---|
| 231 | mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/newcerts
|
|---|
| 232 |
|
|---|
| 233 | # Ensure the openssl.cnf timestamp is identical across builds to avoid
|
|---|
| 234 | # mulitlib conflicts and unnecessary renames on upgrade
|
|---|
| 235 | #touch -r %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/openssl.cnf
|
|---|
| 236 |
|
|---|
| 237 | # Determine which arch opensslconf.h is going to try to #include.
|
|---|
| 238 | #basearch=i386
|
|---|
| 239 | #%ifarch %{multilib_arches}
|
|---|
| 240 | # Do an opensslconf.h switcheroo to avoid file conflicts on systems where you
|
|---|
| 241 | # can have both a 32- and 64-bit version of the library, and they each need
|
|---|
| 242 | # their own correct-but-different versions of opensslconf.h to be usable.
|
|---|
| 243 | #install -m644 %{SOURCE10} \
|
|---|
| 244 | # $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf-${basearch}.h
|
|---|
| 245 | #cat $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf.h >> \
|
|---|
| 246 | # $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf-${basearch}.h
|
|---|
| 247 | #install -m644 %{SOURCE9} \
|
|---|
| 248 | # $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf.h
|
|---|
| 249 | #%endif
|
|---|
| 250 |
|
|---|
| 251 | # Remove unused files from upstream fips support
|
|---|
| 252 | rm -rf $RPM_BUILD_ROOT/%{_bindir}/openssl_fips_fingerprint
|
|---|
| 253 | rm -rf $RPM_BUILD_ROOT/%{_libdir}/fips_premain.*
|
|---|
| 254 | rm -rf $RPM_BUILD_ROOT/%{_libdir}/fipscanister.*
|
|---|
| 255 |
|
|---|
| 256 | %clean
|
|---|
| 257 | [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
|---|
| 258 |
|
|---|
| 259 | %files
|
|---|
| 260 | %defattr(-,root,root)
|
|---|
| 261 | %doc FAQ LICENSE CHANGES NEWS INSTALL README
|
|---|
| 262 | %doc doc/c-indentation.el doc/openssl.txt
|
|---|
| 263 | %doc doc/openssl_button.html doc/openssl_button.gif
|
|---|
| 264 | %doc doc/ssleay.txt
|
|---|
| 265 | #%doc README.FIPS
|
|---|
| 266 | %dir %{_sysconfdir}/pki/tls
|
|---|
| 267 | %dir %{_sysconfdir}/pki/tls/certs
|
|---|
| 268 | #%{_sysconfdir}/pki/tls/certs/make-dummy-cert
|
|---|
| 269 | #%{_sysconfdir}/pki/tls/certs/Makefile
|
|---|
| 270 | %dir %{_sysconfdir}/pki/tls/misc
|
|---|
| 271 | %{_sysconfdir}/pki/tls/misc/CA
|
|---|
| 272 | %dir %{_sysconfdir}/pki/CA
|
|---|
| 273 | %dir %{_sysconfdir}/pki/CA/private
|
|---|
| 274 | %dir %{_sysconfdir}/pki/CA/certs
|
|---|
| 275 | %dir %{_sysconfdir}/pki/CA/crl
|
|---|
| 276 | %dir %{_sysconfdir}/pki/CA/newcerts
|
|---|
| 277 | %{_sysconfdir}/pki/tls/misc/c_*
|
|---|
| 278 | %{_sysconfdir}/pki/tls/private
|
|---|
| 279 |
|
|---|
| 280 | %config(noreplace) %{_sysconfdir}/pki/tls/openssl.cnf
|
|---|
| 281 |
|
|---|
| 282 | %attr(0755,root,root) %{_bindir}/openssl.exe
|
|---|
| 283 | %attr(0755,root,root) %{_libdir}/crypto%{soversion}.dll
|
|---|
| 284 | %attr(0755,root,root) %{_libdir}/ssl%{soversion}.dll
|
|---|
| 285 | #%attr(0644,root,root) /%{_lib}/.libcrypto.so.*.hmac
|
|---|
| 286 | #%attr(0644,root,root) %{_libdir}/.libssl.so.*.hmac
|
|---|
| 287 | %attr(0755,root,root) %{_libdir}/openssl
|
|---|
| 288 | %attr(0644,root,root) %{_mandir}/man1*/[ABD-Zabcd-z]*
|
|---|
| 289 | %attr(0644,root,root) %{_mandir}/man5*/*
|
|---|
| 290 | %attr(0644,root,root) %{_mandir}/man7*/*
|
|---|
| 291 |
|
|---|
| 292 | %files devel
|
|---|
| 293 | %defattr(-,root,root)
|
|---|
| 294 | %{_prefix}/include/openssl
|
|---|
| 295 | %attr(0755,root,root) %{_libdir}/*%{soversion}.dll
|
|---|
| 296 | %attr(0755,root,root) %{_libdir}/lib*.a
|
|---|
| 297 | %attr(0644,root,root) %{_mandir}/man3*/*
|
|---|
| 298 | %attr(0644,root,root) %{_libdir}/pkgconfig/*.pc
|
|---|
| 299 |
|
|---|
| 300 | %files static
|
|---|
| 301 | %defattr(-,root,root)
|
|---|
| 302 | %attr(0644,root,root) %{_libdir}/*_s.a
|
|---|
| 303 |
|
|---|
| 304 | %files perl
|
|---|
| 305 | %defattr(-,root,root)
|
|---|
| 306 | %attr(0755,root,root) %{_bindir}/c_rehash
|
|---|
| 307 | %attr(0644,root,root) %{_mandir}/man1*/*.pl*
|
|---|
| 308 | %{_sysconfdir}/pki/tls/misc/*.pl
|
|---|
| 309 | %{_sysconfdir}/pki/tls/misc/tsget
|
|---|
| 310 |
|
|---|
| 311 | %changelog
|
|---|
| 312 | * Wed Dec 05 2012 yd
|
|---|
| 313 | - ca-certificates are required for proper ssl checks.
|
|---|
| 314 | - added File::Find wrapper for find.pl.
|
|---|
| 315 |
|
|---|
| 316 | * Mon Jan 16 2012 yd
|
|---|
| 317 | - rebuild with libc 0.6.4 runtime.
|
|---|