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
This commit is contained in:
Olaf Hering 2014-12-08 08:37:53 +00:00 committed by Git OBS Bridge
commit d6b713a612
6 changed files with 171 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -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

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,35 @@
From 21ac993da0a187821e812fe7b5b31a426121a546 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4d36d57dbc9280881e5362f562d4ca7c7881e8ec9ff1954eb064acc9ccf0021b
size 136023

5
ocaml-libvirt.changes Normal file
View File

@ -0,0 +1,5 @@
-------------------------------------------------------------------
Fri Dec 5 18:17:39 UTC 2014 - mlatimer@suse.com
- Initial commit using version 0.6.1.4

104
ocaml-libvirt.spec Normal file
View File

@ -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