| 1 |
# -*- rpm-spec -*- |
| 2 |
# Copyright (C) 2006 Daniel Berrange <[email protected]> |
| 3 |
# |
| 4 |
|
| 5 |
use strict; |
| 6 |
|
| 7 |
die unless (scalar @ARGV == 1); |
| 8 |
|
| 9 |
open PM, './lib/Sys/Virt.pm' or die "lib/Sys/Virt.pm: $!"; |
| 10 |
my $ver; |
| 11 |
while (<PM>) { |
| 12 |
if (/our \$VERSION = '(.*)'/) { |
| 13 |
$ver = $1; |
| 14 |
last; |
| 15 |
} |
| 16 |
} |
| 17 |
die "cannot find version" unless $ver; |
| 18 |
|
| 19 |
local $/ = undef; |
| 20 |
$_ = <DATA>; |
| 21 |
s/\@VERSION\@/$ver/g; |
| 22 |
|
| 23 |
open SPEC, ">$ARGV[0]" or die "$!"; |
| 24 |
print SPEC $_; |
| 25 |
close SPEC; |
| 26 |
__DATA__ |
| 27 |
# Automatically generated by perl-Sys-Virt.spec.PL |
| 28 |
|
| 29 |
Name: perl-Sys-Virt |
| 30 |
Version: @VERSION@ |
| 31 |
Release: 1%{?dist} |
| 32 |
Summary: Represent and manage a libvirt hypervisor connection |
| 33 |
License: GPL-2.0-or-later or Artistic-1.0-Perl |
| 34 |
URL: https://metacpan.org/release/Sys-Virt |
| 35 |
Source0: https://cpan.metacpan.org/authors/id/D/DA/DANBERR/Sys-Virt-v%{version}.tar.gz |
| 36 |
# Build |
| 37 |
BuildRequires: coreutils |
| 38 |
BuildRequires: findutils |
| 39 |
BuildRequires: gcc |
| 40 |
BuildRequires: libvirt-devel >= %{version} |
| 41 |
BuildRequires: make |
| 42 |
BuildRequires: perl-devel |
| 43 |
%if 0%{?fedora} || 0%{?rhel} > 7 |
| 44 |
BuildRequires: perl-interpreter |
| 45 |
BuildRequires: perl-generators |
| 46 |
%endif |
| 47 |
BuildRequires: perl(ExtUtils::CBuilder) |
| 48 |
BuildRequires: perl(Module::Build) |
| 49 |
BuildRequires: sed |
| 50 |
# Runtime |
| 51 |
BuildRequires: perl(overload) |
| 52 |
BuildRequires: perl(strict) |
| 53 |
BuildRequires: perl(warnings) |
| 54 |
BuildRequires: perl(XSLoader) |
| 55 |
# Tests only |
| 56 |
BuildRequires: perl(base) |
| 57 |
BuildRequires: perl(Sys::Hostname) |
| 58 |
BuildRequires: perl(Test::More) |
| 59 |
BuildRequires: perl(Time::HiRes) |
| 60 |
BuildRequires: perl(XML::XPath) |
| 61 |
BuildRequires: perl(XML::XPath::XMLParser) |
| 62 |
# Optional tests only |
| 63 |
BuildRequires: perl(Test::CPAN::Changes) |
| 64 |
BuildRequires: perl(Test::Pod) >= 1.00 |
| 65 |
BuildRequires: perl(Test::Pod::Coverage) >= 1.00 |
| 66 |
BuildRequires: git |
| 67 |
Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version)) |
| 68 |
|
| 69 |
%description |
| 70 |
The Sys::Virt module provides a Perl XS binding to the libvirt virtual |
| 71 |
machine management APIs. This allows machines running within arbitrary |
| 72 |
virtualization containers to be managed with a consistent API. |
| 73 |
|
| 74 |
%prep |
| 75 |
%autosetup -S git -n Sys-Virt-v%{version} |
| 76 |
|
| 77 |
|
| 78 |
%build |
| 79 |
%{__perl} Build.PL installdirs=vendor |
| 80 |
./Build |
| 81 |
|
| 82 |
%install |
| 83 |
./Build install destdir=$RPM_BUILD_ROOT create_packlist=0 |
| 84 |
|
| 85 |
%{_fixperms} $RPM_BUILD_ROOT/* |
| 86 |
|
| 87 |
%check |
| 88 |
./Build test |
| 89 |
|
| 90 |
%files |
| 91 |
%license LICENSE LICENSE.GPL LICENSE.Artistic |
| 92 |
%doc AUTHORS Changes README examples/ |
| 93 |
%{perl_vendorarch}/auto/* |
| 94 |
%{perl_vendorarch}/Sys* |
| 95 |
%{_mandir}/man3/* |
| 96 |
|
| 97 |
%changelog |