[packages/ocaml-cryptgps] - added ocaml_opt bcond - rel 3

baggins baggins at pld-linux.org
Sat Jul 25 14:32:48 CEST 2015


commit 8fa6ed39e3bb7806a0599ded9900cb1d6138fac8
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Jul 25 14:32:28 2015 +0200

    - added ocaml_opt bcond
    - rel 3

 ocaml-cryptgps.spec | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/ocaml-cryptgps.spec b/ocaml-cryptgps.spec
index 65c2c99..02697b8 100644
--- a/ocaml-cryptgps.spec
+++ b/ocaml-cryptgps.spec
@@ -1,8 +1,17 @@
+#
+# 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 Blowfish, DES, and 3DES implementation
 Summary(pl.UTF-8):	Implementacja Blowfish, DES, and 3DES w Ocamlu
 Name:		ocaml-cryptgps
 Version:	0.2.1
-Release:	2
+Release:	3
 License:	MIT/X11
 Group:		Libraries
 Source0:	http://download.camlcity.org/download/cryptgps-%{version}.tar.gz
@@ -45,13 +54,17 @@ biblioteki cryptgps.
 %setup -q -n cryptgps
 
 %build
-%{__make} all opt
+%{__make} all %{?with_ocaml_opt:opt} \
+	CC="%{__cc} %{rpmcflags} -fPIC"
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/{,site-lib/}cryptgps
 
-install *.cm[ixa]* *.a $RPM_BUILD_ROOT%{_libdir}/ocaml/cryptgps
+install *.cm[ix] $RPM_BUILD_ROOT%{_libdir}/ocaml/cryptgps
+%if %{with ocaml_opt}
+install *.cmxa *.a $RPM_BUILD_ROOT%{_libdir}/ocaml/cryptgps
+%endif
 
 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/cryptgps
 cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/cryptgps/META <<EOF
@@ -70,6 +83,9 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc LICENSE *.mli
 %dir %{_libdir}/ocaml/cryptgps
-%{_libdir}/ocaml/cryptgps/*.cm[ixa]*
+%{_libdir}/ocaml/cryptgps/*.cm[xi]
+%if %{with ocaml_opt}
 %{_libdir}/ocaml/cryptgps/*.a
+%{_libdir}/ocaml/cryptgps/*.cmxa
+%endif
 %{_libdir}/ocaml/site-lib/cryptgps
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ocaml-cryptgps.git/commitdiff/8fa6ed39e3bb7806a0599ded9900cb1d6138fac8



More information about the pld-cvs-commit mailing list