File ntl.spec of Package ntl

#
# spec file for package ntl
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#


Name:           ntl
%define lname	libntl15
Version:        9.2.0
Release:        0
Summary:        Library for Number Theory
License:        GPL-2.0+
Group:          Productivity/Scientific/Math
Url:            http://shoup.net/ntl/

Source:         http://shoup.net/ntl/ntl-%version.tar.gz
Patch1:         ntl-automake.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  gf2x-devel
BuildRequires:  gmp-devel >= 3.1
BuildRequires:  libtool

%description
NTL is a high-performance, portable C++ library providing data
structures and algorithms for manipulating signed, arbitrary length
integers, and for vectors, matrices, and polynomials over the
integers and over finite fields.

%package -n %lname
Summary:        Library for Number Theory
Group:          System/Libraries

%description -n %lname
NTL is a high-performance, portable C++ library providing data
structures and algorithms for manipulating signed, arbitrary length
integers, and for vectors, matrices, and polynomials over the
integers and over finite fields.

%package devel
Summary:        Development files for libntl
Group:          Development/Libraries/C and C++
Requires:       %lname = %version

%description devel
NTL is a high-performance, portable C++ library providing data
structures and algorithms for manipulating signed, arbitrary length
integers, and for vectors, matrices, and polynomials over the
integers and over finite fields.

This package contains the headers and library links to libntl.

%prep
%setup -qn ntl-%version
%patch -P 1 -p1
pushd src/;
for i in *.c; do
	mv "$i" "${i%.c}.cpp";
done;
rm -f makefile;
popd;

%build
mkdir -p m4;
autoreconf -fi;
%configure --disable-static
make %{?_smp_mflags}
# Ensure we have all source files in Makefile.am
if ldd -r src/.libs/libntl.so | grep undefined; then
	exit 1
fi

%install
%make_install
rm -f "%buildroot/%_libdir"/*.la

%post   -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig

%files -n %lname
%defattr(-,root,root)
%_libdir/libntl.so.15*

%files devel
%defattr(-,root,root)
%_includedir/NTL
%_libdir/libntl.so
%doc doc/*

%changelog