Blob Blame History Raw
%undefine _package_note_flags

%ifnarch %{ocaml_native_compiler}
%global debug_package %{nil}
%endif

Name:           ocaml-fmt
Version:        0.9.0
Release:        5%{?dist}
Summary:        OCaml Format pretty-printer combinators

License:        ISC
URL:            https://erratique.ch/software/fmt
Source0:        %{url}/releases/fmt-%{version}.tbz

BuildRequires:  ocaml >= 4.08.0
BuildRequires:  ocaml-cmdliner-devel >= 0.9.8
BuildRequires:  ocaml-findlib
BuildRequires:  ocaml-ocamlbuild
BuildRequires:  ocaml-ocamldoc
BuildRequires:  ocaml-topkg-devel >= 1.0.3
BuildRequires:  python3

%description
Fmt exposes combinators to devise `Format` pretty-printing functions.

Fmt depends only on the OCaml standard library.  The optional Fmt_tty
library that enables setting up formatters for terminal color output
depends on the Unix library.  The optional Fmt_cli library that provides
command line support for Fmt depends on Cmdliner.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       ocaml-cmdliner-devel%{?_isa}

%description    devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.

%prep
%autosetup -n fmt-%{version} -p1

# Skip the styled_perf_bug test, which runs until stopped by an external signal
sed -i '/styled_perf_bug/d' pkg/pkg.ml _tags

# link with the math library
echo $'\ntrue: cclib(-lm)' >> _tags

%build
# Build the library and the tests
ocaml pkg/pkg.ml build --tests true --with-base-unix true --with-cmdliner true

# Build the documentation
mkdir html
ocamldoc -html -d html -I +cmdliner -I _build/src _build/src/*.mli

%install
# Install the library
mkdir -p %{buildroot}%{ocamldir}/fmt
cp -p _build/{opam,pkg/META} %{buildroot}%{ocamldir}/fmt
%ifarch %{ocaml_native_compiler}
cp -a _build/src/*.{a,cma,cmi,cmt,cmti,cmx,cmxa,cmxs,mli} \
  %{buildroot}%{ocamldir}/fmt
%else
cp -a _build/src/*.{cma,cmi,cmt,cmti,mli} %{buildroot}%{ocamldir}/fmt
%endif
cp -p src/fmt_tty_top_init.ml %{buildroot}%{ocamldir}/fmt

%ocaml_files

%check
ocaml pkg/pkg.ml test

%files -f .ofiles
%doc CHANGES.md README.md
%license LICENSE.md

%files devel -f .ofiles-devel
%doc html/*

%changelog
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Tue Sep 20 2022 Jerry James <loganjerry@gmail.com> - 0.9.0-4
- Rebuild for ocaml-cmdliner 1.1.1

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Wed Jul 20 2022 Jerry James <loganjerry@gmail.com> - 0.9.0-2
- Use new OCaml macros

* Sat Jun 18 2022 Richard W.M. Jones <rjones@redhat.com> - 0.9.0-2
- OCaml 4.14.0 rebuild

* Wed Apr 27 2022 Jerry James <loganjerry@gmail.com> - 0.9.0-1
- Version 0.9.0
- Link with the math library

* Fri Feb 04 2022 Richard W.M. Jones <rjones@redhat.com> - 0.8.10-4
- OCaml 4.13.1 rebuild to remove package notes

* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Mon Jan 17 2022 Jerry James <loganjerry@gmail.com> - 0.8.10-2
- Install fmt_tty_top_init.ml

* Mon Oct 04 2021 Richard W.M. Jones <rjones@redhat.com> - 0.8.10-2
- OCaml 4.13.1 build

* Mon Oct  4 2021 Jerry James <loganjerry@gmail.com> - 0.8.10-1
- Version 0.8.10
- Drop upstreamed -stdlib-shims patch

* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Mon Mar  1 11:02:42 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 0.8.9-3
- OCaml 4.12.0 build

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Tue Nov  3 2020 Jerry James <loganjerry@gmail.com> - 0.8.9-1
- Version 0.8.9

* Tue Sep 01 2020 Richard W.M. Jones <rjones@redhat.com> - 0.8.8-12
- OCaml 4.11.1 rebuild

* Fri Aug 21 2020 Richard W.M. Jones <rjones@redhat.com> - 0.8.8-11
- OCaml 4.11.0 rebuild

* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.8-10
- Second attempt - Rebuilt for
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.8-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Tue May 05 2020 Richard W.M. Jones <rjones@redhat.com> - 0.8.8-8
- OCaml 4.11.0+dev2-2020-04-22 rebuild

* Tue Apr 21 2020 Richard W.M. Jones <rjones@redhat.com> - 0.8.8-7
- OCaml 4.11.0 pre-release attempt 2

* Sat Apr 18 2020 Richard W.M. Jones <rjones@redhat.com> - 0.8.8-6
- OCaml 4.11.0 pre-release

* Fri Apr 03 2020 Richard W.M. Jones <rjones@redhat.com> - 0.8.8-5
- Update all OCaml dependencies for RPM 4.16.

* Wed Feb 26 2020 Richard W.M. Jones <rjones@redhat.com> - 0.8.8-4
- OCaml 4.10.0 final.

* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Sun Jan 19 2020 Richard W.M. Jones <rjones@redhat.com> - 0.8.8-2
- OCaml 4.10.0+beta1 rebuild.

* Thu Jan  9 2020 Jerry James <loganjerry@gmail.com> - 0.8.8-1
- Initial RPM