File libsecp256k1.spec of Package libsecp256k1

#
# spec file for package libsecp256k1
#
# Copyright (c) 2015 Peter Conrad
#
# 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 http://bugs.opensuse.org/

%define	GIT_SHA 729badff148a00aebedce663e4ebb5a039170d9b

Summary:	Optimized code for EC operations on secp256k1
Name:		libsecp256k1
Version:	0
Release:	3
License:	MIT
Group:		Development/Libraries/C and C++
URL:		https://github.com/bitcoin/secp256k1
Source:		https://github.com/bitcoin/secp256k1/archive/%{GIT_SHA}.tar.gz
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires:	autoconf automake libtool pkg-config
BuildRequires:	libopenssl-devel
%if 0%{?suse_version} > 1200 || 0%{?suse_version} == 0
BuildRequires:	gmp-devel
%endif

%description
Optimized C library for EC operations on curve secp256k1.

This library is a work in progress and is being used to research best
practices. Use at your own risk.

Features:

* secp256k1 ECDSA signing/verification and key generation.
* Adding/multiplying private/public keys.
* Serialization/parsing of private keys, public keys, signatures.
* Constant time, constant memory access signing and pubkey generation.
* Derandomized DSA (via RFC6979 or with a caller provided function.)
* Very efficient implementation.

%package -n libsecp256k1-0
Summary:	Optimized code for EC operations on secp256k1
Group:		Development/Libraries/C and C++

%description -n libsecp256k1-0
Optimized C library for EC operations on curve secp256k1.

This library is a work in progress and is being used to research best
practices. Use at your own risk.

This package contains the dynamic runtime library.

%package devel
Summary:	Development files for libsecp256k1
Group:		Development/Libraries/C and C++
Requires:	libsecp256k1-0 = %{version}
%if 0%{?suse_version} > 1200 || 0%{?suse_version} == 0
Requires:	gmp-devel
%endif

%description devel
Optimized C library for EC operations on curve secp256k1.

This library is a work in progress and is being used to research best
practices. Use at your own risk.

This package contains the C header files.

%prep
%setup -n secp256k1-%{GIT_SHA}

%build
./autogen.sh
%configure --enable-static=false

%install
make DESTDIR="%{buildroot}" install
%__rm -f "%{buildroot}%{_libdir}/libsecp256k1.la"
%__debug_install_post

%post -n libsecp256k1-0 -p /sbin/ldconfig

%postun -n libsecp256k1-0 -p /sbin/ldconfig

%clean
[ "%{buildroot}" = "/" ] || rm -rf "%{buildroot}"

%files -n libsecp256k1-0
%defattr(-,root,root,-)
%doc COPYING README.md TODO
%{_libdir}/libsecp256k1.so.0
%{_libdir}/libsecp256k1.so.0.0.0

%files devel
%defattr(-,root,root,-)
%doc COPYING README.md TODO
%{_prefix}/include/secp256k1.h
%{_libdir}/libsecp256k1.so
%{_libdir}/pkgconfig/libsecp256k1.pc

%changelog
openSUSE Build Service is sponsored by