perl-Sys-Virt.spec.PL 2.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
# -*- rpm-spec -*-
# Copyright (C) 2006 Daniel Berrange <dan@berrange.com>
#

use strict;

die unless (scalar @ARGV == 1);

unless (do 'lib/Sys/Virt.pm')
  {
    if ($@) { die $@ };
    die "lib/Sys/Virt.pm: $!";
  }
14

15 16 17 18 19 20 21 22 23 24
local $/ = undef;
$_ = <DATA>;
s/\@VERSION\@/$Sys::Virt::VERSION/g;

open SPEC, ">$ARGV[0]" or die "$!";
print SPEC $_;
close SPEC;
__DATA__
# Automatically generated by perl-Sys-Virt.spec.PL

25 26 27 28 29 30 31 32 33 34 35 36
Name:           perl-Sys-Virt
Version:        @VERSION@
Release:        1%{?dist}%{?extra_release}
Summary:        Represent and manage a libvirt hypervisor connection
License:        GPLv2+ or Artistic
Group:          Development/Libraries
URL:            http://search.cpan.org/dist/Sys-Virt/
Source0:        http://www.cpan.org/authors/id/D/DA/DANBERR/Sys-Virt-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(Test::Pod)
BuildRequires:  perl(Test::Pod::Coverage)
37
BuildRequires:  perl(Test::CPAN::Changes)
38
BuildRequires:  perl(XML::XPath)
39
BuildRequires:  perl(Time::HiRes)
40
BuildRequires:  libvirt-devel >= 0.9.13
41
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
42 43

%description
44 45 46
The Sys::Virt module provides a Perl XS binding to the libvirt virtual
machine management APIs. This allows machines running within arbitrary
virtualization containers to be managed with a consistent API.
47

48
%prep
49
%setup -q -n Sys-Virt-%{version}
50

51 52 53
sed -i -e '/Sys-Virt\.spec/d' Makefile.PL
sed -i -e '/\.spec\.PL$/d' MANIFEST
rm -f *.spec.PL
54 55

%build
56 57
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
make %{?_smp_mflags}
58 59 60

%install
rm -rf $RPM_BUILD_ROOT
61 62 63 64 65 66 67 68 69 70 71

make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT

find $RPM_BUILD_ROOT -type f \( -name .packlist -o -name '*.bs' -empty \) |
	xargs rm -f
find $RPM_BUILD_ROOT -depth -type d -empty -exec rmdir {} \;

%{_fixperms} $RPM_BUILD_ROOT/*

%check
make test
72 73 74 75 76

%clean
rm -rf $RPM_BUILD_ROOT

%files
77
%defattr(-,root,root,-)
78
%doc AUTHORS Changes LICENSE README examples/
79 80 81
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/Sys*
%{_mandir}/man3/*
82 83

%changelog