%define name @PACKAGE@
%define version @PACKAGE_VERSION@
%define release 1

Name:		%{name}
Summary:	Detects several virtualizations
Version:	%{version}
Release:	%{release}
URL:		http://micky.ibh.net/~liske/imvirt.html
Source0:	http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.gz
License:	GPLv2+
Group:		Applications/System
Requires:	perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
BuildRequires:	perl(ExtUtils::MakeMaker)
Buildroot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Vendor:		IBH IT-Service GmbH (http://www.ibh.de/)

%description

This little Perl script tries to detect if it is called from within 
a virtualization container. This is detected by looking for well known boot 
messages, directories and reading DMI (Desktop Management Interface) data.

The following containers are detected:

    * ARAnyM
    * KVM
    * lguest
    * LXC
    * OpenVZ/Virtuozzo
    * QEMU
    * UML
    * VMware GSX, ESX, Workstation
    * Virtual PC/Virtual Server
    * VirtualBox
    * Xen (para and non-para virtualized)
    * any HVM providing CPUID 0x40000000 detection

%prep
%setup -q

%build

%configure --prefix=%{_prefix} --libexec=%{_libexecdir}/imvirt
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

rm $RPM_BUILD_ROOT%{perl_vendorarch}/auto/ImVirt/.packlist
rm $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod

%check
#make check

%clean
rm -rf $RPM_BUILD_ROOT
make clean

%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_sbindir}/*
%dir %{_libexecdir}/imvirt
%{_libexecdir}/imvirt/*
%doc AUTHORS COPYING ChangeLog README
%{_mandir}/man1/*.1*
%{_mandir}/man3/*.3*
%{perl_vendorlib}/*
