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

use strict;

die unless (scalar @ARGV == 1);

my $VERSION;
open PM, 'lib/Sys/Virt/TCK.pm';
while (<PM>) {
12
    if (/\$VERSION\s*=\s*'v(.*)'/) {
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
        $VERSION=$1;
    }
}

local $/ = undef;
$_ = <DATA>;
s/\@VERSION\@/$VERSION/g;

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

%define perlvendorarch %(perl -e 'use Config; print $Config{installvendorarch}')
%define perlvendorlib %(perl -e 'use Config; print $Config{installvendorlib}')
%define perlvendorprefix %(perl -e 'use Config; print $Config{vendorprefix}')
%define perlvendorman1 %{perlvendorprefix}/share/man/man1
%define perlvendorman3 %{perlvendorprefix}/share/man/man3
%define perlversion %(perl -e 'use Config; print $Config{version}')

%define appname Sys-Virt-TCK

Summary: Sys::Virt::TCK - libvirt Technology Compatibility Kit
Name: perl-%{appname}
Version: @VERSION@
39
Release: 1
40 41
License: GPLv2
Group: Development/Tools
42
Source: http://libvirt.org/sources/tck/%{appname}-v%{version}.tar.gz
43 44
Url: http://libvirt.org/
BuildRoot: %{_tmppath}/%{appname}-%{version}-%{release}-root-%(%{__id_u} -n)
45
Requires: perl >= %{perlversion}
46
Requires: libvirt >= 0.6.2
47 48 49 50 51 52 53
BuildRequires: perl(accessors)
BuildRequires: perl(App::Prove)
BuildRequires: perl(Config::Record)
BuildRequires: perl(Cwd)
BuildRequires: perl(File::Spec::Functions)
BuildRequires: perl(File::Copy)
BuildRequires: perl(File::Path)
54
BuildRequires: perl(File::Slurp)
55 56
BuildRequires: perl(LWP::UserAgent)
BuildRequires: perl(IO::String)
57 58
BuildRequires: perl(IO::Uncompress::Gunzip)
BuildRequires: perl(IO::Uncompress::Bunzip2)
59
BuildRequires: perl(Module::Build)
60
BuildRequires: perl(TAP::Formatter::HTML)
61
BuildRequires: perl(TAP::Formatter::JUnit)
62 63
BuildRequires: perl(TAP::Harness)
BuildRequires: perl(TAP::Harness::Archive)
64
BuildRequires: perl(Test::Builder)
65
BuildRequires: perl(Test::More)
66
BuildRequires: perl(Sub::Uplevel)
67
BuildRequires: perl(Sys::Virt) >= 0.2.0
68 69
BuildRequires: perl(XML::Twig)
BuildRequires: perl(XML::Writer)
70 71 72
# RPM autoprovides misses these 3
Requires: perl(Test::Exception)
Requires: perl(TAP::Formatter::HTML)
73
Requires: perl(TAP::Formatter::JUnit)
74
Requires: perl(TAP::Harness::Archive)
75
Requires: perl(Net::OpenSSH)
Laine Stump's avatar
Laine Stump committed
76
Requires: perl(IO::Pty)
77
Requires: libguestfs-tools
78
Requires: /usr/bin/mkisofs
79
BuildArchitectures: noarch
80 81 82 83 84 85 86

%description
Sys::Virt::TCK provides an integration test suite for validating
correct operation of libvirt drivers with underlying virtualization
technology.

%prep
87
%setup -q -n %{appname}-v%{version}
88 89 90 91 92 93 94 95 96 97


%build
%{__perl} Build.PL installdirs=vendor
./Build

%install
rm -rf $RPM_BUILD_ROOT
./Build install destdir=$RPM_BUILD_ROOT create_packlist=0 \
  --install_path conf=%{_sysconfdir}/libvirt-tck \
98
  --install_path pkgdata=%{_datadir}/libvirt-tck/tests
99 100 101 102 103

find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;

%{_fixperms} $RPM_BUILD_ROOT/*

104
%__install -m 0755 -d $RPM_BUILD_ROOT%{_localstatedir}/cache/libvirt-tck
105

106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
#%doc AUTHORS
%doc LICENSE
%doc README
#%doc INSTALL
%dir %{_sysconfdir}/libvirt-tck
%config(noreplace) %{_sysconfdir}/libvirt-tck/default.cfg
%{_bindir}/libvirt-tck
%dir %{_datadir}/libvirt-tck
%{_datadir}/libvirt-tck/*
%{perlvendorman1}/*
#%{perlvendorman3}/*
%{perlvendorlib}/Sys/Virt/TCK.pm
%{perlvendorlib}/Sys/Virt/TCK/
125
%dir %{_localstatedir}/cache/libvirt-tck
126 127 128 129

%changelog
* Fri Mar 24 2006  <berrange@redhat.com> - 0.0.1-1
- Initial build