File dba-openssl-110a-static.spec of Package dba-openssl-110a-static

%define pkg_name        openssl
%define real_vers       1.1.0a
%define pkg_vers        110a
%define fips_vers       2.0.13
%define with_fips       0
%define prefix          /DBA/openssl/%{real_vers}
%define maketest        0

Name:           dba-%{pkg_name}-%{pkg_vers}-static
Summary: 	The OpenSSL toolkit version 1.0.2h static build
Version: 	%{real_vers}
Release: 	1
License: 	GPL
Group: 		System Environment/Libraries
URL: 		http://www.openssl.org/
Source0: 	http://openssl.org/source/%{pkg_name}-%{real_vers}.tar.gz
Source1:        dba-%{pkg_name}-rpmlintrc
Source2:        filter-provides.sh
Source3:        filter-requires-openssl.sh
# Source4:	https://www.openssl.org/source/openssl-fips-%{fips_vers}.tar.gz
Source5:        http://openssl.org/source/%{pkg_name}-%{real_vers}.tar.gz.sha256
Source6:	https://www.openssl.org/source/openssl-fips-ecp-%{fips_vers}.tar.gz
Source7:	https://www.openssl.org/source/openssl-fips-ecp-%{fips_vers}.tar.gz.sha256
#
BuildRoot: 	%{_tmppath}/%{pkg_name}-%{real_vers}-build

Provides: 	dba-%{pkg_name}=%{real_vers}

%define _use_internal_dependency_generator 0
%define __find_provides %{SOURCE2}
%define __find_requires %{SOURCE3}

%if 0%{?suse_version} >= 1100
BuildRequires:  -post-build-checks
%endif


%description
The OpenSSL toolkit provides support for secure communications between
machines. OpenSSL includes a certificate management tool and shared
libraries which provide various cryptographic algorithms and
protocols.


%prep
%if 0%{?sles_version} != 10
sha256sum %{SOURCE0} | awk '{print $1;}' | cmp - %{SOURCE5}
sha256sum %{SOURCE6} | awk '{print $1;}' | cmp - %{SOURCE7}
%endif


%if %{with_fips}
%setup -q -n %{pkg_name}-%{real_vers} -a 6
%else
%setup -q -n %{pkg_name}-%{real_vers}
%endif

%{__chmod} +x %{SOURCE2}
%{__chmod} +x %{SOURCE3}


%build
%if %{with_fips}
export FLD=`pwd`/openssl-fips-ecp-%{fips_vers}/fips/
export FIPSDIR=`pwd`/openssl-fips-ecp-%{fips_vers}/
mkdir -p $FIPSDIR/bin

pushd openssl-fips-ecp-%{fips_vers}
./config fips no-shared -fPIC \
  --prefix=%{prefix} \

%{__make}
cp fips/*.h ../include/openssl/
cp fips/rand/*.h ../include/openssl/
cp -p fips/fipsld $FIPSDIR/bin/
ln -s `which openssl` $FIPSDIR/bin/openssl

popd

./config fips no-ec2m no-shared -fPIC \
  --with-fipslibdir=$FLD \
  --prefix=%{prefix}
%else
./config no-shared -fPIC \
  --prefix=%{prefix}
%endif

%{__make}


%check
%if %maketest
%{__make} test
%endif


%install
%{__mkdir_p} %{buildroot}%{prefix}
%{__make} DESTDIR=%{buildroot} install


%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}


%post
# add openssl.pc files to pkgconfig directory
if [ -d %{_libdir}/pkgconfig ]; then
  cd %{_libdir}/pkgconfig
  for F in libcrypto.pc libssl.pc openssl.pc
  do
    if [ -e $F ]; then
      %{__rm} -f $F
    fi
    %{__ln_s} -f %{prefix}/lib/pkgconfig/$F .
  done
fi


%files
%defattr(-,root,root,-)
%dir %{prefix}
%{prefix}/*


%changelog
* Thu Sep 22 2016 Holger Manthey <holger.manthey@bertelsmann.de>
- initial package