#
# Conditional build:
-%bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built)
+%bcond_without ocaml_opt # native optimized binaries (bytecode is always built)
# not yet available on x32 (ocaml 4.02.1), update when upstream will support it
-%ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
+%ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
%undefine with_ocaml_opt
%endif
Summary: Preprocessor (cpp equivalent) for OCaml
Summary(pl.UTF-8): Preprocesor (odpowiednik cpp) dla OCamla
Name: cppo
-Version: 1.6.7
-Release: 2
+Version: 1.6.8
+Release: 1
License: BSD
Group: Development/Tools
+#Source0Download: https://github.com/ocaml-community/cppo/releases
Source0: https://github.com/mjambon/cppo/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 88c9f9a1f067f91dab5abe1653e281a9
+# Source0-md5: fed401197d86f9089e89f6cbdf1d660d
URL: http://mjambon.com/cppo.html
-BuildRequires: ocaml >= 3.04-7
+BuildRequires: ocaml >= 1:4.02.3
+BuildRequires: ocaml-dune >= 1.0
BuildRequires: ocaml-findlib
BuildRequires: ocaml-ocamlbuild-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Group: Libraries
Requires: %{name} = %{version}-%{release}
# ocamlbuild resides in ocaml package, so don't require just ocaml-runtime
-%requires_eq ocaml
+%requires_eq ocaml
%description -n ocamlbuild-cppo
Cppo plugin for ocamlbuild.
Summary(pl.UTF-8): Pliki programistyczne biblioteki ocamlbuild_cppo
Group: Development/Libraries
Requires: ocamlbuild-cppo = %{version}-%{release}
-%requires_eq ocaml
+%requires_eq ocaml
%description -n ocamlbuild-cppo-devel
Development files for ocamlbuild_cppo library.
%setup -q
%build
-dune build
+dune build --verbose
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/ocaml,%{_examplesdir}}
-cp -p _build/install/default/bin/cppo $RPM_BUILD_ROOT%{_bindir}
-cp -Lr _build/install/default/lib/cppo_ocamlbuild $RPM_BUILD_ROOT%{_libdir}/ocaml/
+dune install --verbose --destdir=$RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_examplesdir}
cp -pr examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+# not needed (no cppo ocaml library)
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/cppo/{META,dune-package,opam}
+# sources
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/cppo_ocamlbuild/ocamlbuild_cppo.ml
+# packaged as %doc
+%{__rm} -r $RPM_BUILD_ROOT%{_prefix}/doc/{cppo,cppo_ocamlbuild}
+
%clean
rm -rf $RPM_BUILD_ROOT