[packages/ocaml-graph] - add ocaml_opt bcond - rel 4

baggins baggins at pld-linux.org
Sat Jul 25 19:28:51 CEST 2015


commit 0184dd1344c5f1cb92f2d644c7c40c957575fd5b
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Jul 25 19:28:40 2015 +0200

    - add ocaml_opt bcond
    - rel 4

 ocaml-graph.spec | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/ocaml-graph.spec b/ocaml-graph.spec
index 8a0a36a..ddac56b 100644
--- a/ocaml-graph.spec
+++ b/ocaml-graph.spec
@@ -1,7 +1,16 @@
+#
+# Conditional build:
+%bcond_without	ocaml_opt	# skip building native optimized binaries (bytecode is always built)
+
+# not yet available on x32 (ocaml 4.02.1), remove when upstream will support it
+%ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
+%undefine	with_ocaml_opt
+%endif
+
 Summary:	OCaml library for arc and node graphs
 Name:		ocaml-graph
 Version:	1.8.2
-Release:	3
+Release:	4
 License:	LGPLv2 with exceptions
 Group:		Libraries
 Source0:	http://ocamlgraph.lri.fr/download/ocamlgraph-%{version}.tar.gz
@@ -52,13 +61,14 @@ Ocamlgraph library.
 %build
 %configure
 
-%{__make} CC="%{__cc} %{rpmcflags} -fPIC" opt
+%{__make} -j1 all %{?with_ocaml_opt:opt} \
+	CC="%{__cc} %{rpmcflags} -fPIC"
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/{ocamlgraph,stublibs}
-install *.cm[ixa]* *.a $RPM_BUILD_ROOT%{_libdir}/ocaml/ocamlgraph
+install *.cm[ixa]* %{?with_ocaml_opt:*.a} $RPM_BUILD_ROOT%{_libdir}/ocaml/ocamlgraph
 
 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
@@ -82,7 +92,11 @@ rm -rf $RPM_BUILD_ROOT
 %doc CHANGES CREDITS FAQ
 %doc LICENSE lib/*.mli src/*.mli
 %dir %{_libdir}/ocaml/ocamlgraph
-%{_libdir}/ocaml/ocamlgraph/*.cm[ixa]*
-%{_libdir}/ocaml/ocamlgraph/*.a
+%{_libdir}/ocaml/ocamlgraph/*.cma
+%{_libdir}/ocaml/ocamlgraph/*.cm[ix]
+%if %{with ocaml_opt}
+%{_libdir}/ocaml/ocamlgraph/*.[ao]
+%{_libdir}/ocaml/ocamlgraph/*.cmxa
+%endif
 %{_examplesdir}/%{name}-%{version}
 %{_libdir}/ocaml/site-lib/ocamlgraph
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ocaml-graph.git/commitdiff/0184dd1344c5f1cb92f2d644c7c40c957575fd5b



More information about the pld-cvs-commit mailing list