File lib25519.spec of Package lib25519

#
# spec file for package lib25519
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%define sover 1
Name:           lib25519
Version:        20241004
Release:        0
Summary:        A microlibrary for the X25519 encryption and Ed25519 signature systems
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License:        MIT
Group:          Development/Libraries/C and C++
URL:            https://lib25519.cr.yp.to/
Source:         https://lib25519.cr.yp.to/lib25519-%{version}.tar.gz
# PATCH-FIX-SUSE: Ignore not recognized configure arguments and fix installation paths
Patch1:         fix-configure.patch
# PATCH-FIX-SUSE: Change shebang interpreter
Patch2:         python3-env-interpret.patch
BuildRequires:  gcc
BuildRequires:  python3
BuildRequires:  valgrind-devel
BuildRequires:  libcpucycles-devel
BuildRequires:  librandombytes-devel

%description
lib25519 is a microlibrary for the X25519 encryption system and the Ed25519 signature system, both of which use the Curve25519 elliptic curve. 
Curve25519 is the fastest curve in TLS 1.3, and the only curve in Wireguard, Signal, and many other applications.

%package -n lib25519%{sover}
Summary:        A microlibrary for the X25519 encryption and Ed25519 signature systems
Group:          Development/Libraries/C and C++

%description  -n lib25519%{sover}
lib25519 is a microlibrary for the X25519 encryption system and the Ed25519 signature system, both of which use the Curve25519 elliptic curve. 
Curve25519 is the fastest curve in TLS 1.3, and the only curve in Wireguard, Signal, and many other applications.

%package devel
Summary:        Development files for lib25519 library
Group:          Development/Languages/C and C++
Requires:       lib25519%{sover} = %{version}

%description devel
Development files for lib25519 - a microlibrary for the X25519 encryption system and the Ed25519 signature system, both of which use the Curve25519 elliptic curve. 
Curve25519 is the fastest curve in TLS 1.3, and the only curve in Wireguard, Signal, and many other applications.

%package tools
Summary:        Cli tools from lib25519
Group:          Development/Languages/C and C++
Requires:       lib25519%{sover} = %{version}

%description tools
Cli tools from lib25519 - a microlibrary for the X25519 encryption system and the Ed25519 signature system.

%package doc
Summary:        Documentation for lib25519
Group:          Development/Languages/C and C++
Requires:       lib25519%{sover} = %{version}
BuildArch:		noarch

%description doc
Documentation files for lib25519 - a microlibrary for the X25519 encryption system and the Ed25519 signature system, both of which use the Curve25519 elliptic curve. 
Curve25519 is the fastest curve in TLS 1.3, and the only curve in Wireguard, Signal, and many other applications.

%prep
%autosetup -p1

%build
%configure
%make_build

%install
%make_install
chmod +x %{buildroot}%{_libdir}/lib25519.so.%{sover}

%check

%post -n lib25519%{sover} -p /sbin/ldconfig
%postun -n lib25519%{sover} -p /sbin/ldconfig

%files -n lib25519%{sover}
%{_libdir}/lib25519.so.1
%license doc/license.md
%{_mandir}/man1/ed25519.1%{?ext_man}
%{_mandir}/man1/x25519.1%{?ext_man}
%{_mandir}/man3/lib25519.3.gz
%{_mandir}/man3/lib25519_dh.3.gz
%{_mandir}/man3/lib25519_dh_keypair.3.gz
%{_mandir}/man3/lib25519_sign.3%{?ext_man}
%{_mandir}/man3/lib25519_sign_keypair.3.gz
%{_mandir}/man3/lib25519_sign_open.3.gz

%files devel
%{_includedir}/lib25519.h
%{_libdir}/lib25519.so

%files tools
# Signing?
%{_bindir}/ed25519-keypair
%{_bindir}/ed25519-open
%{_bindir}/ed25519-sign
%{_mandir}/man1/x25519-cli.1%{?ext_man}
%{_mandir}/man1/ed25519-cli.1%{?ext_man}
%{_mandir}/man1/ed25519-keypair.1%{?ext_man}
%{_mandir}/man1/ed25519-open.1%{?ext_man}
%{_mandir}/man1/ed25519-sign.1%{?ext_man}
# For testing?
%{_bindir}/lib25519-fulltest
%{_bindir}/lib25519-speed
%{_bindir}/lib25519-test
%{_mandir}/man1/lib25519-fulltest.1%{?ext_man}
%{_mandir}/man1/lib25519-speed.1%{?ext_man}
%{_mandir}/man1/lib25519-test.1%{?ext_man}
# Key exchange?
%{_bindir}/x25519-dh
%{_bindir}/x25519-keypair
%{_mandir}/man1/x25519-dh.1%{?ext_man}
%{_mandir}/man1/x25519-keypair.1%{?ext_man}


%files doc


%changelog

openSUSE Build Service is sponsored by