2019-07-15 15:30:21 +00:00
|
|
|
# Recent so-version, so we do not bump accidentally.
|
2020-05-04 06:28:50 +00:00
|
|
|
%global nettle_so_ver 8
|
|
|
|
%global hogweed_so_ver 6
|
2019-07-15 15:30:21 +00:00
|
|
|
|
2019-07-15 15:04:46 +00:00
|
|
|
# Set to 1 when building a bootstrap for a bumped so-name.
|
2021-01-11 14:28:12 +00:00
|
|
|
%global bootstrap 0
|
2019-07-15 15:04:46 +00:00
|
|
|
|
|
|
|
%if 0%{?bootstrap}
|
2020-05-04 06:28:50 +00:00
|
|
|
%global version_old 3.5.1
|
|
|
|
%global nettle_so_ver_old 7
|
|
|
|
%global hogweed_so_ver_old 5
|
2019-07-15 15:04:46 +00:00
|
|
|
%endif
|
|
|
|
|
2018-03-09 08:59:19 +00:00
|
|
|
%bcond_without fips
|
|
|
|
|
2012-06-18 11:00:41 +00:00
|
|
|
Name: nettle
|
2023-06-05 08:21:18 +00:00
|
|
|
Version: 3.9.1
|
2023-08-24 01:32:08 +00:00
|
|
|
Release: %{?autorelease}%{!?autorelease:1%{?dist}}
|
2012-06-18 11:00:41 +00:00
|
|
|
Summary: A low-level cryptographic library
|
|
|
|
|
2023-08-24 01:33:37 +00:00
|
|
|
License: LGPL-3.0-or-later OR GPL-2.0-or-later
|
2012-06-18 11:00:41 +00:00
|
|
|
URL: http://www.lysator.liu.se/~nisse/nettle/
|
2016-02-03 10:36:28 +00:00
|
|
|
Source0: %{name}-%{version}-hobbled.tar.xz
|
2022-06-03 08:24:40 +00:00
|
|
|
#Source0: http://www.lysator.liu.se/~nisse/archive/%%{name}-%%{version}.tar.gz
|
2019-07-15 15:04:46 +00:00
|
|
|
%if 0%{?bootstrap}
|
|
|
|
Source1: %{name}-%{version_old}-hobbled.tar.xz
|
2020-05-04 06:28:50 +00:00
|
|
|
Source2: nettle-3.5-remove-ecc-testsuite.patch
|
2019-07-15 15:04:46 +00:00
|
|
|
%endif
|
2012-06-18 11:00:41 +00:00
|
|
|
|
2021-01-07 05:43:32 +00:00
|
|
|
BuildRequires: make
|
2018-07-23 12:33:43 +00:00
|
|
|
BuildRequires: gcc
|
2016-10-03 06:25:59 +00:00
|
|
|
BuildRequires: gmp-devel, m4
|
2016-07-19 07:41:38 +00:00
|
|
|
BuildRequires: libtool, automake, autoconf, gettext-devel
|
2018-03-09 08:59:19 +00:00
|
|
|
%if %{with fips}
|
2018-07-23 12:33:43 +00:00
|
|
|
BuildRequires: fipscheck
|
2018-03-09 08:59:19 +00:00
|
|
|
%endif
|
2012-06-18 11:00:41 +00:00
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development headers for a low-level cryptographic library
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
2013-02-06 12:34:06 +00:00
|
|
|
Requires: gmp-devel%{?_isa}
|
2012-06-18 11:00:41 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Nettle is a cryptographic library that is designed to fit easily in more
|
|
|
|
or less any context: In crypto toolkits for object-oriented languages
|
|
|
|
(C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in
|
|
|
|
kernel space.
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
Nettle is a cryptographic library that is designed to fit easily in more
|
|
|
|
or less any context: In crypto toolkits for object-oriented languages
|
|
|
|
(C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in
|
2013-11-26 10:15:26 +00:00
|
|
|
kernel space. This package contains the files needed for developing
|
|
|
|
applications with nettle.
|
2012-06-18 11:00:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
%prep
|
2020-05-04 06:35:05 +00:00
|
|
|
%autosetup -Tb 0 -p1
|
2019-07-15 15:04:46 +00:00
|
|
|
|
|
|
|
%if 0%{?bootstrap}
|
|
|
|
mkdir -p bootstrap_ver
|
|
|
|
pushd bootstrap_ver
|
|
|
|
tar --strip-components=1 -xf %{SOURCE1}
|
|
|
|
patch -p1 < %{SOURCE2}
|
|
|
|
|
|
|
|
# Disable -ggdb3 which makes debugedit unhappy
|
|
|
|
sed s/ggdb3/g/ -i configure
|
2020-05-04 06:52:43 +00:00
|
|
|
sed 's/ecc-192.c//g' -i Makefile.in
|
|
|
|
sed 's/ecc-224.c//g' -i Makefile.in
|
2019-07-15 15:04:46 +00:00
|
|
|
popd
|
|
|
|
%endif
|
|
|
|
|
2012-06-18 11:00:41 +00:00
|
|
|
# Disable -ggdb3 which makes debugedit unhappy
|
|
|
|
sed s/ggdb3/g/ -i configure
|
2020-05-04 06:28:50 +00:00
|
|
|
sed 's/ecc-secp192r1.c//g' -i Makefile.in
|
|
|
|
sed 's/ecc-secp224r1.c//g' -i Makefile.in
|
2012-06-18 11:00:41 +00:00
|
|
|
|
|
|
|
%build
|
2016-07-19 07:41:38 +00:00
|
|
|
autoreconf -ifv
|
2023-06-05 08:21:18 +00:00
|
|
|
# For annocheck
|
|
|
|
export ASM_FLAGS="-Wa,--generate-missing-build-notes=yes"
|
2016-10-03 06:25:59 +00:00
|
|
|
%configure --enable-shared --enable-fat
|
2020-07-14 02:06:27 +00:00
|
|
|
%make_build
|
2012-06-18 11:00:41 +00:00
|
|
|
|
2019-07-15 15:04:46 +00:00
|
|
|
%if 0%{?bootstrap}
|
|
|
|
pushd bootstrap_ver
|
|
|
|
autoconf
|
|
|
|
%configure --with-tests
|
|
|
|
%make_build
|
|
|
|
popd
|
|
|
|
%endif
|
|
|
|
|
2018-03-09 08:59:19 +00:00
|
|
|
%if %{with fips}
|
2019-07-16 08:43:37 +00:00
|
|
|
%define fipshmac() \
|
|
|
|
fipshmac -d $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_libdir}/%1.* \
|
|
|
|
file=`basename $RPM_BUILD_ROOT%{_libdir}/%1.*.hmac` && \
|
|
|
|
mv $RPM_BUILD_ROOT%{_libdir}/$file $RPM_BUILD_ROOT%{_libdir}/.$file && \
|
|
|
|
ln -s .$file $RPM_BUILD_ROOT%{_libdir}/.%1.hmac
|
|
|
|
|
2019-07-15 15:04:46 +00:00
|
|
|
%if 0%{?bootstrap}
|
|
|
|
%define bootstrap_fips 1
|
|
|
|
%endif
|
|
|
|
|
2018-03-09 08:59:19 +00:00
|
|
|
%define __spec_install_post \
|
|
|
|
%{?__debug_package:%{__debug_install_post}} \
|
|
|
|
%{__arch_install_post} \
|
|
|
|
%{__os_install_post} \
|
2019-07-16 08:43:37 +00:00
|
|
|
%fipshmac libnettle.so.%{nettle_so_ver} \
|
|
|
|
%fipshmac libhogweed.so.%{hogweed_so_ver} \
|
2019-07-15 15:04:46 +00:00
|
|
|
%{?bootstrap_fips:%fipshmac libnettle.so.%{nettle_so_ver_old}} \
|
|
|
|
%{?bootstrap_fips:%fipshmac libhogweed.so.%{hogweed_so_ver_old}} \
|
2018-03-09 08:59:19 +00:00
|
|
|
%{nil}
|
|
|
|
%endif
|
2012-06-18 11:00:41 +00:00
|
|
|
|
2019-07-15 15:04:46 +00:00
|
|
|
|
2012-06-18 11:00:41 +00:00
|
|
|
%install
|
2019-07-15 15:04:46 +00:00
|
|
|
%if 0%{?bootstrap}
|
|
|
|
make -C bootstrap_ver install-shared-nettle DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
|
|
|
|
make -C bootstrap_ver install-shared-hogweed DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
|
|
|
|
|
|
|
|
chmod 0755 $RPM_BUILD_ROOT%{_libdir}/libnettle.so.%{nettle_so_ver_old}.*
|
|
|
|
chmod 0755 $RPM_BUILD_ROOT%{_libdir}/libhogweed.so.%{hogweed_so_ver_old}.*
|
|
|
|
%endif
|
|
|
|
|
2020-07-14 02:06:27 +00:00
|
|
|
%make_install
|
2012-06-18 11:00:41 +00:00
|
|
|
make install-shared DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_infodir}
|
|
|
|
install -p -m 644 nettle.info $RPM_BUILD_ROOT%{_infodir}/
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
2017-08-09 13:24:56 +00:00
|
|
|
rm -f $RPM_BUILD_ROOT%{_bindir}/nettle-lfib-stream
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_bindir}/pkcs1-conv
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_bindir}/sexp-conv
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_bindir}/nettle-hash
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_bindir}/nettle-pbkdf2
|
|
|
|
|
2019-07-15 15:30:21 +00:00
|
|
|
chmod 0755 $RPM_BUILD_ROOT%{_libdir}/libnettle.so.%{nettle_so_ver}.*
|
|
|
|
chmod 0755 $RPM_BUILD_ROOT%{_libdir}/libhogweed.so.%{hogweed_so_ver}.*
|
2015-08-02 22:06:02 +00:00
|
|
|
|
2012-06-18 11:00:41 +00:00
|
|
|
%check
|
|
|
|
make check
|
|
|
|
|
|
|
|
%files
|
2019-07-15 10:43:16 +00:00
|
|
|
%doc AUTHORS NEWS README
|
2015-04-30 09:56:29 +00:00
|
|
|
%license COPYINGv2 COPYING.LESSERv3
|
2019-04-24 12:56:37 +00:00
|
|
|
%{_infodir}/nettle.info.*
|
2019-07-15 15:30:21 +00:00
|
|
|
%{_libdir}/libnettle.so.%{nettle_so_ver}
|
|
|
|
%{_libdir}/libnettle.so.%{nettle_so_ver}.*
|
|
|
|
%{_libdir}/libhogweed.so.%{hogweed_so_ver}
|
|
|
|
%{_libdir}/libhogweed.so.%{hogweed_so_ver}.*
|
2019-07-15 15:04:46 +00:00
|
|
|
%if 0%{?bootstrap}
|
|
|
|
%{_libdir}/libnettle.so.%{nettle_so_ver_old}
|
|
|
|
%{_libdir}/libnettle.so.%{nettle_so_ver_old}.*
|
|
|
|
%{_libdir}/libhogweed.so.%{hogweed_so_ver_old}
|
|
|
|
%{_libdir}/libhogweed.so.%{hogweed_so_ver_old}.*
|
|
|
|
%endif
|
2018-03-09 08:59:19 +00:00
|
|
|
%if %{with fips}
|
|
|
|
%{_libdir}/.libhogweed.so.*.hmac
|
|
|
|
%{_libdir}/.libnettle.so.*.hmac
|
|
|
|
%endif
|
2012-06-18 11:00:41 +00:00
|
|
|
|
|
|
|
%files devel
|
2015-04-30 09:56:29 +00:00
|
|
|
%doc descore.README nettle.html nettle.pdf
|
2012-06-18 11:00:41 +00:00
|
|
|
%{_includedir}/nettle
|
|
|
|
%{_libdir}/libnettle.so
|
|
|
|
%{_libdir}/libhogweed.so
|
|
|
|
%{_libdir}/pkgconfig/hogweed.pc
|
|
|
|
%{_libdir}/pkgconfig/nettle.pc
|
|
|
|
|
2018-07-28 08:21:55 +00:00
|
|
|
%ldconfig_scriptlets
|
2012-06-18 11:00:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
2023-08-24 01:32:08 +00:00
|
|
|
%autochangelog
|