File dba-openssl-111n-static.spec of Package dba-openssl-111n-static

%define pkg_name        openssl
%define real_vers       1.1.1n
%define pkg_vers        111n
%define fips_vers       2.0.16
%define with_fips       0
%define prefix          /DBA/openssl/%{real_vers}
%define maketest        0
%define latest_script   set_apache_1.1.1latest.sh
%global debug_package %{nil}

Name:           dba-%{pkg_name}-%{pkg_vers}-static
Summary: 	The OpenSSL toolkit version 1.1.1n static build
Vendor: openSUSE Build Service
Version: 	%{real_vers}
Release: 	1
License: 	GPL-2.0-or-later
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
Source8:        %{latest_script}
#
BuildRoot: 	%{_tmppath}/%{pkg_name}-%{real_vers}-build

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

#!BuildIgnore:  nspr dba-geoip-148 dba-geoip-160 dba-git-2191

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

%if 0%{?centos_version} == 800 
%global debug_package %{nil}
%endif

%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

%{__install} -m 0755 %{S:8} %{buildroot}%{prefix}/bin/%{latest_script}

%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

cd %{prefix}/..
%{prefix}/bin/%{latest_script}

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


%changelog
* Wed Mar 16 2022 Dennis Hampe <dennis.hampe@bertelsmann.de>
 initial package
openSUSE Build Service is sponsored by