Name: ocaml-lambda-term
Version: 1.13
Release: 2%{?dist}
Summary: Terminal manipulation library for OCaml
%global libname %(echo %{name} | sed -e 's/^ocaml-//')
License: BSD
URL: https://github.com/ocaml-community/lambda-term/
Source0: https://github.com/ocaml-community/lambda-term/archive/%{version}/%{libname}-%{version}.tar.gz
BuildRequires: ocaml
BuildRequires: ocaml-camomile-devel
BuildRequires: ocaml-findlib-devel
BuildRequires: ocaml-lwt-devel
BuildRequires: ocaml-lwt-react-devel
BuildRequires: ocaml-lwt-log-devel
BuildRequires: ocaml-react-devel
BuildRequires: ocaml-zed-devel
BuildRequires: ocaml-result-devel
BuildRequires: libev-devel
BuildRequires: jbuilder
%description
Lambda-term is a cross-platform library for manipulating the terminal. It
provides an abstraction for keys, mouse events, colors, as well as a set of
widgets to write curses-like applications.
The main objective of lambda-term is to provide a higher level functional
interface to terminal manipulation than, for example, ncurses, by providing
a native OCaml interface instead of bindings to a C library.
Lambda-term integrates with zed to provide text edition facilities in
console applications.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%prep
%autosetup -n %{libname}-%{version}
%build
# It might be nice to have a %jbuilder macro that just does this.
jbuilder build -p %{libname} %{?_smp_mflags}
%install
export OCAMLFIND_DESTDIR=%{buildroot}%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR
jbuilder install --prefix %{buildroot}%{_prefix}
# Hmm... the above needs refinement. Remove spurious doc files.
rm -rf %{buildroot}%{_prefix}/doc
# Also put mandir in the right place.
mv %{buildroot}%{_prefix}/man %{buildroot}%{_mandir}
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_mandir}/man5
mv %{buildroot}%{_mandir}/*.1 %{buildroot}%{_mandir}/man1/
mv %{buildroot}%{_mandir}/*.5 %{buildroot}%{_mandir}/man5/
# Also, remove ml files that jbuilder seems to want to install.
rm -rf %{buildroot}%{_libdir}/ocaml/%{libname}/*.ml
%check
make test
%files
%license LICENSE
%doc README.md CHANGES.md
%{_libdir}/ocaml/%{libname}
%{_bindir}/lambda-term-actions
%{_mandir}/man1/lambda-term-actions.1*
%{_mandir}/man5/lambda-term-inputrc.5*
%{_datadir}/lambda-term
%ifarch %{ocaml_native_compiler}
%exclude %{_libdir}/ocaml/*/*.a
%exclude %{_libdir}/ocaml/*/*.cmxa
%exclude %{_libdir}/ocaml/*/*.cmx
%endif
%exclude %{_libdir}/ocaml/*/*.mli
%{_libdir}/ocaml/stublibs/*.so
%files devel
%license LICENSE
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/*/*.a
%{_libdir}/ocaml/*/*.cmxa
%{_libdir}/ocaml/*/*.cmx
%endif
%{_libdir}/ocaml/*/*.mli
%changelog
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Sep 07 2018 Ben Rosser <rosser.bjr@gmail.com> - 1.13-1
- Updated to latest upstream release.
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Dec 15 2017 Ben Rosser <rosser.bjr@gmail.com> - 1.12.0-1
- Updated to latest upstream release.
* Thu Aug 31 2017 Ben Rosser <rosser.bjr@gmail.com> - 1.11-1
- Initial packaging.