ocaml-num/ocaml-num.spec

98 lines
2.4 KiB
RPMSpec
Raw Normal View History

2017-11-08 12:40:42 +00:00
Name: ocaml-num
Version: 1.1
Release: 3%{?dist}
2017-11-08 12:40:42 +00:00
Summary: Legacy Num library for arbitrary-precision integer and rational arithmetic
License: LGPLv2+ with exceptions
URL: https://github.com/ocaml/num
Source0: https://github.com/ocaml/num/archive/v%{version}/%{name}-%{version}.tar.gz
# Downstream patch to make DESTDIR installs work.
Patch1: 0001-install-Use-DESTDIR.patch
# Downstream patches to add -g flag.
Patch2: 0002-toplevel-Add-g-flag.patch
Patch3: 0003-src-Add-g-flag-to-mklib.patch
2017-11-08 12:40:42 +00:00
BuildRequires: ocaml
BuildRequires: ocaml-findlib-devel
%description
This library implements arbitrary-precision arithmetic on big integers
and on rationals.
This is a legacy library. It used to be part of the core OCaml
distribution (in otherlibs/num) but is now distributed separately. New
applications that need arbitrary-precision arithmetic should use the
Zarith library (https://github.com/ocaml/Zarith) instead of the Num
library, and older applications that already use Num are encouraged to
switch to Zarith. Zarith delivers much better performance than Num and
has a nicer API.
%package devel
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%prep
%setup -q -n num-%{version}
%autopatch -p1
2017-11-08 12:40:42 +00:00
%build
make %{?_smp_mflags} all
%check
make -j1 test
%install
export DESTDIR=$RPM_BUILD_ROOT
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR
mkdir -p $OCAMLFIND_DESTDIR/stublibs
2017-11-08 12:40:42 +00:00
make install
find $OCAMLFIND_DESTDIR -name '*.cmti' -delete
2017-11-08 12:40:42 +00:00
%files
%doc Changelog README.md
%license LICENSE
%{_libdir}/ocaml/*.cmi
%{_libdir}/ocaml/*.cma
%{_libdir}/ocaml/*.cmxs
%{_libdir}/ocaml/num
%{_libdir}/ocaml/num-top
%{_libdir}/ocaml/stublibs/dll*.so
2017-11-08 12:40:42 +00:00
%ifarch %{ocaml_native_compiler}
%exclude %{_libdir}/ocaml/*.a
%exclude %{_libdir}/ocaml/*.cmxa
%exclude %{_libdir}/ocaml/*.cmx
2017-11-08 12:40:42 +00:00
%endif
%exclude %{_libdir}/ocaml/*.mli
2017-11-08 12:40:42 +00:00
%files devel
%license LICENSE
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/*.a
%{_libdir}/ocaml/*.cmxa
%{_libdir}/ocaml/*.cmx
2017-11-08 12:40:42 +00:00
%endif
%{_libdir}/ocaml/*.mli
2017-11-08 12:40:42 +00:00
%changelog
* Wed Nov 8 2017 Richard W.M. Jones <rjones@redhat.com> - 1.1-3
2017-11-08 12:40:42 +00:00
- Initial RPM version.
- Fix Source0 to use nice package name.
- Fix DESTDIR installs again.