File dba-openssl-354-static.spec of Package dba-openssl-354-static

%define pkg_name        openssl
%define real_vers       3.5.4
%define pkg_vers        %(echo %{version} | tr -d '.')
%define with_fips       0
%define prefix          /DBA/openssl/%{real_vers}
%define maketest        0
%define latest_script   set_openssl_3.5.latest.sh
%global debug_package %{nil}

Name:           dba-%{pkg_name}-%{pkg_vers}-static
Summary: 	The OpenSSL toolkit version %{pkg_vers} static build
Vendor: openSUSE Build Service
Version: 	%{real_vers}
Release: 	1
License: 	Apache-2.0
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

%if 0%{?suse_version}
BuildRequires: perl-Digest-SHA1
%else
BuildRequires:  perl-IPC-Cmd perl-Digest-SHA
%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 %{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 \
    no-idea \
    no-ec2m \
    enable-rfc3779 \
%ifarch x86_64 aarch64 ppc64le
    enable-ec_nistp_64_gcc_128 \
%endif
    enable-camellia \
    enable-fips \
    --prefix=%{prefix} \
    --openssldir=%{prefix} \
    %{optflags} \
    -Wa,--noexecstack \
    -Wl,-z,relro,-z,now \
    -fno-common \
    -DTERMIO \
    -DPURIFY \
    -D_GNU_SOURCE \
    -DOPENSSL_NO_BUF_FREELISTS \
    $(getconf LFS_CFLAGS) \
    -Wall \
    --with-rand-seed=getrandom \
    -fPIC

#./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}
%{__ln_s} -f %{prefix}/lib64 %{prefix}/lib

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


%changelog
* Mon Oct 27 2025 Dennis Hampe <dennis.hampe@bertelsmann.de>
- inital version
openSUSE Build Service is sponsored by