From: Jan Rękorajski Date: Sat, 25 Jul 2015 12:47:07 +0000 (+0200) Subject: - fix install without ocaml opt build X-Git-Tag: auto/th/ocaml-curl-0.7.1-3~2 X-Git-Url: http://git.pld-linux.org/?p=packages%2Focaml-curl.git;a=commitdiff_plain;h=9781d07761f2086352e3b25cb9d814a859b653a1;hp=c63f57eebc73721cc32e51c005eb0944cd015e6d - fix install without ocaml opt build --- diff --git a/ocaml-curl.spec b/ocaml-curl.spec index 8e7df41..383fa81 100644 --- a/ocaml-curl.spec +++ b/ocaml-curl.spec @@ -1,6 +1,11 @@ # # Conditional build: -%bcond_with opt # build opt +%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 %define debug_package %{nil} %define pkgname curl @@ -12,6 +17,7 @@ License: MIT Group: Libraries Source0: https://forge.ocamlcore.org/frs/download.php/1400/ocurl-%{version}.tar.gz # Source0-md5: d138fd78538ae3bd008d6e9c2993d240 +Patch0: ocaml_opt.patch URL: http://ocurl.forge.ocamlcore.org/ BuildRequires: curl-devel >= 7.12.0 BuildRequires: gawk @@ -39,11 +45,12 @@ developing applications that use %{name}. %prep %setup -q -n ocurl-%{version} +%patch0 -p1 %build %configure %{__make} -j1 all \ -%if %{with opt} +%if %{with ocaml_opt} OCBYTE="ocamlc.opt -g" \ OCOPT="ocamlopt.opt -g" %endif @@ -52,6 +59,7 @@ developing applications that use %{name}. rm -rf $RPM_BUILD_ROOT export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs + %{__make} install \ DESTDIR=$RPM_BUILD_ROOT @@ -80,7 +88,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/ocaml/curl %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllcurl-helper.so %{_libdir}/ocaml/stublibs/dllcurl-helper.so.owner -%if %{with opt} +%if %{with ocaml_opt} %exclude %{_libdir}/ocaml/curl/*.a %exclude %{_libdir}/ocaml/curl/*.o %exclude %{_libdir}/ocaml/curl/*.cmx @@ -91,7 +99,7 @@ rm -rf $RPM_BUILD_ROOT %files devel %defattr(644,root,root,755) %doc examples/* -%if %{with opt} +%if %{with ocaml_opt} %{_libdir}/ocaml/curl/*.a %{_libdir}/ocaml/curl/*.o %{_libdir}/ocaml/curl/*.cmx diff --git a/ocaml_opt.patch b/ocaml_opt.patch new file mode 100644 index 0000000..05d0f0e --- /dev/null +++ b/ocaml_opt.patch @@ -0,0 +1,31 @@ +--- ocurl-0.7.1/Makefile.in~ 2014-05-12 22:10:26.000000000 +0200 ++++ ocurl-0.7.1/Makefile.in 2015-07-25 14:46:23.107163100 +0200 +@@ -32,13 +32,13 @@ + TARGETS += curl_lwt.cmo + endif + ifeq (@OCAMLBEST@,opt) +-TARGETS += curl.cmxa ++TARGETS += curl.cmxa curl.a + ifneq (@OCAML_PKG_lwt@,no) + TARGETS += curl_lwt.cmx + endif + endif + +-INSTALL_TARGETS = curl.a curl.cmi curl.mli $(TARGETS) ++INSTALL_TARGETS = curl.cmi curl.mli $(TARGETS) + ifneq (@OCAML_PKG_lwt@,no) + INSTALL_TARGETS += curl_lwt.cmi curl_lwt.mli curl_lwt.o + endif +@@ -97,10 +97,10 @@ + mkdir -p $(INSTALLDIR) + $(INSTALLDATA) curl.cma $(INSTALLDIR) + ifeq (@OCAMLBEST@,opt) +- $(INSTALLDATA) curl.cmxa $(INSTALLDIR) ++ $(INSTALLDATA) curl.cmxa curl.a $(INSTALLDIR) + endif + $(INSTALLDATA) curl.mli curl.cmi $(INSTALLDIR) +- $(INSTALLDATA) curl.a libcurl-helper.a $(INSTALLDIR) ++ $(INSTALLDATA) libcurl-helper.a $(INSTALLDIR) + endif + + uninstall: