#
# spec file for package mpc
#
# Copyright (c) 2014 SUSE LINUX Products 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:           mpc
BuildRequires:  gmp-devel
BuildRequires:  mpfr-devel
Version:        1.0.2
Release:        38.2
Summary:        MPC multiple-precision complex shared library
License:        LGPL-3.0+
Group:          Development/Libraries/C and C++
Url:            http://www.multiprecision.org/mpc/
Source:         http://www.multiprecision.org/mpc/download/mpc-%{version}.tar.gz
Source2:        baselibs.conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
MPC is a C library for the arithmetic of complex numbers with
arbitrarily high precision and correct rounding of the result. It is
built upon and follows the same principles as MPFR.



%package -n libmpc3
Summary:        MPC multiple-precision complex shared library
Group:          Development/Libraries/C and C++

%description -n libmpc3
MPC is a C library for the arithmetic of complex numbers with
arbitrarily high precision and correct rounding of the result. It is
built upon and follows the same principles as MPFR.



%package devel
Summary:        MPC multiple-precision complex library development files
Group:          Development/Libraries/C and C++
Requires:       libmpc3 = %{version}
Requires:       mpfr-devel
PreReq:         %install_info_prereq

%description devel
MPC multiple-precision complex library development files.



%prep
%setup -q

%build
%configure
make %{?_smp_mflags}

%check
make check %{?_smp_mflags}

%install
%makeinstall
rm $RPM_BUILD_ROOT%{_libdir}/libmpc.la

%post -n libmpc3 -p /sbin/ldconfig

%post devel
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%postun -n libmpc3 -p /sbin/ldconfig

%postun devel
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%files -n libmpc3
%defattr(-,root,root)
%{_libdir}/libmpc.so.3*

%files devel
%defattr(-,root,root)
%doc AUTHORS NEWS COPYING.LESSER
%doc %{_infodir}/mpc.info.gz
%{_libdir}/libmpc.a
%{_libdir}/libmpc.so
/usr/include/mpc.h

%changelog
* Thu Jan 16 2014 rguenther@suse.com
- Update to version 1.0.2.
  - Fixed mpc_atan, mpc_atanh for (+-0, +-1)
  - Fixed mpc_log10 for purely imaginary argument
  - Fixed case of intermediate zero real or imaginary part in mpc_fma
* Tue Apr 16 2013 idonmez@suse.com
- Add Source URL, see https://en.opensuse.org/SourceUrls
* Mon Jul 23 2012 jengelh@inai.de
- Correct Requires of libmpc-devel to be libmpc3 rather than libmpc2
* Mon Jul 23 2012 rguenther@suse.com
- Update to version 1.0.
  - Bump SONAME to libmpc3
  - License change: LGPLv3+ for code, GFDLv1.3+ (with no invariant sections)
    for documentation
  - Functions renamed:
    mpc_mul_2exp to mpc_mul_2ui, mpc_div_2exp to mpc_div_2ui
  - New functions: mpc_log10, mpc_mul_2si, mpc_div_2si
  - Speed-ups:
  - mpc_fma
  - Bug fixes:
  - mpc_div and mpc_norm now return a value indicating the effective
    rounding direction, as the other functions
  - mpc_mul, mpc_sqr and mpc_norm now return correct results even if there
    are over- or underflows during the computation
  - mpc_asin, mpc_proj, mpc_sqr: Wrong result when input variable has
    infinite part and equals output variable is corrected
  - mpc_fr_sub: Wrong return value for imaginary part is corrected
- Skips version 0.9:
  - New functions:
  - mpc_set_dc, mpc_set_ldc, mpc_get_dc, mpc_get_ldc for converting
    between mpc type variables and C variables of type double _Complex
    or long double _Complex
  - mpc_sin_cos, computing simultaneously the sine and cosine
  - Speed-ups:
  - mpc_pow_si through binary exponentiation
  - mpc_pow_z when the exponent fits in a long
  - mpc_tan through the use of mpc_sin_cos
  - Bug fixes:
  - trigonometric functions: infinite loop due to overflow for large
    arguments
  - mpc_exp: close to infinite loop for argument close to 0
  - mpc_sqrt: close to infinite loop for argument close to 1
  - mpc_add_si: replaced macro by function, since the macro evaluated the
    same expression twice
* Sun Jan 29 2012 jengelh@medozas.de
- Remove redundant tags/sections per specfile guideline suggestions
* Mon Sep  6 2010 rguenther@novell.com
- Update to version 0.8.2.
  * Speed-up of mpc_pow_ui through binary exponentiation.
* Thu Jul  1 2010 rguenther@novell.com
- really fix baselibs for mpc-devel.
* Thu Jul  1 2010 rguenther@novell.com
- fix baselibs for mpc-devel.
* Mon Jun 28 2010 jengelh@medozas.de
- use %%_smp_mflags
* Mon Feb  1 2010 jengelh@medozas.de
- Package baselibs.conf
* Mon Jan 11 2010 rguenther@suse.de
- Update to bugfix release 0.8.1.
  Fixes
  * acosh, asinh, atanh: swap of precisions between real and imaginary parts
  * atan: memory leak
  * log: wrong ternary value in data file; masked by bug in mpfr 2.4.1
* Tue Dec  1 2009 rguenther@suse.de
- Fix erroneous test data.
* Thu Nov  5 2009 rguenther@suse.de
- Update to version 0.8 as required by GCC 4.5.
  * C99 feature completion:
  - Inverse trigonometric functions: mpc_asin, mpc_acos, mpc_atan,
    mpc_asinh, mpc_acosh, mpc_atanh
  - Power functions: mpc_pow_d, mpc_pow_ld, mpc_pow_si, mpc_pow_ui,
    mpc_pow_z, mpc_pow_fr
* Fri Sep 11 2009 rguenther@suse.de
- Update to version 0.7.  [fate#306970]
  * Bumps SONAME to libmpc.so.2.
* Mon Jul 13 2009 rguenther@suse.de
- Re-add static library.
- Adjust baselibs.conf for new SO version.
* Mon Jun  8 2009 crrodriguez@suse.de
- remove static libraries
* Tue May 19 2009 rguenther@suse.de
- Add patch to fix testsuite failures with -D_FORTIFY_SOURCE=2.
- Fix shlib package name.
* Wed Apr  1 2009 rguenther@suse.de
- Update to MPC version 0.6.
* Sun Mar 15 2009 rguenther@suse.de
- Initial packaging of MPC version 0.5.2.