From d6b713a612361c4a68cb756c10e1a002847c821c7797e3c446c7aef9c53068a2 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 8 Dec 2014 08:37:53 +0000 Subject: [PATCH] Accepting request 264220 from home:mlatimer:td Add package to satisfy build requirement for virt-top (FATE#318226) OBS-URL: https://build.opensuse.org/request/show/264220 OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/ocaml-libvirt?expand=0&rev=1 --- .gitattributes | 23 ++++ .gitignore | 1 + ...-int64_t-instead-of-OCaml-defined-an.patch | 35 ++++++ ocaml-libvirt-0.6.1.4.tar.gz | 3 + ocaml-libvirt.changes | 5 + ocaml-libvirt.spec | 104 ++++++++++++++++++ 6 files changed, 171 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-Use-C99-standard-int64_t-instead-of-OCaml-defined-an.patch create mode 100644 ocaml-libvirt-0.6.1.4.tar.gz create mode 100644 ocaml-libvirt.changes create mode 100644 ocaml-libvirt.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-Use-C99-standard-int64_t-instead-of-OCaml-defined-an.patch b/0001-Use-C99-standard-int64_t-instead-of-OCaml-defined-an.patch new file mode 100644 index 0000000..4174b2c --- /dev/null +++ b/0001-Use-C99-standard-int64_t-instead-of-OCaml-defined-an.patch @@ -0,0 +1,35 @@ +From 21ac993da0a187821e812fe7b5b31a426121a546 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 30 Aug 2014 19:10:19 +0100 +Subject: [PATCH] Use C99 standard int64_t instead of OCaml defined (and soon + to go) int64. + +--- + libvirt/libvirt_c_oneoffs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libvirt/libvirt_c_oneoffs.c b/libvirt/libvirt_c_oneoffs.c +index 3bb572f..06b3852 100644 +--- a/libvirt/libvirt_c_oneoffs.c ++++ b/libvirt/libvirt_c_oneoffs.c +@@ -140,7 +140,7 @@ ocaml_libvirt_connect_node_get_free_memory (value connv) + NONBLOCKING (r = virNodeGetFreeMemory (conn)); + CHECK_ERROR (r == 0, conn, "virNodeGetFreeMemory"); + +- rv = caml_copy_int64 ((int64) r); ++ rv = caml_copy_int64 ((int64_t) r); + CAMLreturn (rv); + } + +@@ -161,7 +161,7 @@ ocaml_libvirt_connect_node_get_cells_free_memory (value connv, + + rv = caml_alloc (r, 0); + for (i = 0; i < r; ++i) { +- iv = caml_copy_int64 ((int64) freemems[i]); ++ iv = caml_copy_int64 ((int64_t) freemems[i]); + Store_field (rv, i, iv); + } + +-- +2.0.4 + diff --git a/ocaml-libvirt-0.6.1.4.tar.gz b/ocaml-libvirt-0.6.1.4.tar.gz new file mode 100644 index 0000000..2e49ad2 --- /dev/null +++ b/ocaml-libvirt-0.6.1.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d36d57dbc9280881e5362f562d4ca7c7881e8ec9ff1954eb064acc9ccf0021b +size 136023 diff --git a/ocaml-libvirt.changes b/ocaml-libvirt.changes new file mode 100644 index 0000000..661bf3e --- /dev/null +++ b/ocaml-libvirt.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Fri Dec 5 18:17:39 UTC 2014 - mlatimer@suse.com + +- Initial commit using version 0.6.1.4 + diff --git a/ocaml-libvirt.spec b/ocaml-libvirt.spec new file mode 100644 index 0000000..f42e35e --- /dev/null +++ b/ocaml-libvirt.spec @@ -0,0 +1,104 @@ +# +# spec file for package ocaml-libvirt +# +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) + +Name: ocaml-libvirt +Version: 0.6.1.4 +Release: 0 +Summary: OCaml binding for libvirt +License: LGPL-2.0+ +Group: Development/Libraries/Other +Url: http://libvirt.org/ocaml/ +Source0: http://libvirt.org/sources/ocaml/%{name}-%{version}.tar.gz +# Upstream patch to fix int types. +Patch1: 0001-Use-C99-standard-int64_t-instead-of-OCaml-defined-an.patch +BuildRequires: gawk +# 0.9.10-3 contains virDomainGetCPUStats API, but not the qemu driver. +BuildRequires: libvirt-devel >= 0.9.10-3 +BuildRequires: ocaml >= 3.10.0 +BuildRequires: ocaml-findlib-devel +BuildRequires: ocaml-ocamldoc +BuildRequires: perl +Requires: libvirt-client >= 0.9.10-3 +BuildRoot: %{_tmppath}/%{name}-%{version}-build +ExcludeArch: sparc64 s390 s390x + +%description +OCaml binding for libvirt. + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and signature files for +developing applications that use %{name}. + +%prep +%setup -q +%patch1 -p1 + + +%build +%configure +make %{?_smp_mflags} all doc +%if %{opt} +make %{?_smp_mflags} opt +%endif + + +%install +# These rules work if the library uses 'ocamlfind install' to install itself. +export DESTDIR=%{buildroot} +export OCAMLFIND_DESTDIR=%{buildroot}%{_libdir}/ocaml +mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs +mkdir -p %{buildroot}%{_bindir} +%if %{opt} +make install-opt +%else +make install-byte +%endif + + + +%files +%defattr(-,root,root,-) +%doc COPYING.LIB README ChangeLog +%{_libdir}/ocaml/libvirt +%if %{opt} +%exclude %{_libdir}/ocaml/libvirt/*.a +%exclude %{_libdir}/ocaml/libvirt/*.cmxa +%exclude %{_libdir}/ocaml/libvirt/*.cmx +%endif +%exclude %{_libdir}/ocaml/libvirt/*.mli +%{_libdir}/ocaml/stublibs/*.so +%{_libdir}/ocaml/stublibs/*.so.owner + +%files devel +%defattr(-,root,root,-) +%doc COPYING.LIB README TODO.libvirt ChangeLog html/* +%if %{opt} +%{_libdir}/ocaml/libvirt/*.a +%{_libdir}/ocaml/libvirt/*.cmxa +%{_libdir}/ocaml/libvirt/*.cmx +%endif +%{_libdir}/ocaml/libvirt/*.mli + +%changelog