Update to MPFR version 4.0.2 plus patch01.

Also:
- Make mpfr3 and mpfr3-devel subpackages for version 3.1.6
- Add a -doc subpackage to hold the GFDL-licensed content
- The main package license is LGPLv3+; the GPLv3+ content is not packaged
- Drop unnecessary autoconf and libtool BRs
- Drop explicit R on gmp; it is autogenerated
- Drop info scriptlets; this version can never appear in Fedora < 32 or RHEL < 9
- Drop ldconfig_scriptlets for the same reason
- Make sure there are no rpaths and that -Wl,--as-needed takes effect
- Do not use the %%doc macro; the files have already been copied
This commit is contained in:
Jerry James 2019-10-08 14:28:34 -06:00
parent 6fea43f235
commit aaf4648ad5
5 changed files with 210 additions and 37 deletions

9
.gitignore vendored
View File

@ -1,7 +1,2 @@
/mpfr-3.1.1.tar.xz
/mpfr-3.1.2.zip
/mpfr-3.1.2.tar.xz
/mpfr-3.1.3.tar.xz
/mpfr-3.1.4.tar.xz
/mpfr-3.1.5.tar.xz
/mpfr-3.1.6.tar.xz
/mpfr-*.zip
/mpfr-*.tar.xz

5
mpfr.rpmlintrc Normal file
View File

@ -0,0 +1,5 @@
# THIS FILE IS FOR WHITELISTING RPMLINT ERRORS AND WARNINGS IN TASKOTRON
# https://fedoraproject.org/wiki/Taskotron/Tasks/dist.rpmlint#Whitelisting_errors
# Documentation is in the -doc subpackage
addFilter(r'^mpfr.?-devel\.[^:]+: W: no-documentation')

188
mpfr.spec
View File

@ -1,81 +1,209 @@
# MPFR versions 3 and 4 must exist in parallel until we can move all
# consumers to version 4.
%global mpfr3ver 3.1.6
Summary: A C library for multiple-precision floating-point computations
Name: mpfr
Version: 3.1.6
Release: 5%{?dist}
Version: 4.0.2
Release: 1%{?dist}
URL: http://www.mpfr.org/
# GFDL (mpfr.texi, mpfr.info and fdl.texi)
License: LGPLv3+ and GPLv3+ and GFDL
BuildRequires: autoconf libtool gmp-devel gcc
Requires: gmp >= 4.2.3
License: LGPLv3+
BuildRequires: gmp-devel gcc
Source0: http://www.mpfr.org/%{name}-%{version}/%{name}-%{version}.tar.xz
Source1: http://www.mpfr.org/%{name}-%{mpfr3ver}/%{name}-%{mpfr3ver}.tar.xz
## MPFR 4 patches
# https://gforge.inria.fr/scm/viewvc.php/mpfr?revision=13499&view=revision
# https://www.mpfr.org/mpfr-4.0.2/patch01
Patch0: rev13499.patch
## MPFR 3 patches
# https://gforge.inria.fr/scm/viewvc.php/mpfr?revision=11783&view=revision
# http://www.mpfr.org/mpfr-3.1.6/patch01
Patch0: rev11783.patch
Patch100: rev11783.patch
# https://gforge.inria.fr/scm/viewvc.php/mpfr?revision=11982&view=revision
# http://www.mpfr.org/mpfr-3.1.6/patch02
Patch1: rev11982.patch
Patch101: rev11982.patch
%description
The MPFR library is a C library for multiple-precision floating-point
computations with "correct rounding". The MPFR is efficient and
also has a well-defined semantics. It copies the good ideas from the
ANSI/IEEE-754 standard for double-precision floating-point arithmetic
computations with "correct rounding". The MPFR is efficient and
also has a well-defined semantics. It copies the good ideas from the
ANSI/IEEE-754 standard for double-precision floating-point arithmetic
(53-bit mantissa). MPFR is based on the GMP multiple-precision library.
%package devel
Summary: Development files for the MPFR library
Requires: %{name}%{?_isa} = %{version}-%{release}
# https://fedoraproject.org/wiki/Packaging:Scriptlets#Texinfo
%if 0%{?fedora} < 28 && 0%{?rhel} < 8
%global info_scriptlet 1
Requires(post): info
Requires(preun): info
%endif
Requires: gmp-devel
Requires: gmp-devel%{?_isa}
%description devel
Header files and documentation for using the MPFR
Header files and documentation for using the MPFR
multiple-precision floating-point library in applications.
If you want to develop applications which will use the MPFR library,
you'll need to install the mpfr-devel package. You'll also need to
install the mpfr package.
%package doc
Summary: Documentation for the MPFR library
License: GFDL
BuildArch: noarch
%description doc
Documentation for the MPFR library.
%package -n mpfr3
Version: %{mpfr3ver}
Summary: C library for multiple-precision floating point computations
%description -n mpfr3
The MPFR library is a C library for multiple-precision floating-point
computations with "correct rounding". The MPFR is efficient and
also has a well-defined semantics. It copies the good ideas from the
ANSI/IEEE-754 standard for double-precision floating-point arithmetic
(53-bit mantissa). MPFR is based on the GMP multiple-precision library.
%package -n mpfr3-devel
Version: %{mpfr3ver}
Summary: Development files for the MPFR library
Requires: mpfr3%{?_isa} = %{mpfr3ver}-%{release}
Requires: gmp-devel%{?_isa}
%description -n mpfr3-devel
Header files and documentation for using the MPFR
multiple-precision floating-point library in applications.
If you want to develop applications which will use the MPFR library,
you'll need to install the mpfr3-devel package. You'll also need to
install the mpfr3 package.
%prep
%autosetup -p1
%setup -q
%setup -q -T -D -a 1
%patch0 -p1
# Apply mpfr3 patches
cd %{name}-%{mpfr3ver}
%patch100 -p1
%patch101 -p1
cd -
%build
%configure --disable-assert --disable-static
# Get rid of undesirable hardcoded rpaths; workaround libtool reordering
# -Wl,--as-needed after all the libraries.
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
-e 's|CC="\(g..\)"|CC="\1 -Wl,--as-needed"|' \
-i libtool
%make_build
# Build mpfr3
cd %{name}-%{mpfr3ver}
%configure --disable-assert --disable-static
# Get rid of undesirable hardcoded rpaths; workaround libtool reordering
# -Wl,--as-needed after all the libraries.
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
-e 's|CC="\(g..\)"|CC="\1 -Wl,--as-needed"|' \
-i libtool
%make_build
cd -
%install
# Install mpfr3
cd %{name}-%{mpfr3ver}
%make_install
rm -f $RPM_BUILD_ROOT%{_libdir}/libmpfr.la
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -fr %{buildroot}%{_infodir}
rm %{buildroot}%{_libdir}/libmpfr.so
ln -s libmpfr.so.4 %{buildroot}%{_libdir}/libmpfr3.so
# Fix up the documentation
mv %{buildroot}%{_datadir}/doc/mpfr %{buildroot}%{_docdir}/mpfr3
cp -p PATCHES README %{buildroot}%{_docdir}/mpfr3
rm -fr %{buildroot}%{_docdir}/mpfr3/{AUTHORS,examples,FAQ.html,TODO}
# These go into licenses, not doc
rm -f %{buildroot}%{_docdir}/mpfr3/COPYING{,.LESSER}
# Stay out of the way of mpfr 4
mv %{buildroot}%{_includedir}/mpf2mpfr.h %{buildroot}%{_includedir}/mpf2mpfr3.h
mv %{buildroot}%{_includedir}/mpfr.h %{buildroot}%{_includedir}/mpfr3.h
cd -
# Install mpfr4
%make_install
cp -p PATCHES README %{buildroot}%{_pkgdocdir}
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_infodir}/dir
#these go into licenses, not doc
rm -f $RPM_BUILD_ROOT%{_pkgdocdir}/COPYING $RPM_BUILD_ROOT%{_pkgdocdir}/COPYING.LESSER
rm -f %{buildroot}%{_pkgdocdir}/COPYING{,.LESSER}
%check
make %{?_smp_mflags} check
%ldconfig_scriptlets
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
%make_build check
cd %{name}-%{mpfr3ver}
%make_build check
cd -
%files
%license COPYING COPYING.LESSER
%doc NEWS README AUTHORS BUGS TODO doc/FAQ.html
%{_libdir}/libmpfr.so.*
%{_pkgdocdir}/BUGS
%{_pkgdocdir}/NEWS
%{_pkgdocdir}/PATCHES
%{_pkgdocdir}/README
%{_libdir}/libmpfr.so.6*
%files devel
%{_pkgdocdir}/examples
%{_libdir}/libmpfr.so
%{_includedir}/*.h
%{_includedir}/mpfr.h
%{_includedir}/mpf2mpfr.h
%{_libdir}/pkgconfig/mpfr.pc
%files doc
%{_pkgdocdir}/AUTHORS
%{_pkgdocdir}/examples
%{_pkgdocdir}/FAQ.html
%{_pkgdocdir}/TODO
%{_infodir}/mpfr.info*
%files -n mpfr3
%license COPYING COPYING.LESSER
%{_docdir}/mpfr3/BUGS
%{_docdir}/mpfr3/NEWS
%{_docdir}/mpfr3/PATCHES
%{_docdir}/mpfr3/README
%{_libdir}/libmpfr.so.4*
%files -n mpfr3-devel
%{_libdir}/libmpfr3.so
%{_includedir}/mpfr3.h
%{_includedir}/mpf2mpfr3.h
%changelog
* Tue Oct 8 2019 Jerry James <loganjerry@gmail.com> - 4.0.2-1
- Update to MPFR version 4.0.2 plus patch01
- Make mpfr3 and mpfr3-devel subpackages for version 3.1.6
- Add a -doc subpackage to hold the GFDL-licensed content
- The main package license is LGPLv3+; the GPLv3+ content is not packaged
- Drop unnecessary autoconf and libtool BRs
- Drop explicit R on gmp; it is autogenerated
- Drop info scriptlets; this version can never appear in Fedora < 32 or RHEL < 9
- Drop ldconfig_scriptlets for the same reason
- Make sure there are no rpaths and that -Wl,--as-needed takes effect
- Do not use the %%doc macro; the files have already been copied
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

44
rev13499.patch Normal file
View File

@ -0,0 +1,44 @@
diff -Naurd mpfr-4.0.2-a/PATCHES mpfr-4.0.2-b/PATCHES
--- mpfr-4.0.2-a/PATCHES 2019-06-02 17:05:36.121226916 +0000
+++ mpfr-4.0.2-b/PATCHES 2019-06-02 17:05:36.157226621 +0000
@@ -0,0 +1 @@
+include-float
diff -Naurd mpfr-4.0.2-a/VERSION mpfr-4.0.2-b/VERSION
--- mpfr-4.0.2-a/VERSION 2019-01-31 20:29:48.000000000 +0000
+++ mpfr-4.0.2-b/VERSION 2019-06-02 17:05:36.157226621 +0000
@@ -1 +1 @@
-4.0.2
+4.0.2-p1
diff -Naurd mpfr-4.0.2-a/src/mpfr-impl.h mpfr-4.0.2-b/src/mpfr-impl.h
--- mpfr-4.0.2-a/src/mpfr-impl.h 2019-01-27 18:30:16.000000000 +0000
+++ mpfr-4.0.2-b/src/mpfr-impl.h 2019-06-02 17:05:36.145226719 +0000
@@ -57,6 +57,7 @@
#include <stdlib.h>
#include <limits.h>
+#include <float.h> /* for FLT_RADIX, etc., tested below */
/******************************************************
diff -Naurd mpfr-4.0.2-a/src/mpfr.h mpfr-4.0.2-b/src/mpfr.h
--- mpfr-4.0.2-a/src/mpfr.h 2019-01-31 20:29:48.000000000 +0000
+++ mpfr-4.0.2-b/src/mpfr.h 2019-06-02 17:05:36.153226653 +0000
@@ -27,7 +27,7 @@
#define MPFR_VERSION_MAJOR 4
#define MPFR_VERSION_MINOR 0
#define MPFR_VERSION_PATCHLEVEL 2
-#define MPFR_VERSION_STRING "4.0.2"
+#define MPFR_VERSION_STRING "4.0.2-p1"
/* User macros:
MPFR_USE_FILE: Define it to make MPFR define functions dealing
diff -Naurd mpfr-4.0.2-a/src/version.c mpfr-4.0.2-b/src/version.c
--- mpfr-4.0.2-a/src/version.c 2019-01-31 20:29:48.000000000 +0000
+++ mpfr-4.0.2-b/src/version.c 2019-06-02 17:05:36.153226653 +0000
@@ -25,5 +25,5 @@
const char *
mpfr_get_version (void)
{
- return "4.0.2";
+ return "4.0.2-p1";
}

View File

@ -1 +1,2 @@
SHA512 (mpfr-3.1.6.tar.xz) = 746ee74d5026f267f74ab352d850ed30ff627d530aa840c71b24793e44875f8503946bd7399905dea2b2dd5744326254d7889337fe94cfe58d03c4066e9d8054
SHA512 (mpfr-4.0.2.tar.xz) = d583555d08863bf36c89b289ae26bae353d9a31f08ee3894520992d2c26e5683c4c9c193d7ad139632f71c0a476d85ea76182702a98bf08dde7b6f65a54f8b88