Accepting request 410591 from devel:languages:haskell:lts:6
See https://lists.opensuse.org/opensuse-haskell/2016-07/msg00000.html for details. OBS-URL: https://build.opensuse.org/request/show/410591 OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc-scientific?expand=0&rev=22
This commit is contained in:
parent
6689c14a6e
commit
fbb4827f88
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Jul 10 16:58:33 UTC 2016 - psimons@suse.com
|
||||||
|
|
||||||
|
- Update to version 0.3.4.8 revision 0 with cabal2obs.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Jul 3 12:33:17 UTC 2016 - mimi.vx@gmail.com
|
Sun Jul 3 12:33:17 UTC 2016 - mimi.vx@gmail.com
|
||||||
|
|
||||||
|
@ -17,66 +17,108 @@
|
|||||||
|
|
||||||
|
|
||||||
%global pkg_name scientific
|
%global pkg_name scientific
|
||||||
|
%bcond_with tests
|
||||||
Name: ghc-scientific
|
Name: ghc-%{pkg_name}
|
||||||
Version: 0.3.4.8
|
Version: 0.3.4.8
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Numbers represented using scientific notation
|
Summary: Numbers represented using scientific notation
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
|
Url: https://hackage.haskell.org/package/%{pkg_name}
|
||||||
Url: http://hackage.haskell.org/package/%{pkg_name}
|
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
|
||||||
Source0: http://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
||||||
|
|
||||||
BuildRequires: fdupes
|
|
||||||
BuildRequires: ghc-Cabal-devel
|
BuildRequires: ghc-Cabal-devel
|
||||||
BuildRequires: ghc-array-devel
|
# Begin cabal-rpm deps:
|
||||||
|
BuildRequires: ghc-binary-devel
|
||||||
|
BuildRequires: ghc-bytestring-devel
|
||||||
|
BuildRequires: ghc-containers-devel
|
||||||
BuildRequires: ghc-deepseq-devel
|
BuildRequires: ghc-deepseq-devel
|
||||||
BuildRequires: ghc-hashable-devel
|
BuildRequires: ghc-hashable-devel
|
||||||
BuildRequires: ghc-rpm-macros
|
BuildRequires: ghc-rpm-macros
|
||||||
BuildRequires: ghc-text-devel
|
BuildRequires: ghc-text-devel
|
||||||
BuildRequires: ghc-vector-devel
|
BuildRequires: ghc-vector-devel
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
%if %{with tests}
|
||||||
|
BuildRequires: ghc-QuickCheck-devel
|
||||||
|
BuildRequires: ghc-smallcheck-devel
|
||||||
|
BuildRequires: ghc-tasty-ant-xml-devel
|
||||||
|
BuildRequires: ghc-tasty-devel
|
||||||
|
BuildRequires: ghc-tasty-hunit-devel
|
||||||
|
BuildRequires: ghc-tasty-quickcheck-devel
|
||||||
|
BuildRequires: ghc-tasty-smallcheck-devel
|
||||||
|
%endif
|
||||||
|
# End cabal-rpm deps
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Data.Scientific provides a space efficient and arbitrary precision scientific
|
'Data.Scientific' provides the number type 'Scientific'. Scientific numbers are
|
||||||
number type.
|
arbitrary precision and space efficient. They are represented using
|
||||||
|
<http://en.wikipedia.org/wiki/Scientific_notation scientific notation>.
|
||||||
|
The implementation uses a coefficient 'c :: 'Integer'' and a base-10 exponent
|
||||||
|
'e :: 'Int''. A scientific number corresponds to the 'Fractional' number:
|
||||||
|
''fromInteger' c * 10 '^^' e'.
|
||||||
|
|
||||||
This package provides the Haskell %{pkg_name} libraries.
|
Note that since we're using an 'Int' to represent the exponent these numbers
|
||||||
|
aren't truly arbitrary precision. I intend to change the type of the exponent
|
||||||
|
to 'Integer' in a future release.
|
||||||
|
|
||||||
%package -n ghc-%{pkg_name}-devel
|
The main application of 'Scientific' is to be used as the target of parsing
|
||||||
|
arbitrary precision numbers coming from an untrusted source. The advantages
|
||||||
|
over using 'Rational' for this are that:
|
||||||
|
|
||||||
|
* A 'Scientific' is more efficient to construct. Rational numbers need to be
|
||||||
|
constructed using '%' which has to compute the 'gcd' of the 'numerator' and
|
||||||
|
'denominator'.
|
||||||
|
|
||||||
|
* 'Scientific' is safe against numbers with huge exponents. For example:
|
||||||
|
'1e1000000000 :: 'Rational'' will fill up all space and crash your program.
|
||||||
|
Scientific works as expected:
|
||||||
|
|
||||||
|
> > read "1e1000000000" :: Scientific > 1.0e1000000000
|
||||||
|
|
||||||
|
* Also, the space usage of converting scientific numbers with huge exponents to
|
||||||
|
''Integral's' (like: 'Int') or ''RealFloat's' (like: 'Double' or 'Float') will
|
||||||
|
always be bounded by the target type.
|
||||||
|
|
||||||
|
%package devel
|
||||||
Summary: Haskell %{pkg_name} library development files
|
Summary: Haskell %{pkg_name} library development files
|
||||||
Group: Development/Libraries/Other
|
Group: Development/Libraries/Other
|
||||||
Provides: %{name}-static = %{version}-%{release}
|
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name} = %{version}-%{release}
|
||||||
Requires: ghc-compiler = %{ghc_version}
|
Requires: ghc-compiler = %{ghc_version}
|
||||||
|
Requires(post): ghc-compiler = %{ghc_version}
|
||||||
|
Requires(postun): ghc-compiler = %{ghc_version}
|
||||||
|
|
||||||
%description -n ghc-%{pkg_name}-devel
|
%description devel
|
||||||
Data.Scientific provides a space efficient and arbitrary precision scientific
|
|
||||||
number type.
|
|
||||||
|
|
||||||
This package provides the Haskell %{pkg_name} library development files.
|
This package provides the Haskell %{pkg_name} library development files.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{pkg_name}-%{version}
|
%setup -q -n %{pkg_name}-%{version}
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%ghc_lib_build
|
%ghc_lib_build
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%ghc_lib_install
|
%ghc_lib_install
|
||||||
|
|
||||||
%post -n ghc-%{pkg_name}-devel
|
|
||||||
|
%check
|
||||||
|
%if %{with tests}
|
||||||
|
%{cabal} test
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
%post devel
|
||||||
%ghc_pkg_recache
|
%ghc_pkg_recache
|
||||||
|
|
||||||
%postun -n ghc-%{pkg_name}-devel
|
%postun devel
|
||||||
%ghc_pkg_recache
|
%ghc_pkg_recache
|
||||||
|
|
||||||
%files -f ghc-%{pkg_name}.files
|
%files -f %{name}.files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root,-)
|
||||||
%doc LICENSE
|
%doc LICENSE
|
||||||
|
|
||||||
%files -n ghc-%{pkg_name}-devel -f ghc-%{pkg_name}-devel.files
|
%files devel -f %{name}-devel.files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
|
%doc changelog
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user