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