File libdashbls.spec of Package libdashbls
#
# spec file for package libdashbls
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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/
#
Name: libdashbls
Version: 1.3.6
Release: 0
Summary: C++ Library for BLS signatures
License: Apache-2.0
Group: System/Libraries
URL: https://github.com/dashpay/bls-signatures/
Source0: %{name}-%{version}.tar.xz
Source1: %{name}-rpmlintrc
BuildRequires: cmake >= 3.14
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gmp-devel
BuildRequires: libsodium-devel
%define description_text This library implements BLS signatures with aggregation using relic toolkit for cryptographic primitives (pairings, EC, hashing) according to the IETF BLS RFC with these curve parameters for BLS12-381.
%description
%{description_text}
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
BuildArch: noarch
%description devel
%{description_text}
The %{name}-devel package contains libraries and header files for developing applications that use %{name}.
%package devel-static
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: %{name}-devel = %{version}
%description devel-static
%{description_text}
This package provides static libraries for %{name}.
%prep
%setup -q
%build
%ifarch i586
%define ___cmake_opt -DWSIZE=32
%endif
%cmake -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DEMSCRIPTEN=OFF -DBUILD_BLS_PYTHON_BINDINGS=OFF -DBUILD_BLS_TESTS=OFF -DBUILD_BLS_BENCHMARKS=OFF -DCMAKE_BUILD_TYPE=Release %{?___cmake_opt}
%cmake_build
%install
%cmake_install
%if "%{?_lib}" == "lib64"
%{__mv} %{buildroot}%{_usr}/lib/* %{buildroot}%{_libdir}
%{_bindir}/rmdir %{buildroot}%{_usr}/lib
%endif
%fdupes %{buildroot}%{_includedir}
%{__rm} -fr %{buildroot}%{_usr}/cmake
%{__rm} -fr %{buildroot}%{_includedir}/mimalloc-2.0
%{__rm} -fr %{buildroot}%{_libdir}/cmake
%{__rm} -fr %{buildroot}%{_libdir}/mimalloc-2.0
%{__rm} -fr %{buildroot}%{_libdir}/pkgconfig
%check
%ctest
%files devel
%defattr(-,root,root,-)
%{_includedir}/dashbls
%{_includedir}/relic
%doc README.md
%license LICENSE
%files devel-static
%defattr(-,root,root,-)
%attr(644,root,root) %{_libdir}/*.a
%changelog