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