| |
@@ -1,27 +1,22 @@
|
| |
- %global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
|
| |
- %if !%{opt}
|
| |
+ %ifnarch %{ocaml_native_compiler}
|
| |
%global debug_package %{nil}
|
| |
%endif
|
| |
|
| |
+ %define libname cppo
|
| |
+
|
| |
Name: ocaml-cppo
|
| |
- Version: 1.6.6
|
| |
- Release: 14%{?dist}
|
| |
+ Version: 1.6.8
|
| |
+ Release: 1%{?dist}
|
| |
Summary: Equivalent of the C preprocessor for OCaml programs
|
| |
|
| |
License: BSD
|
| |
- URL: http://mjambon.com/cppo.html
|
| |
- Source0: https://github.com/ocaml-community/cppo/archive/v%{version}.tar.gz
|
| |
+ URL: https://ocaml-community.github.io/cppo/
|
| |
+ Source0: https://github.com/ocaml-community/cppo/archive/v%{version}/%{libname}-%{version}.tar.gz
|
| |
|
| |
- BuildRequires: make
|
| |
- BuildRequires: ocaml >= 3.10.0
|
| |
+ BuildRequires: ocaml >= 4.02.3
|
| |
+ BuildRequires: ocaml-dune
|
| |
BuildRequires: ocaml-findlib
|
| |
- %if !%{opt}
|
| |
- Requires: ocaml >= 3.10.0
|
| |
- %endif
|
| |
BuildRequires: ocaml-ocamlbuild-devel
|
| |
- BuildRequires: ocaml-dune
|
| |
-
|
| |
- %define libname %(sed -e 's/^ocaml-//' <<< %{name})
|
| |
|
| |
%description
|
| |
Cppo is an equivalent of the C preprocessor targeted at the OCaml
|
| |
@@ -38,37 +33,59 @@
|
| |
to the robustness of cppo across OCaml versions.
|
| |
|
| |
|
| |
+ %package ocamlbuild
|
| |
+ Summary: Preprocessing plugin for ocamlbuild
|
| |
+ Requires: %{name}%{?_isa} = %{version}-%{release}
|
| |
+ Requires: ocaml-ocamlbuild%{?_isa}
|
| |
+ # There is no devel subpackage because this package IS for development purposes
|
| |
+
|
| |
+
|
| |
+ %description ocamlbuild
|
| |
+ This package contains a plugin for ocamlbuild that enables calling cppo
|
| |
+ at build time. To use it, call ocamlbuild with the argument
|
| |
+ `-plugin-tag package(cppo_ocamlbuild)`.
|
| |
+
|
| |
+
|
| |
%prep
|
| |
- %setup -q -n %{libname}-%{version}
|
| |
- sed -i.add-debuginfo \
|
| |
- 's/ocamlopt/ocamlopt -g/;s/ocamlc \(-[co]\)/ocamlc -g \1/' \
|
| |
- Makefile
|
| |
+ %autosetup -n %{libname}-%{version}
|
| |
|
| |
|
| |
%build
|
| |
- make %{?_smp_mflags} all
|
| |
+ dune build %{?_smp_mflags} --verbose --profile release
|
| |
|
| |
|
| |
%install
|
| |
- %{__install} -d $RPM_BUILD_ROOT%{_bindir}
|
| |
- %{__install} -p _build/install/default/bin/cppo $RPM_BUILD_ROOT%{_bindir}/
|
| |
+ dune install --destdir=%{buildroot}
|
| |
+
|
| |
+ # We do not want the ml files
|
| |
+ find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete
|
| |
+
|
| |
+ # We install the documentation with the doc macro
|
| |
+ rm -fr %{buildroot}%{_prefix}/doc
|
| |
|
| |
|
| |
%check
|
| |
- %ifnarch %{arm} %{power64}
|
| |
- # Fails on armv7hl and ppc64le with:
|
| |
- # Error: math error
|
| |
- make test
|
| |
- %endif
|
| |
+ dune runtest --profile release
|
| |
|
| |
|
| |
%files
|
| |
%license LICENSE.md
|
| |
%doc Changes README.md
|
| |
%{_bindir}/cppo
|
| |
+ %{_libdir}/ocaml/cppo
|
| |
+
|
| |
+
|
| |
+ %files ocamlbuild
|
| |
+ %{_libdir}/ocaml/cppo_ocamlbuild/
|
| |
|
| |
|
| |
%changelog
|
| |
+ * Tue Dec 14 2021 Jerry James <loganjerry@gmail.com> - 1.6.8-1
|
| |
+ - Version 1.6.8
|
| |
+ - New URLs
|
| |
+ - Add ocamlbuild subpackage for the plugin
|
| |
+ - Build, install, and test with dune
|
| |
+
|
| |
* Mon Oct 04 2021 Richard W.M. Jones <rjones@redhat.com> - 1.6.6-14
|
| |
- OCaml 4.13.1 build
|
| |
|
| |
I have verified with a scratch build that the testing issue on arm and ppc64le is gone.