Hostinfo day 6: RPM packaging, initscripts, hostinfo-status, hostinfo-test.
[virt-hostinfo.git] / virt-hostinfo.spec.in
diff --git a/virt-hostinfo.spec.in b/virt-hostinfo.spec.in
new file mode 100644 (file)
index 0000000..b209802
--- /dev/null
@@ -0,0 +1,149 @@
+Summary:       Access host information and statistics from virtual machines
+Name:          virt-hostinfo
+Version:       @VERSION@
+Release:       1%{?dist}
+License:       GPLv2+
+Group:         System Environment/Daemons
+URL:           http://et.redhat.com/~rjones/hostinfo/
+Source0:       http://et.redhat.com/~rjones/hostinfo/files/%{name}-%{version}.tar.gz
+BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root
+
+BuildRequires: apr-devel >= 1.3
+BuildRequires: perl
+BuildRequires: libvirt-devel >= 0.2.1
+BuildRequires: perl-Sys-Virt
+BuildRequires: perl-XML-XPath
+
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(preun): initscripts
+Requires(postun): initscripts
+
+Requires:      %{name}-tools = %{version}-%{release}
+
+
+%description
+Allow a virtual machine to look at host information (such as number of
+physical, not just virtual CPUs), and statistics like the load on the
+host. Users have asked for this primarily as a diagnostic tool -- for
+example, poor performance of a virtual machine might be caused by
+excessive load on the host.
+
+Normally we try to isolate virtual machines from accessing any such
+details from the host, and there are very good reasons for that too,
+such as security of the host, commercial confidentiality, and the
+privacy of other virtual machines running on the host. As a result, at
+the moment there is no mechanism for accessing host information.
+
+Hostinfo allows the host administrator, at their discretion, and only
+of limited data to limited virtual machines, to export host
+information and statistics to virtual machines.
+
+Administrators have to:
+
+ * explicitly enable this feature,
+ * select the virtual machines and/or data they wish to be seen in guests,
+ * select the frequency that guests can ask for data. 
+
+Hostinfo runs a daemon on the host which collects the statistics. The
+information will be exported to guests over a spare (virtual) serial
+port.
+
+Guests request information by sending a plain text command to the
+serial port, and receive information in the form of a simple, plain
+text message. No special drivers or software are required by the
+guest.
+
+
+%package tools
+Summary:       Hostinfo server configuration tools
+Group:         Applications/System
+
+
+%description tools
+This package contains server configuration tools for
+%{name}.
+
+
+%package client
+Summary:       Hostinfo client and test tools
+Group:         Applications/System
+
+
+%description client
+This package contains client and test tools for testing
+%{name}.
+
+It should be installed inside a virtual machine running on a
+hostinfo-enabled host.
+
+
+%prep
+%setup -q
+
+
+%build
+%{configure}
+make
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT install
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%post
+/sbin/chkconfig --add hostinfo
+
+
+%preun
+if [ $1 = 0 ] ; then
+  /sbin/service hostinfo stop >/dev/null 2>&1
+  /sbin/chkconfig --del hostinfo
+fi
+
+
+%postun
+if [ "$1" -ge "1" ] ; then
+  /sbin/service hostinfo condrestart >/dev/null 2>&1 || :
+fi
+
+
+%files
+%defattr(-,root,root,-)
+%doc COPYING README
+%dir %{_sysconfdir}/hostinfo
+%config(noreplace) %{_sysconfdir}/hostinfo/guests.conf
+%config(noreplace) %{_sysconfdir}/hostinfo/hostinfo.conf
+%{_sysconfdir}/init.d/hostinfo
+%config(noreplace) %{_sysconfdir}/sysconfig/hostinfod
+%{_sbindir}/hostinfod
+%{_mandir}/man5/hostinfo-protocol.5*
+%{_mandir}/man8/hostinfo.8*
+%{_mandir}/man8/hostinfod.8*
+%dir %attr(0775,root,qemu) %{_localstatedir}/lib/hostinfo
+
+
+%files tools
+%defattr(-,root,root,-)
+%doc COPYING
+%{_bindir}/hostinfo-set
+%{_bindir}/hostinfo-status
+%{_mandir}/man8/hostinfo-set.8*
+%{_mandir}/man8/hostinfo-status.8*
+
+
+%files client
+%defattr(-,root,root,-)
+%doc COPYING
+%{_bindir}/hostinfo-test
+%{_mandir}/man1/hostinfo-test.1*
+
+
+%changelog
+* Tue Aug 11 2009 Richard W.M. Jones <rjones@redhat.com> - @VERSION@-1
+- Initial RPM packaging.