File libgmp.spec of Package libgmp
%define realname gmp
%define realver 6.3.0
%define srcext tar.xz
%bcond_without cxx
%define so_ver 10
%define so_ver_xx 4
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: libgmp%{?so_ver}
Version: %{realver}
Release: wiz%{?extraver:0.}1%{?dist}
License: GPL-2.0 or LGPL-3.0
Group: System/Libraries
URL: https://gmplib.org/
Summary: The GNU Multiple Precision Arithmetic Library
# Install-time parameters
Provides: %{realname} = %{version}-%{release}
# Build-time parameters
BuildRequires: xz
BuildRequires: pkg-config
BuildRequires: m4
%if 0%{with cxx}
BuildRequires: gcc-c++
%endif
BuildRoot: %{_tmppath}/%{name}-root
Source0: https://gmplib.org/download/gmp/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
GMP is a free library for arbitrary precision arithmetic, operating on signed
integers, rational numbers, and floating-point numbers. There is no practical
limit to the precision except the ones implied by the available memory in the
machine GMP runs on. GMP has a rich set of functions, and the functions have
a regular interface.
The main target applications for GMP are cryptography applications and research,
Internet security applications, algebra systems, computational algebra
research, etc.
GMP is carefully designed to be as fast as possible, both for small operands and
for huge operands. The speed is achieved by using fullwords as the basic
arithmetic type, by using fast algorithms, with highly optimised assembly code
for the most common inner loops for a lot of CPUs, and by a general emphasis
on speed.
%if 0%{with cxx}
%package -n libgmpxx%{so_ver_xx}
Group: System/Libraries
Summary: C++ support fot The GNU Multiple Precision Arithmetic Library
%description -n libgmpxx%{so_ver_xx}
GMP is a free library for arbitrary precision arithmetic, operating on signed
integers, rational numbers, and floating-point numbers. There is no practical
limit to the precision except the ones implied by the available memory in the
machine GMP runs on. GMP has a rich set of functions, and the functions have
a regular interface.
The main target applications for GMP are cryptography applications and research,
Internet security applications, algebra systems, computational algebra
research, etc.
GMP is carefully designed to be as fast as possible, both for small operands and
for huge operands. The speed is achieved by using fullwords as the basic
arithmetic type, by using fast algorithms, with highly optimised assembly code
for the most common inner loops for a lot of CPUs, and by a general emphasis
on speed.
This package contains C++ shared library.
%endif
%package -n gmp-devel
Group: Development/Languages/C and C++
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}
Provides: %{name}-devel = %{version}-%{release}
Provides: libgmp-devel = %{version}-%{release}
%if 0%{with cxx}
Requires: libgmpxx%{so_ver_xx} = %{version}-%{release}
Provides: libgmpxx%{so_ver_xx}-devel = %{version}-%{release}
%endif
%description -n gmp-devel
Development files for %{name}
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
%configure \
--disable-static \
%if 0%{with cxx}
--enable-cxx \
%endif
CFLAGS="$_CFLAGS" \
CXXFLAGS="$_CFLAGS" \
LDFLAGS="$_LDFLAGS"
%{__make} %{?_smp_mflags}
%check
%{__make} %{?_smp_mflags} check \
CFLAGS="$_CFLAGS" \
CXXFLAGS="$_CFLAGS" \
LDFLAGS="$_LDFLAGS"
%install
%{__make} install DESTDIR=%{buildroot}
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%license COPYING*
%doc AUTHORS NEWS README
%{_libdir}/libgmp.so.%{?so_ver}*
# Development stuff
%files -n gmp-devel
%defattr(-,root,root)
%{_includedir}/*.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%exclude %{_libdir}/*.la
%doc %{_infodir}/*
%exclude %{_infodir}/dir
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%if 0%{with cxx}
%files -n libgmpxx%{so_ver_xx}
%license COPYING*
%doc AUTHORS NEWS README
%{_libdir}/libgmpxx.so.%{?so_ver_xx}*
%post -n libgmpxx%{so_ver_xx} -p /sbin/ldconfig
%postun -n libgmpxx%{so_ver_xx} -p /sbin/ldconfig
%endif
%post -n gmp-devel
/sbin/install-info %{_infodir}/gmp.info* %{_infodir}/dir || :
%preun -n gmp-devel
if [ ${1} -eq 0 ]; then
/sbin/install-info --delete %{_infodir}/gmp.info* %{_infodir}/dir || :
fi
%changelog