--- /dev/null
+--- camlidl-1.05/lib/Makefile~ 2002-04-22 11:50:47.000000000 +0000
++++ camlidl-1.05/lib/Makefile 2015-04-06 11:32:04.970899900 +0000
+@@ -28,8 +28,13 @@
+ $(NATIVELIB): $(NATIVEOBJS)
+ $(OCAMLOPT) -a -o $(NATIVELIB) $(NATIVEOBJS)
+
+-install:
+- cp $(INTERFACES) $(BYTELIB) $(NATIVELIB) $(NATIVELIB:.cmxa=.$(LIBEXT)) $(OCAMLLIB)
++install: install-byte $(NATIVELIB:install-opt)
++
++install-byte:
++ cp $(INTERFACES) $(BYTELIB) $(OCAMLLIB)
++
++install-opt:
++ cp $(NATIVELIB) $(NATIVELIB:.cmxa=.$(LIBEXT))
+ cd $(OCAMLLIB); $(RANLIB) $(NATIVELIB:.cmxa=.$(LIBEXT))
+
+ .SUFFIXES: .mli .ml .cmi .cmo .cmx
+#
+# Conditional build:
+%bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built)
+
+%ifarch x32
+# not yet available on x32 (ocaml 4.02.1), remove when upstream will support it
+%undefine with_ocaml_opt
+%endif
+
%define ocaml_ver 1:3.09.2
Summary: CamlIDL is a stub code generator and COM binding for Objective Caml
Summary(pl.UTF-8): Wiązania IDL dla OCamla
Name: ocaml-idl
Version: 1.05
-Release: 8
+Release: 9
License: QPL v1.0 (compiler), LGPL v2 (library)
Group: Libraries
Source0: http://caml.inria.fr/distrib/bazar-ocaml/camlidl-%{version}.tar.gz
# Source0-md5: 4cfb863bc3cbdc1af2502042c45cc675
Source1: http://caml.inria.fr/distrib/bazar-ocaml/camlidl-%{version}.doc.html.tar.gz
# Source1-md5: b7c7dad3ba62ddcc0f687bdebe295126
+Patch0: no-opt.patch
URL: http://caml.inria.fr/pub/old_caml_site/camlidl/
BuildRequires: ocaml >= %{ocaml_ver}
Obsoletes: ocaml-camlidl < 1.05-3
%prep
%setup -q -a 1 -n camlidl-%{version}
+%patch0 -p1
ln -s Makefile.unix config/Makefile
# chokes.
%build
-%{__make} -j1 \
+%{__make} -j1 -C compiler \
+ CPP="%{__cc} -E -x c" \
+ CFLAGS="%{rpmcflags} -fPIC"
+
+%{__make} -j1 -C lib com.cma %{?with_ocaml_opt:com.cmxa} \
+ CPP="%{__cc} -E -x c" \
+ CFLAGS="%{rpmcflags} -fPIC"
+
+%{__make} -j1 -C runtime \
+ CPP="%{__cc} -E -x c" \
+ CFLAGS="%{rpmcflags} -fPIC"
+
+%{__make} -j1 -C tools \
CPP="%{__cc} -E -x c" \
CFLAGS="%{rpmcflags} -fPIC"
+
ocamlmklib -o com lib/*.cm[xo] runtime/*.o
%install
ln -sf ../../include/caml $RPM_BUILD_ROOT%{_libdir}/ocaml/caml
%{__make} install \
+ %{!?with_ocaml_opt:NATIVELIB=""} \
BINDIR=$RPM_BUILD_ROOT%{_bindir} \
OCAMLLIB=$RPM_BUILD_ROOT%{_libdir}/ocaml
# fix install to subdir
-mv $RPM_BUILD_ROOT%{_libdir}/ocaml/{*.{cm[ix],cma,cmxa,a},idl}
+mv $RPM_BUILD_ROOT%{_libdir}/ocaml/{*.{cm[ix],cma%{?with_ocaml_opt:,cmxa,a}},idl}
install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
install -p dll*.so $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
%attr(755,root,root) %{_bindir}/camlidl
%dir %{_libdir}/ocaml/idl
%{_libdir}/ocaml/idl/*.cm[ixa]*
+%if %{with ocaml_opt}
%{_libdir}/ocaml/idl/*.a
+%endif
%{_libdir}/ocaml/site-lib/camlidl
%{_libdir}/ocaml/caml
%{_includedir}/caml/camlidlruntime.h