ocaml-cinaps/ocaml-cinaps.spec

101 lines
3.1 KiB
RPMSpec

# TESTING NOTE: The ppx_jane module is needed to run the tests. However,
# ppx_jane transitively requires this module. Therefore, we cannot run the
# tests at all until we are able to add ppx_jane to Fedora, and even then we
# will only be able to run the tests in non-bootstrap mode.
%ifnarch %{ocaml_native_compiler}
%global debug_package %{nil}
%endif
%global srcname cinaps
Name: ocaml-%{srcname}
Version: 0.13.0
Release: 1%{?dist}
Summary: Trivial Metaprogramming tool using the OCaml toplevel
License: MIT
URL: https://github.com/janestreet/%{srcname}
Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
BuildRequires: help2man
BuildRequires: ocaml >= 4.07.0
BuildRequires: ocaml-dune >= 1.5.1
BuildRequires: ocaml-findlib
BuildRequires: ocaml-re-devel >= 1.8.0
BuildRequires: ocaml-seq-devel
%description
Cinaps is a trivial Metaprogramming tool for OCaml using the OCaml
toplevel.
It is intended for two purposes:
- when you want to include a bit of generated code in a file, but writing
a proper generator/ppx rewriter is not worth it;
- when you have many repeated blocks of similar code in your program, to
help writing and maintaining them.
It is not intended as a general preprocessor, and in particular can only
be used to generate static code that is independent of the system.
%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 %{srcname}-%{version}
%build
dune build
%install
dune install --destdir=%{buildroot}
# We install the documentation with the doc macro
rm -fr %{buildroot}%{_prefix}/doc
%ifarch %{ocaml_native_compiler}
# Add missing executable bits
chmod a+x %{buildroot}%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.cmxs
%endif
# Generate the man page
mkdir -p %{buildroot}%{_mandir}/man1
help2man -N --version-string=%{version} %{buildroot}%{_bindir}/cinaps > \
%{buildroot}%{_mandir}/man1/cinaps.1
%files
%doc CONTRIBUTING.md README.org
%license LICENSE.md
%{_bindir}/cinaps
%{_mandir}/man1/cinaps.1*
%dir %{_libdir}/ocaml/%{srcname}/
%dir %{_libdir}/ocaml/%{srcname}/runtime/
%{_libdir}/ocaml/%{srcname}/META
%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.cma
%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.cmxs
%endif
%files devel
%{_libdir}/ocaml/%{srcname}/dune-package
%{_libdir}/ocaml/%{srcname}/opam
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.a
%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.cmx
%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.cmxa
%endif
%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.cmt
%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.cmti
%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.ml
%{_libdir}/ocaml/%{srcname}/runtime/cinaps_runtime.mli
%changelog
* Thu Jan 2 2020 Jerry James <loganjerry@gmail.com> - 0.13.0-1
- Initial RPM