985088
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
985088
%global debug_package %{nil}
985088
985088
Name:           virt-top
985088
Version:        1.0.8
985088
Release:        24%{?dist}
985088
Summary:        Utility like top(1) for displaying virtualization stats
985088
License:        GPLv2+
985088
985088
URL:            http://people.redhat.com/~rjones/virt-top/
985088
Source0:        http://people.redhat.com/~rjones/virt-top/files/%{name}-%{version}.tar.gz
985088
985088
ExcludeArch:    s390
985088
985088
%if 0%{?rhel} >= 6
985088
# Post-process output of CSV file (RHBZ#665817, RHBZ#912020).
985088
Source1:        processcsv.py
985088
Source2:        processcsv.py.pod
985088
985088
Patch0:         virt-top-1.0.4-processcsv-documentation.patch
985088
%endif
985088
985088
# All upstream patches since 1.0.8.
985088
Patch0001:      0001-Disable-warning-about-immutable-strings-for-OCaml-4..patch
985088
Patch0002:      0002-Move-upstream-translations-from-Tranifex-to-Zanata.patch
985088
Patch0003:      0003-Update-translations-from-Zanata.patch
985088
Patch0004:      0004-build-Add-g-flag-to-ocamlopt.patch
985088
Patch0005:      0005-Rename-source-directory-and-files.patch
985088
Patch0006:      0006-Enable-same-warnings-as-libguestfs.patch
985088
Patch0007:      0007-Remove-x-executable-permission-on-several-source-fil.patch
985088
Patch0008:      0008-Refresh-HACKING-file.patch
985088
Patch0009:      0009-Fix-po-POTFILES-for-new-location-of-source-files.patch
985088
Patch0010:      0010-Update-PO-files.patch
985088
Patch0011:      0011-Remove-support-for-OCaml-Calendar-v1.patch
985088
Patch0012:      0012-src-Fix-some-comments-which-referred-to-the-old-file.patch
985088
Patch0013:      0013-Split-up-huge-Top-module-into-smaller-modules.patch
985088
Patch0014:      0014-Move-block_in_bytes-entirely-to-the-presentation-lay.patch
985088
Patch0015:      0015-Remove-unused-variable-is_calendar2.patch
985088
Patch0016:      0016-Use-virConnectGetAllDomainStats-API-to-collect-domai.patch
985088
Patch0017:      0017-chmod-x-COPYING-files.patch
985088
985088
# Update configure for aarch64 (bz #926701)
985088
Patch9999:      virt-top-aarch64.patch
985088
985088
# The patches touch configure.ac:
985088
BuildRequires:  autoconf
985088
985088
BuildRequires:  ocaml >= 3.10.2
985088
BuildRequires:  ocaml-ocamldoc
985088
BuildRequires:  ocaml-findlib-devel
985088
# Need the ncurses / ncursesw (--enable-widec) fix.
985088
BuildRequires:  ocaml-curses-devel >= 1.0.3-7
985088
# Still doesn't pull in libcursesw.so unless we do:
985088
BuildRequires:  ncurses-devel
985088
BuildRequires:  ocaml-extlib-devel
985088
BuildRequires:  ocaml-xml-light-devel
985088
BuildRequires:  ocaml-csv-devel
985088
BuildRequires:  ocaml-calendar-devel
985088
# Need support for virDomainGetCPUStats (fixed in 0.6.1.2)
985088
# and virConnectGetAllDomainStats (post-0.6.1.4).
985088
BuildRequires:  ocaml-libvirt-devel >= 0.6.1.4-15
985088
985088
# Tortuous list of BRs for gettext.
985088
BuildRequires:  ocaml-gettext-devel >= 0.3.3
985088
BuildRequires:  ocaml-fileutils-devel
985088
# For msgfmt:
985088
BuildRequires:  gettext
985088
985088
# Non-OCaml BRs.
985088
BuildRequires:  libvirt-devel
985088
BuildRequires:  perl
985088
BuildRequires:  perl(Pod::Perldoc)
985088
BuildRequires:  gawk
985088
985088
%ifarch ppc
985088
BuildRequires:  /usr/bin/execstack
985088
%endif
985088
985088
985088
%description
985088
virt-top is a 'top(1)'-like utility for showing stats of virtualized
985088
domains.  Many keys and command line options are the same as for
985088
ordinary 'top'.
985088
985088
It uses libvirt so it is capable of showing stats across a variety of
985088
different virtualization systems.
985088
985088
985088
%prep
985088
%setup -q
985088
985088
%if 0%{?rhel} >= 6
985088
%patch0 -p1
985088
%endif
985088
985088
%patch0001 -p1
985088
%patch0002 -p1
985088
%patch0003 -p1
985088
%patch0004 -p1
985088
%patch0005 -p1
985088
%patch0006 -p1
985088
%patch0007 -p1
985088
%patch0008 -p1
985088
%patch0009 -p1
985088
%patch0010 -p1
985088
%patch0011 -p1
985088
%patch0012 -p1
985088
%patch0013 -p1
985088
%patch0014 -p1
985088
%patch0015 -p1
985088
%patch0016 -p1
985088
%patch0017 -p1
985088
985088
# Update configure for aarch64 (bz #926701)
985088
%patch9999 -p1
985088
autoconf
985088
985088
985088
%build
985088
%configure
985088
make all
985088
%if %opt
985088
make opt
985088
strip src/virt-top.opt
985088
%endif
985088
985088
# Build translations.
985088
make -C po
985088
985088
# Force rebuild of man page.
985088
rm -f src/virt-top.1
985088
make -C src virt-top.1
985088
985088
%if 0%{?rhel} >= 6
985088
# Build processcsv.py.1.
985088
pod2man -c "Virtualization Support" --release "%{name}-%{version}" \
985088
  %{SOURCE2} > processcsv.py.1
985088
%endif
985088
985088
985088
%install
985088
make DESTDIR=$RPM_BUILD_ROOT install
985088
985088
# Install translations.
985088
mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale
985088
make -C po install PODIR="$RPM_BUILD_ROOT%{_datadir}/locale"
985088
%find_lang %{name}
985088
985088
# Install virt-top manpage by hand for now.
985088
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
985088
install -m 0644 src/virt-top.1 $RPM_BUILD_ROOT%{_mandir}/man1
985088
985088
%ifarch ppc
985088
# Clear executable stack flag.  This is a bug in the OCaml
985088
# compiler on ppc.
985088
# https://bugzilla.redhat.com/show_bug.cgi?id=605124
985088
# http://caml.inria.fr/mantis/view.php?id=4564
985088
execstack -c $RPM_BUILD_ROOT%{_bindir}/virt-top
985088
%endif
985088
985088
%if 0%{?rhel} >= 6
985088
# Install processcsv.py.
985088
install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}
985088
985088
# Install processcsv.py(1).
985088
install -m 0644 processcsv.py.1 $RPM_BUILD_ROOT%{_mandir}/man1/
985088
%endif
985088
985088
985088
%files -f %{name}.lang
985088
%doc COPYING README TODO ChangeLog
985088
%{_bindir}/virt-top
985088
%{_mandir}/man1/virt-top.1*
985088
%if 0%{?rhel} >= 6
985088
%{_bindir}/processcsv.py
985088
%{_mandir}/man1/processcsv.py.1*
985088
%endif
985088
985088
985088
%changelog
985088
* Fri Oct 20 2017 Richard W.M. Jones <rjones@redhat.com> - 1.0.8-24
985088
- Enable s390x architecture
985088
  resolves: rhbz#1483875
985088
985088
* Wed Mar 29 2017 Richard W.M. Jones <rjones@redhat.com> - 1.0.8-23
985088
- Use libvirt virConnectGetAllDomainStats API for better performance, accuracy
985088
- Include all changes from Fedora Rawhide
985088
  resolves: rhbz#1422795
985088
985088
* Wed Aug 20 2014 Richard W.M. Jones <rjones@redhat.com> - 1.0.8-8
985088
- Explicitly BR ncurses-devel to pull in libcursesw.so.
985088
- Resolves: rhbz#1125708
985088
985088
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.0.8-7
985088
- Mass rebuild 2013-12-27
985088
985088
* Mon Jul 29 2013 Richard W.M. Jones <rjones@redhat.com> - 1.0.8-6
985088
- Include processcsv.py script and man page, but on RHEL only
985088
  (RHBZ#665817, RHBZ#912020)
985088
- Clear executable stack flag on PPC, PPC64 (RHBZ#605124).
985088
985088
* Fri Jun 28 2013 Cole Robinson <crobinso@redhat.com> - 1.0.8-5
985088
- Update configure for aarch64 (bz #926701)
985088
985088
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.8-4
985088
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
985088
985088
* Fri Dec 14 2012 Richard W.M. Jones <rjones@redhat.com> - 1.0.8-3
985088
- Rebuild for OCaml 4.00.1.
985088
985088
* Fri Oct 12 2012 Richard W.M. Jones <rjones@redhat.com> - 1.0.8-2
985088
- New upstream version 1.0.8.
985088
- Requires tiny change to ocaml-libvirt, hence dep bump.
985088
- Clean up the spec file.
985088
- Remove explicit BR ocaml-camomile (not used AFAIK).
985088
985088
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.7-3
985088
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
985088
985088
* Fri Mar 23 2012 Richard W.M. Jones <rjones@redhat.com> - 1.0.7-2
985088
- Require fixed ocaml-libvirt.
985088
985088
* Tue Mar  6 2012 Richard W.M. Jones <rjones@redhat.com> - 1.0.7-1
985088
- New upstream version 1.0.7.
985088
- Includes true physical CPU reporting (when libvirt supports this).
985088
985088
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.6-2
985088
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
985088
985088
* Fri Aug 12 2011 Richard W.M. Jones <rjones@redhat.com> - 1.0.6-1
985088
- New upstream version 1.0.6.
985088
985088
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.5-2
985088
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
985088
985088
* Thu Jan  6 2011 Richard W.M. Jones <rjones@redhat.com> - 1.0.5-1
985088
- New upstream version 1.0.5.
985088
- Rebuild against OCaml 3.12.0.
985088
- Project website moved to people.redhat.com.
985088
- Remove upstream patches.
985088
985088
* Wed Dec 30 2009 Richard W.M. Jones <rjones@redhat.com> - 1.0.4-3
985088
- Force rebuild against latest ocaml-gettext 0.3.3 (RHBZ#508197#c10).
985088
985088
* Mon Oct  5 2009 Richard W.M. Jones <rjones@redhat.com> - 1.0.4-2
985088
- New upstream release 1.0.4.
985088
- Includes new translations (RHBZ#493799).
985088
- Overall hardware memory is now displayed in CSV file (RHBZ#521785).
985088
- Several fixes to Japanese support (RHBZ#508197).
985088
- Japanese PO file also has bogus plural forms.
985088
- Additional BR on gettext (for msgfmt).
985088
985088
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-5
985088
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
985088
985088
* Thu Apr 16 2009 S390x secondary arch maintainer <fedora-s390x@lists.fedoraproject.org>
985088
- ExcludeArch sparc64, s390, s390x as we don't have OCaml on those archs
985088
  (added sparc64 per request from the sparc maintainer)
985088
985088
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-4
985088
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
985088
985088
* Wed Nov 26 2008 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-3
985088
- Rebuild for OCaml 3.11.0+rc1.
985088
985088
* Tue Oct 21 2008 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-2
985088
- Fix incorrect sources file.
985088
- Remove bogus Plural-Forms line from zh_CN PO file.
985088
985088
* Tue Oct 21 2008 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-1
985088
- New upstream version 1.0.3.
985088
985088
* Mon May 19 2008 Richard W.M. Jones <rjones@redhat.com> - 1.0.1-2
985088
- Use RPM percent-configure.
985088
- Add list of BRs for gettext.
985088
- Use find_lang to find PO files.
985088
- Comment out the OCaml dependency generator.  Not a library so not
985088
  needed.
985088
985088
* Thu May  1 2008 Richard W.M. Jones <rjones@redhat.com> - 1.0.1-1
985088
- New upstream release 1.0.1.
985088
- Don't BR ocaml-gettext-devel, it's not used at the moment.
985088
- Don't gzip the manpage, it happens automatically.
985088
- Add BR libvirt-devel.
985088
- Remove spurious executable bit on COPYING.
985088
985088
* Thu Apr 17 2008 Richard W.M. Jones <rjones@redhat.com> - 1.0.0-2
985088
- New upstream release 1.0.0.
985088
- Force rebuild of manpage.
985088
985088
* Tue Mar 18 2008 Richard W.M. Jones <rjones@redhat.com> - 0.4.1.1-1
985088
- New upstream release 0.4.1.1.
985088
- Move configure to build section.
985088
- Pass RPM_OPT_FLAGS.
985088
985088
* Tue Mar  4 2008 Richard W.M. Jones <rjones@redhat.com> - 0.4.1.0-2
985088
- Fix source URL.
985088
- Install virt-df manpage.
985088
985088
* Tue Mar  4 2008 Richard W.M. Jones <rjones@redhat.com> - 0.4.1.0-1
985088
- New upstream release 0.4.1.0.
985088
- Upstream now requires ocaml-dbus >= 0.06, ocaml-lablgtk >= 2.10.0,
985088
  ocaml-dbus-devel.
985088
- Enable virt-df.
985088
985088
* Sat Mar  1 2008 Richard W.M. Jones <rjones@redhat.com> - 0.4.0.3-3
985088
- Rebuild for ppc64.
985088
985088
* Wed Feb 13 2008 Richard W.M. Jones <rjones@redhat.com> - 0.4.0.3-2
985088
- Add BR gtk2-devel
985088
985088
* Tue Feb 12 2008 Richard W.M. Jones <rjones@redhat.com> - 0.4.0.3-1
985088
- New upstream version 0.4.0.3.
985088
- Rebuild for OCaml 3.10.1.
985088
985088
* Tue Nov 20 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.3.4-1
985088
- New upstream release 0.3.3.4.
985088
- Upstream website is now http://libvirt.org/ocaml/
985088
985088
* Fri Oct 19 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.3.0-2
985088
- Mistake: BR is ocaml-calendar-devel.
985088
985088
* Fri Oct 19 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.3.0-1
985088
- New upstream release 0.3.3.0.
985088
- Added support for virt-df, but disabled it by default.
985088
- +BR ocaml-calendar.
985088
985088
* Mon Sep 24 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.8-1
985088
- New upstream release 0.3.2.8.
985088
985088
* Thu Sep 20 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.7-1
985088
- New upstream release 0.3.2.7.
985088
- Ship the upstream ChangeLog file.
985088
985088
* Thu Sep  6 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.6-2
985088
- Force dependency on ocaml >= 3.10.0-7 which has fixed requires/provides
985088
  scripts.
985088
985088
* Thu Sep  6 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.6-1
985088
- New upstream version 0.3.2.6.
985088
985088
* Wed Aug 29 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.5-1
985088
- New upstream version 0.3.2.5.
985088
- Keep TODO out of the main package, but add (renamed) TODO.libvirt and
985088
  TODO.virt-top to the devel and virt-top packages respectively.
985088
- Add BR gawk.
985088
985088
* Thu Aug 23 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.4-1
985088
- New upstream version 0.3.2.4.
985088
985088
* Thu Aug 23 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.3-2
985088
- build_* macros so we can choose what subpackages to build.
985088
985088
* Thu Aug 23 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.3-1
985088
- Upstream version 0.3.2.3.
985088
- Add missing BR libvirt-devel.
985088
985088
* Wed Aug 22 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.2-1
985088
- Upstream version 0.3.2.2.
985088
985088
* Wed Aug 22 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.1-2
985088
- Fix unclosed if-statement in spec file.
985088
985088
* Wed Aug 22 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.2.1-1
985088
- Upstream version 0.3.2.1.
985088
- Put HTML documentation in -devel package.
985088
985088
* Mon Aug  6 2007 Richard W.M. Jones <rjones@redhat.com> - 0.3.1.2-1
985088
- Initial RPM release.