File libmpfr.spec of Package libmpfr

%define realname mpfr
%define realver  4.0.2
%define srcext   tar.xz

%define so_ver   6

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          libmpfr%{?so_ver}
Version:       %{realver}
Release:       wiz%{?extraver:0.}1%{?dist}
License:       LGPL-3.0+
Group:         System/Libraries
Summary:       The GNU multiple-precision floating-point library

# Install-time parameters
Provides:      %{realname} = %{version}-%{release}

# Build-time parameters
BuildRequires: pkg-config
BuildRequires: xz
BuildRequires: gmp-devel >= 5.0.0
BuildRoot:     %{_tmppath}/%{name}-root
Source999:     baselibs.conf

The MPFR library is a C library for multiple-precision floating-point
computations with correct rounding. MPFR has continuously been supported by the
INRIA and the current main authors come from the Caramba and AriC project-teams
at Loria (Nancy, France) and LIP (Lyon, France) respectively; see more on the
credit page. MPFR is based on the GMP multiple-precision library.

The main goal of MPFR is to provide a library for multiple-precision
floating-point computation which is both efficient and has a well-defined
semantics. It copies the good ideas from the ANSI/IEEE-754 standard for
double-precision floating-point arithmetic (53-bit significand).

%package -n mpfr-devel
Group:         Development/Languages/C and C++
Summary:       Development files for %{name}
Requires:      %{name} = %{version}-%{release}
Provides:      %{name}-devel = %{version}-%{release}
Provides:      lib%{realname}-devel = %{version}-%{release}

%description -n mpfr-devel
Development files for %{name}

# Preparation step (unpackung and patching if necessary)
%setup -q -n %{realname}-%{realver}%{?extraver}

%configure \
 --disable-static \
 --enable-shared-cache \
 CFLAGS="%{optflags}" \
 LDFLAGS="-Wl,--as-needed -Wl,--strip-all"
%{__make} %{?_smp_mflags}

%{__make} install DESTDIR=%{buildroot}
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}%{_datadir}/doc

[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}


# Development stuff
%files -n mpfr-devel
%exclude %{_libdir}/*.la
%doc %{_infodir}/*
%exclude %{_infodir}/dir

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

%post -n mpfr-devel
/sbin/install-info %{_infodir}/* %{_infodir}/dir || :

%preun -n mpfr-devel
if [ ${1} -eq 0 ]; then
  /sbin/install-info --delete %{_infodir}/* %{_infodir}/dir || :