Really fix OCaml make install rule.

This commit is contained in:
Richard W.M. Jones 2011-05-17 17:41:11 +01:00
parent 7036c38310
commit 2532068415
4 changed files with 107 additions and 5 deletions

View File

@ -1,7 +1,7 @@
From f408b757b1d75429fae5fa7630a4fc5451844de7 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones@redhat.com>
Date: Tue, 17 May 2011 17:19:27 +0100
Subject: [PATCH] ocaml: Set package name when installing native bindings.
Subject: [PATCH 1/2] ocaml: Set package name when installing native bindings.
This fixes commit b8ad15031cacf910634b4f4f4632232949c4acd2.
---

View File

@ -0,0 +1,46 @@
From 5fc8bc9d9ef6dd23d55771c8def7c369f32e7919 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones@redhat.com>
Date: Tue, 17 May 2011 17:37:31 +0100
Subject: [PATCH 2/2] ocaml: Really fix 'make install' rule.
This fixes commit b8ad15031cacf910634b4f4f4632232949c4acd2
and commit f408b757b1d75429fae5fa7630a4fc5451844de7.
---
ocaml/Makefile.am | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index 58fa8e3..c688df0 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -88,19 +88,19 @@ include .depend
SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
# Do the installation by hand, because we want to run ocamlfind.
+install_files = META *.so *.a *.cma *.cmi *.mli
+
+if HAVE_OCAMLOPT
+install_files += *.cmx *.cmxa
+endif
+
install-data-hook:
mkdir -p $(DESTDIR)$(OCAMLLIB)
mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs
$(OCAMLFIND) install \
-ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
- hivex \
- META *.so *.a *.cma *.cmi *.mli
-if HAVE_OCAMLOPT
- $(OCAMLFIND) install \
- -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
- hivex \
- *.cmx *.cmxa
-endif
+ $(PACKAGE_NAME) \
+ $(install_files)
CLEANFILES += $(noinst_DATA)
--
1.7.5.1

View File

@ -7,7 +7,7 @@
Name: hivex
Version: 1.2.7
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Read and write Windows Registry binary hive files
Group: Development/Libraries
@ -38,8 +38,10 @@ Conflicts: libguestfs <= 1:1.0.84
# Fix Perl directory install path.
Patch0: %{name}-1.2.3-dirs.patch
# Add upstream patch to fix ocaml install rule.
# Add upstream patches to fix ocaml install rule.
Patch1: 0001-ocaml-Set-package-name-when-installing-native-bindin.patch
Patch2: 0002-ocaml-Really-fix-make-install-rule.patch
Patch3: ocaml-Fix-autotools.patch
%description
@ -148,6 +150,8 @@ python-%{name} contains Python bindings for %{name}.
%patch0 -p1 -b .dirs
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
@ -256,10 +260,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Tue May 17 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.7-2
* Tue May 17 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.7-3
- New upstream version 1.2.7.
- Removed patch which is now upstream.
- Add upstream patch to fix ocaml install rule.
- Add upstream patches to fix ocaml install rule.
* Thu May 12 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.6-2
- New upstream version 1.2.6.

52
ocaml-Fix-autotools.patch Normal file
View File

@ -0,0 +1,52 @@
--- hivex/ocaml/Makefile.in.orig 2011-05-17 17:38:17.300761216 +0100
+++ hivex/ocaml/Makefile.in 2011-05-17 17:38:27.668965851 +0100
@@ -54,7 +54,8 @@
@HAVE_OCAMLOPT_TRUE@@HAVE_OCAML_TRUE@am__append_1 = mlhivex.cmxa
DIST_COMMON = $(srcdir)/.depend $(srcdir)/META.in \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in
-@HAVE_OCAML_TRUE@am__append_2 = $(noinst_DATA)
+@HAVE_OCAMLOPT_TRUE@@HAVE_OCAML_TRUE@am__append_2 = *.cmx *.cmxa
+@HAVE_OCAML_TRUE@am__append_3 = $(noinst_DATA)
subdir = ocaml
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
@@ -870,7 +871,7 @@
t/*.ml
CLEANFILES = *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so t/*.cmi \
- t/*.cmo t/*.cmx t/*.o t/*.a t/*.so $(am__append_2)
+ t/*.cmo t/*.cmx t/*.o t/*.a t/*.so $(am__append_3)
AM_CPPFLAGS = \
-I$(top_builddir) -I$(OCAMLLIB) -I$(top_srcdir)/ocaml \
-I$(top_srcdir)/lib \
@@ -894,6 +895,10 @@
@HAVE_OCAML_TRUE@ t/hivex_300_fold
@HAVE_OCAML_TRUE@SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
+
+# Do the installation by hand, because we want to run ocamlfind.
+@HAVE_OCAML_TRUE@install_files = META *.so *.a *.cma *.cmi *.mli \
+@HAVE_OCAML_TRUE@ $(am__append_2)
all: all-am
.SUFFIXES:
@@ -1211,17 +1216,13 @@
@HAVE_OCAML_TRUE@hivex.cmo: hivex.cmi
@HAVE_OCAML_TRUE@hivex.cmx: hivex.cmi
-# Do the installation by hand, because we want to run ocamlfind.
@HAVE_OCAML_TRUE@install-data-hook:
@HAVE_OCAML_TRUE@ mkdir -p $(DESTDIR)$(OCAMLLIB)
@HAVE_OCAML_TRUE@ mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs
@HAVE_OCAML_TRUE@ $(OCAMLFIND) install \
@HAVE_OCAML_TRUE@ -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
-@HAVE_OCAML_TRUE@ hivex \
-@HAVE_OCAML_TRUE@ META *.so *.a *.cma *.cmi *.mli
-@HAVE_OCAMLOPT_TRUE@@HAVE_OCAML_TRUE@ $(OCAMLFIND) install \
-@HAVE_OCAMLOPT_TRUE@@HAVE_OCAML_TRUE@ -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
-@HAVE_OCAMLOPT_TRUE@@HAVE_OCAML_TRUE@ *.cmx *.cmxa
+@HAVE_OCAML_TRUE@ $(PACKAGE_NAME) \
+@HAVE_OCAML_TRUE@ $(install_files)
# Tell version 3.79 and up of GNU make to not build goals in this
# directory in parallel. (See RHBZ#502309).