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