From 66ed11e802ce1ff17ffee49dea716d8e0466a17314dc73f2112783cf1321a980 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 8 Apr 2022 10:03:12 +0000 Subject: [PATCH] - New upstream version 1.1.1 - Use virt-top.patch to build with dune OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/virt-top?expand=0&rev=6 --- _service | 11 ++- virt-top-1.0.9.tar.xz | 3 - virt-top-1.1.1.tar.xz | 3 + virt-top.changes | 6 ++ virt-top.patch | 203 ++++++++++++++++++++++++++++++++++++++++++ virt-top.spec | 13 +-- 6 files changed, 226 insertions(+), 13 deletions(-) delete mode 100644 virt-top-1.0.9.tar.xz create mode 100644 virt-top-1.1.1.tar.xz create mode 100644 virt-top.patch diff --git a/_service b/_service index afd366a..1844071 100644 --- a/_service +++ b/_service @@ -1,10 +1,13 @@ - https://github.com/olafhering/virt-top.git - git - 1.0.9 - dune-wip virt-top + 6a45c04e27b942555e79f96f52e452e56d1aca97 + git + disable + git://git.annexia.org/virt-top.git + @PARENT_TAG@ + [v]?([^+]+)(.*) + \1 *.tar diff --git a/virt-top-1.0.9.tar.xz b/virt-top-1.0.9.tar.xz deleted file mode 100644 index cdd1da9..0000000 --- a/virt-top-1.0.9.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d07bd97c7ab47ad33c7f8233d14d8eff02a86cc054b36c8f9b0fa0d4d3d07e8c -size 72224 diff --git a/virt-top-1.1.1.tar.xz b/virt-top-1.1.1.tar.xz new file mode 100644 index 0000000..50b9aa7 --- /dev/null +++ b/virt-top-1.1.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:993b4a6aebc6be46589f0eb1b854ea0814e9679d4e17cded46e77f19ec1db995 +size 109004 diff --git a/virt-top.changes b/virt-top.changes index 98848a3..45117ac 100644 --- a/virt-top.changes +++ b/virt-top.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 4 04:04:04 UTC 2022 - ohering@suse.de + +- New upstream version 1.1.1 +- Use virt-top.patch to build with dune + ------------------------------------------------------------------- Mon Dec 2 01:23:45 UTC 2019 - olaf@aepfle.de diff --git a/virt-top.patch b/virt-top.patch new file mode 100644 index 0000000..504b185 --- /dev/null +++ b/virt-top.patch @@ -0,0 +1,203 @@ +--- /dev/null ++++ b/build.sh +@@ -0,0 +1,6 @@ ++set -ex ++pkg=virt-top ++DESTDIR=/dev/shm/$PPID ++dune build --verbose --for-release-of-packages=${pkg} @install ++dune install --verbose --for-release-of-packages=${pkg} --prefix=/usr --libdir=$(ocamlc -where) --destdir=${DESTDIR} ${pkg} ++find ${DESTDIR} -ls +--- /dev/null ++++ b/dune-project +@@ -0,0 +1,31 @@ ++(lang dune 1.11) ++ ++(version 1.1.1) ++ ++(generate_opam_files false) ++ ++(license "GPL-2.0-or-later") ++ ++(authors "Richard W.M. Jones ") ++ ++(maintainers "Richard W.M. Jones ") ++ ++(homepage "http://people.redhat.com/~rjones/virt-top/") ++ ++(source ++ (uri "git://git.annexia.org/virt-top.git")) ++ ++(package ++ (name virt-top) ++ (synopsis "top-like utility") ++ (description ++ "virt-top is a top-like utility for showing stats of virtualized domains. Many keys and command line options are the same as for ordinary top.") ++ (depends ++ (ocaml ++ (>= 4.02.0)) ++ (dune ++ (>= 1.11)) ++ calendar ++ curses ++ dune.configurator ++ gettext)) +--- /dev/null ++++ b/src/config/discover.ml +@@ -0,0 +1,25 @@ ++module C = Configurator.V1 ++ ++let () = ++ C.main ~name:"virt-top" (fun c -> ++ let no_pkgconfig : C.Pkg_config.package_conf = ++ { libs = [ "-lxml" ]; cflags = [] } ++ in ++ ++ let conf = ++ match C.Pkg_config.get c with ++ | None -> no_pkgconfig ++ | Some pc -> ( ++ match ++ C.Pkg_config.query_expr_err pc ~package:"libxml-2.0" ++ ~expr:"libxml-2.0" ++ with ++ | Ok c -> c ++ | Error err -> C.die "%s" err) ++ in ++ ++ let config_h = [] in ++ ++ C.C_define.gen_header_file c ~fname:"config.h" config_h; ++ C.Flags.write_sexp "c_flags.sexp" (List.rev_append [ "-I." ] conf.cflags); ++ C.Flags.write_sexp "c_library_flags.sexp" conf.libs) +--- /dev/null ++++ b/src/config/dune +@@ -0,0 +1,3 @@ ++(executable ++ (name discover) ++ (libraries dune.configurator)) +--- /dev/null ++++ b/src/dune +@@ -0,0 +1,51 @@ ++(library ++ (name xml) ++ (modules xml) ++ (libraries libvirt) ++ (c_names xml-c) ++ (c_flags ++ (:include c_flags.sexp)) ++ (c_library_flags ++ (:include c_library_flags.sexp))) ++ ++(executable ++ (name main) ++ (public_name virt-top) ++ (modules ++ collect ++ csv_output ++ main ++ opt_calendar ++ opt_gettext ++ redraw ++ screen ++ stream_output ++ top ++ types ++ utils ++ version) ++ (libraries calendar curses gettext gettext-stub libvirt str xml)) ++ ++(rule ++ (target version.ml) ++ (action ++ (write-file %{target} "let version = \"%{version:virt-top}\""))) ++ ++(rule ++ (targets c_flags.sexp c_library_flags.sexp config.h) ++ (deps ++ (:discover config/discover.exe)) ++ (action ++ (run %{discover}))) ++ ++(install ++ (files virt-top.1) ++ (section man) ++ (package virt-top)) ++ ++(rule ++ (target virt-top.1) ++ (deps virt-top.pod) ++ (action ++ (system ++ "pod2man -u -s 1 -c 'Virtualization Support' -r '%{version:virt-top}' %{deps} %{target}"))) +--- a/src/opt_calendar.ml ++++ b/src/opt_calendar.ml +@@ -25,7 +25,8 @@ open Printf + + open Opt_gettext.Gettext ;; + +-Top.parse_date_time := ++(* this is not optional *) ++let parse_date_time = + fun time -> + let cal : Calendar.t = + (* time is "+something" *) +--- /dev/null ++++ b/src/opt_calendar.mli +@@ -0,0 +1 @@ ++val parse_date_time : (string -> float) +--- /dev/null ++++ b/src/opt_gettext.ml +@@ -0,0 +1,9 @@ ++module Gettext = ++ Gettext.Program ++ (struct ++ let textdomain = "virt-top" ++ let codeset = None ++ let dir = None ++ let dependencies = Gettext.init ++ end) ++ (GettextStub.Native) +--- a/src/top.ml ++++ b/src/top.ml +@@ -20,6 +20,7 @@ + open Printf + open Curses + ++open Opt_calendar + open Opt_gettext.Gettext + open Utils + open Types +@@ -32,13 +33,6 @@ module N = Libvirt.Network + + let rcfile = ".virt-toprc" + +-(* Hook for calendar support (see [opt_calendar.ml]). *) +-let parse_date_time : (string -> float) ref = +- ref ( +- fun _ -> +- failwith (s_"virt-top was compiled without support for dates and times") +- ) +- + (* Init file. *) + type init_file = NoInitFile | DefaultInitFile | InitFile of string + +@@ -81,7 +75,7 @@ let start_up () = + csv_enabled := true + and no_init_file () = init_file := NoInitFile + and set_init_file filename = init_file := InitFile filename +- and set_end_time time = end_time := Some ((!parse_date_time) time) ++ and set_end_time time = end_time := Some ((Opt_calendar.parse_date_time) time) + and display_version () = + printf "virt-top %s ocaml-libvirt %s\n" + Version.version Libvirt_version.version; +--- a/src/top.mli ++++ b/src/top.mli +@@ -17,8 +17,5 @@ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *) + +-(* Hook for [Opt_calendar] to override (if present). *) +-val parse_date_time : (string -> float) ref +- + val start_up : unit -> Types.setup + val main_loop : Types.setup -> unit diff --git a/virt-top.spec b/virt-top.spec index 23f783d..3ac0b85 100644 --- a/virt-top.spec +++ b/virt-top.spec @@ -1,7 +1,7 @@ # # spec file for package virt-top # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: virt-top -Version: 1.0.9 +Version: 1.1.1 Release: 0 %{?ocaml_preserve_bytecode} Summary: Utility like top(1) for displaying virtualization stats @@ -25,18 +25,18 @@ License: GPL-2.0+ Group: System/Management Url: http://people.redhat.com/~rjones/virt-top/ Source0: %name-%version.tar.xz +Patch0: %name.patch BuildRequires: ocaml BuildRequires: ocaml-dune -BuildRequires: ocaml-rpm-macros >= 20191101 +BuildRequires: ocaml-rpm-macros >= 20220404 BuildRequires: ocamlfind(calendar) -BuildRequires: ocamlfind(csv) BuildRequires: ocamlfind(curses) -BuildRequires: ocamlfind(extlib) +BuildRequires: ocamlfind(dune.configurator) BuildRequires: ocamlfind(gettext) BuildRequires: ocamlfind(gettext-stub) BuildRequires: ocamlfind(libvirt) BuildRequires: ocamlfind(str) -BuildRequires: ocamlfind(xml-light) +BuildRequires: pkgconfig(libxml-2.0) %description virt-top is a 'top(1)'-like utility for showing stats of virtualized @@ -61,5 +61,6 @@ tee -a %name.files < %name.files.devel %files -f %name.files %_bindir/* +%_mandir/man1/* %changelog