rpms/hivex/EL-5 hivex-1.2.0-ocaml.patch,NONE,1.1 hivex.spec,1.3,1.4

Richard W.M. Jones rjones at fedoraproject.org
Mon Mar 1 17:43:45 UTC 2010


Author: rjones

Update of /cvs/pkgs/rpms/hivex/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18752

Modified Files:
	hivex.spec 
Added Files:
	hivex-1.2.0-ocaml.patch 
Log Message:
- Fix for old version of OCaml in EPEL 5 (upstream after 1.2.0 released).
- We have to pass INSTALLDIRS=vendor to 'make' to get Perl package
  installed in vendordir instead of sitedir.


hivex-1.2.0-ocaml.patch:
 ChangeLog       |    3 +++
 config.h.in     |    6 ++++++
 configure       |   42 ++++++++++++++++++++++++++++++++++++++++++
 configure.ac    |   29 +++++++++++++++++++++++++++++
 ocaml/hivex_c.c |   22 ++++++++++++++++++++++
 5 files changed, 102 insertions(+)

--- NEW FILE hivex-1.2.0-ocaml.patch ---
diff -ur hivex-1.2.0.orig/ChangeLog hivex-1.2.0/ChangeLog
--- hivex-1.2.0.orig/ChangeLog	2010-03-01 13:54:10.000000000 +0000
+++ hivex-1.2.0/ChangeLog	2010-03-01 17:36:51.000000000 +0000
@@ -1,6 +1,9 @@
 2010-03-01  Richard Jones  <rjones at redhat.com>
 
 	Prepare for version 1.2.0.
+	Fix hivexsh_SOURCES.
+
+	Update PO files.
 
 2010-03-01  Daniel Cabrera  <logan at fedoraproject.org>
 
diff -ur hivex-1.2.0.orig/config.h.in hivex-1.2.0/config.h.in
--- hivex-1.2.0.orig/config.h.in	2010-03-01 13:52:10.000000000 +0000
+++ hivex-1.2.0/config.h.in	2010-03-01 17:34:04.000000000 +0000
@@ -70,6 +70,12 @@
 /* Define to 1 if you have the <byteswap.h> header file. */
 #undef HAVE_BYTESWAP_H
 
+/* Defined if function caml_raise_with_args exists. */
+#undef HAVE_CAML_RAISE_WITH_ARGS
+
+/* Define to 1 if you have the <caml/unixsupport.h> header file. */
+#undef HAVE_CAML_UNIXSUPPORT_H
+
 /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
    CoreFoundation framework. */
 #undef HAVE_CFLOCALECOPYCURRENT
diff -ur hivex-1.2.0.orig/configure hivex-1.2.0/configure
--- hivex-1.2.0.orig/configure	2010-03-01 13:51:21.000000000 +0000
+++ hivex-1.2.0/configure	2010-03-01 17:33:44.000000000 +0000
@@ -24395,6 +24395,48 @@
 fi
 
 
+if test "x$OCAMLC" != "xno"; then
+        old_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS -I$OCAMLLIB"
+    for ac_header in caml/unixsupport.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "caml/unixsupport.h" "ac_cv_header_caml_unixsupport_h" "
+    #include <caml/config.h>
+    #include <caml/mlvalues.h>
+
+"
+if test "x$ac_cv_header_caml_unixsupport_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_CAML_UNIXSUPPORT_H 1
+_ACEOF
+
+fi
+
+done
+
+    CFLAGS="$old_CFLAGS"
+
+        f=caml_raise_with_args
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for function $f" >&5
+$as_echo_n "checking for function $f... " >&6; }
+    echo "char $f (); char foo() { return $f (); }" > conftest.c
+    rm -f conftest_ml.ml
+    touch conftest_ml.ml
+    if $OCAMLOPT -c conftest.c 2>/dev/null && \
+       $OCAMLOPT -c conftest_ml.ml 2>/dev/null && \
+       $OCAMLOPT conftest.o conftest_ml.cmx -o conftest 2>/dev/null ; then
+
+$as_echo "#define HAVE_CAML_RAISE_WITH_ARGS 1" >>confdefs.h
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+    else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+    fi
+    rm -f conftest conftest.* conftest_ml.*
+fi
+
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
diff -ur hivex-1.2.0.orig/configure.ac hivex-1.2.0/configure.ac
--- hivex-1.2.0.orig/configure.ac	2010-03-01 13:50:23.000000000 +0000
+++ hivex-1.2.0/configure.ac	2010-03-01 17:32:48.000000000 +0000
@@ -167,6 +167,35 @@
 AC_PROG_FINDLIB
 AM_CONDITIONAL([HAVE_OCAML],[test "x$OCAMLC" != "xno" -a "x$OCAMLFIND" != "xno"])
 
+if test "x$OCAMLC" != "xno"; then
+    dnl Check if we have caml/unixsupport.h header (OCaml bindings only).
+    old_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS -I$OCAMLLIB"
+    AC_CHECK_HEADERS([caml/unixsupport.h],[],[],
+    [
+    #include <caml/config.h>
+    #include <caml/mlvalues.h>
+    ])
+    CFLAGS="$old_CFLAGS"
+
+    dnl Do we have function caml_raise_with_args?
+    f=caml_raise_with_args
+    AC_MSG_CHECKING([for function $f])
+    echo "char $f (); char foo() { return $f (); }" > conftest.c
+    rm -f conftest_ml.ml
+    touch conftest_ml.ml
+    if $OCAMLOPT -c conftest.c 2>/dev/null && \
+       $OCAMLOPT -c conftest_ml.ml 2>/dev/null && \
+       $OCAMLOPT conftest.o conftest_ml.cmx -o conftest 2>/dev/null ; then
+        AC_DEFINE([HAVE_CAML_RAISE_WITH_ARGS],[1],
+                  [Defined if function caml_raise_with_args exists.])
+        AC_MSG_RESULT([found])
+    else
+        AC_MSG_RESULT([not found])
+    fi
+    rm -f conftest conftest.* conftest_ml.*
+fi
+
 dnl Check for Perl (optional, for Perl bindings).
 dnl XXX This isn't quite right, we should check for Perl devel library.
 AC_CHECK_PROG([PERL],[perl],[perl],[no])
diff -ur hivex-1.2.0.orig/ocaml/hivex_c.c hivex-1.2.0/ocaml/hivex_c.c
--- hivex-1.2.0.orig/ocaml/hivex_c.c	2010-02-26 22:33:16.000000000 +0000
+++ hivex-1.2.0/ocaml/hivex_c.c	2010-03-01 17:35:58.000000000 +0000
@@ -40,7 +40,29 @@
 #include <caml/memory.h>
 #include <caml/mlvalues.h>
 #include <caml/signals.h>
+
+#ifdef HAVE_CAML_UNIXSUPPORT_H
 #include <caml/unixsupport.h>
+#else
+extern value unix_error_of_code (int errcode);
+#endif
+
+#ifndef HAVE_CAML_RAISE_WITH_ARGS
+static void
+caml_raise_with_args (value tag, int nargs, value args[])
+{
+  CAMLparam1 (tag);
+  CAMLxparamN (args, nargs);
+  value bucket;
+  int i;
+
+  bucket = caml_alloc_small (1 + nargs, 0);
+  Field(bucket, 0) = tag;
+  for (i = 0; i < nargs; i++) Field(bucket, 1 + i) = args[i];
+  caml_raise(bucket);
+  CAMLnoreturn;
+}
+#endif
 
 #include <hivex.h>
 


Index: hivex.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hivex/EL-5/hivex.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- hivex.spec	1 Mar 2010 16:04:07 -0000	1.3
+++ hivex.spec	1 Mar 2010 17:43:45 -0000	1.4
@@ -1,6 +1,6 @@
 Name:           hivex
 Version:        1.2.0
-Release:        2%{?dist}.1
+Release:        2%{?dist}.2
 Summary:        Read and write Windows Registry binary hive files
 
 Group:          Development/Libraries
@@ -9,6 +9,9 @@ URL:            http://libguestfs.org/
 Source0:        http://libguestfs.org/download/%{name}-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+# Fix for old version of OCaml in EPEL-5 (upstream after 1.2.0 released).
+Patch0:         hivex-1.2.0-ocaml.patch
+
 BuildRequires:  perl
 #BuildRequires:  perl-Test-Simple
 BuildRequires:  perl-Test-Pod
@@ -99,10 +102,15 @@ perl-%{name} contains Perl bindings for 
 %prep
 %setup -q
 
+%patch0 -p1
+
 
 %build
 %configure --disable-static
-make %{?_smp_mflags}
+
+# 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
+# not the site dir.
+make INSTALLDIRS=vendor %{?_smp_mflags}
 
 
 %install
@@ -177,6 +185,11 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Mon Mar  1 2010 Richard W.M. Jones <rjones at redhat.com> - 1.2.0-2.el5.2
+- Fix for old version of OCaml in EPEL 5 (upstream after 1.2.0 released).
+- We have to pass INSTALLDIRS=vendor to 'make' to get Perl package
+  installed in vendordir instead of sitedir.
+
 * Mon Mar  1 2010 Richard W.M. Jones <rjones at redhat.com> - 1.2.0-2.el5.1
 - Remove BRs of ExtUtils::MakeMaker and Test::Simple since these are
   not a part of EPEL-5.



More information about the scm-commits mailing list