From 58891fba72147dfcc17de4bf247ead2028c5a8ab Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] ocaml-libvirt package. --- .hgignore | 1 + .../mingw32-ocaml-libvirt-0.4.4.2-build.patch | 42 +++++++++++ ocaml-libvirt/mingw32-ocaml-libvirt.spec | 81 ++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 ocaml-libvirt/mingw32-ocaml-libvirt-0.4.4.2-build.patch create mode 100644 ocaml-libvirt/mingw32-ocaml-libvirt.spec diff --git a/.hgignore b/.hgignore index 50e157f..745fc89 100644 --- a/.hgignore +++ b/.hgignore @@ -99,6 +99,7 @@ ocaml-extlib/*.cmx ocaml-extlib/*.o ocaml-findlib/findlib-1.2.2.tar.gz ocaml-lablgl/lablgl-1.03.tar.gz +ocaml-libvirt/ocaml-libvirt-0.4.4.2.tar.gz ocaml-xml-light/xml-light-2.2.cvs20070817.tar.gz openssl/openssl-0.9.8g-usa.tar.bz2 pango/pango-1.21.6.tar.bz2 diff --git a/ocaml-libvirt/mingw32-ocaml-libvirt-0.4.4.2-build.patch b/ocaml-libvirt/mingw32-ocaml-libvirt-0.4.4.2-build.patch new file mode 100644 index 0000000..af1915e --- /dev/null +++ b/ocaml-libvirt/mingw32-ocaml-libvirt-0.4.4.2-build.patch @@ -0,0 +1,42 @@ +diff -ur ocaml-libvirt-0.4.4.2.orig/configure.ac ocaml-libvirt-0.4.4.2.mingw/configure.ac +--- ocaml-libvirt-0.4.4.2.orig/configure.ac 2008-07-09 12:51:58.000000000 +0100 ++++ ocaml-libvirt-0.4.4.2.mingw/configure.ac 2008-11-16 17:42:16.000000000 +0000 +@@ -296,6 +296,9 @@ + fi + done + ++dnl Check for ranlib ++AC_CHECK_TOOL([RANLIB], [ranlib], [:]) ++ + dnl Summary. + echo "------------------------------------------------------------" + echo "Thanks for downloading" $PACKAGE_STRING +diff -ur ocaml-libvirt-0.4.4.2.orig/libvirt/Makefile.in ocaml-libvirt-0.4.4.2.mingw/libvirt/Makefile.in +--- ocaml-libvirt-0.4.4.2.orig/libvirt/Makefile.in 2008-07-09 12:51:41.000000000 +0100 ++++ ocaml-libvirt-0.4.4.2.mingw/libvirt/Makefile.in 2008-11-16 17:42:45.000000000 +0000 +@@ -17,6 +17,8 @@ + + WIN32 = @WIN32@ + ++CC = @CC@ ++ + CFLAGS = @CFLAGS@ \ + -I.. \ + -I"$(shell ocamlc -where)" \ +@@ -29,6 +31,8 @@ + OCAMLFIND = @OCAMLFIND@ + OCAMLMKLIB = @OCAMLMKLIB@ + ++RANLIB = @RANLIB@ ++ + ifneq ($(OCAMLFIND),) + OCAMLCPACKAGES := -package unix + OCAMLCFLAGS := -g +@@ -68,6 +72,7 @@ + + mllibvirt.cmxa: libvirt_c.o $(OPTOBJS) + $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS) -lvirt ++ -$(RANLIB) mllibvirt.a libmllibvirt.a + + else + ifeq ($(WIN32),yes) diff --git a/ocaml-libvirt/mingw32-ocaml-libvirt.spec b/ocaml-libvirt/mingw32-ocaml-libvirt.spec new file mode 100644 index 0000000..e9001eb --- /dev/null +++ b/ocaml-libvirt/mingw32-ocaml-libvirt.spec @@ -0,0 +1,81 @@ +%define __strip %{_mingw32_strip} +%define __objdump %{_mingw32_objdump} +%define _use_internal_dependency_generator 0 +%define __find_requires %{_mingw32_findrequires} +%define __find_provides %{_mingw32_findprovides} + +Name: mingw32-ocaml-libvirt +Version: 0.4.4.2 +Release: 1%{?dist} +Summary: MinGW Windows port of OCaml binding for libvirt + +License: LGPLv2+ +Group: Development/Libraries + +URL: http://libvirt.org/ocaml/ +Source0: http://libvirt.org/sources/ocaml/ocaml-libvirt-%{version}.tar.gz + +Patch1000: mingw32-ocaml-libvirt-0.4.4.2-build.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch + +BuildRequires: mingw32-filesystem >= 35 +BuildRequires: mingw32-gcc +BuildRequires: mingw32-binutils +BuildRequires: mingw32-ocaml >= 3.11.0+beta1-13 +BuildRequires: mingw32-libvirt >= 0.2.1 +BuildRequires: perl +BuildRequires: gawk +BuildRequires: autoconf, automake, libtool + + +%description +OCaml binding for libvirt. + + +%prep +%setup -q -n ocaml-libvirt-%{version} + +%patch1000 -p1 + +autoreconf + + +%build +export OCAMLFIND_CONF=%{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf +%{_mingw32_configure} +make OCAMLMKLIB=%{_mingw32_target}-ocamlmklib opt + + +%install +rm -rf $RPM_BUILD_ROOT + +export OCAMLFIND_CONF=/etc/i686-pc-mingw32-ocamlfind.conf +export DESTDIR=$RPM_BUILD_ROOT +export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml + +mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs + +#make install-opt +pushd libvirt +ocamlfind install -ldconf ignore libvirt ../META *.a *.cmx *.cmxa *.cmi *.mli +popd +pushd mlvirsh +make install-opt +popd + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root) +%{_mingw32_bindir}/mlvirsh +%{_libdir}/%{_mingw32_target}-ocaml/libvirt/ + + +%changelog +* Sun Nov 16 2008 Richard W.M. Jones - 0.4.4.2-1 +- Initial RPM release. -- 1.8.3.1