Compare commits
40 commits
RELEASE_0.
...
master
Author | SHA1 | Date | |
---|---|---|---|
cbfad9f5ca | |||
e491d549e7 | |||
|
ae8b3ac2f8 | ||
|
9e62d29643 | ||
|
eaca7b7c4d | ||
|
1a27e209a0 | ||
|
dc1eda7b67 | ||
|
dd6cfc1536 | ||
|
623e7fc65c | ||
|
e229a81b61 | ||
|
e1dd92a4f9 | ||
|
b61e9b4921 | ||
|
f7c21bdcba | ||
|
529c06b04c | ||
|
5bfd739b70 | ||
|
e3115ec498 | ||
|
99838215e0 | ||
|
780b0b886f | ||
|
43d0bfc5d8 | ||
|
ef2401b092 | ||
|
674c06c6e8 | ||
|
939e064b5f | ||
|
7056412eb9 | ||
|
9385b387e7 | ||
|
403e46d5c5 | ||
|
d5485640fe | ||
|
0a28e9d9de | ||
|
2bb9c6db3b | ||
|
41dbc92154 | ||
|
c3d4d89430 | ||
|
2da809179d | ||
|
382aee5361 | ||
|
445e4b9833 | ||
|
50ef24bea6 | ||
|
f5f2dc448f | ||
|
a4d17346e2 | ||
|
2256f515aa | ||
|
eda3f47208 | ||
|
8c24ee285b | ||
|
ac8a2f3c00 |
15 changed files with 410 additions and 35 deletions
10
.github/dependabot.yml
vendored
Normal file
10
.github/dependabot.yml
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Set update schedule for GitHub Actions
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
# Check for updates to GitHub Actions every week
|
||||||
|
interval: "weekly"
|
21
.github/workflows/perltest.yml
vendored
Normal file
21
.github/workflows/perltest.yml
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
uses: PerlToolsTeam/github_workflows/.github/workflows/cpan-test.yml@main
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
uses: PerlToolsTeam/github_workflows/.github/workflows/cpan-coverage.yml@main
|
||||||
|
|
||||||
|
perlcritic:
|
||||||
|
uses: PerlToolsTeam/github_workflows/.github/workflows/cpan-perlcritic.yml@main
|
||||||
|
|
||||||
|
complexity:
|
||||||
|
uses: PerlToolsTeam/github_workflows/.github/workflows/cpan-complexity.yml@main
|
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
Parse-RPM-Spec-*.tar.gz
|
||||||
|
Parse-RPM-Spec/
|
||||||
|
Build
|
||||||
|
META.json
|
||||||
|
META.yml
|
||||||
|
MYMETA.json
|
||||||
|
MYMETA.yml
|
||||||
|
Makefile.PL
|
||||||
|
_build/
|
||||||
|
blib/
|
||||||
|
cover_db/
|
14
Build.PL
14
Build.PL
|
@ -11,12 +11,26 @@ my $build = Module::Build->new(
|
||||||
},
|
},
|
||||||
build_requires => {
|
build_requires => {
|
||||||
'Test::More' => 0,
|
'Test::More' => 0,
|
||||||
|
'Test::Exception' => 0,
|
||||||
},
|
},
|
||||||
build_recommends => {
|
build_recommends => {
|
||||||
'Test::Pod' => 0,
|
'Test::Pod' => 0,
|
||||||
'Test::Pod::Coverage' => 0,
|
'Test::Pod::Coverage' => 0,
|
||||||
},
|
},
|
||||||
create_makefile_pl => 'traditional',
|
create_makefile_pl => 'traditional',
|
||||||
|
meta_merge => {
|
||||||
|
'meta-spec' => { version => 2 },
|
||||||
|
resources => {
|
||||||
|
repository => {
|
||||||
|
type => 'git',
|
||||||
|
url => 'git://github.com/davorg-cpan/parse-rpm-spec.git',
|
||||||
|
web => 'https://github.com/davorg-cpan/parse-rpm-spec',
|
||||||
|
},
|
||||||
|
bugtracker => {
|
||||||
|
web => 'https://github.com/davorg-cpan/parse-rpm-spec/issues',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
$build->create_build_script;
|
$build->create_build_script;
|
||||||
|
|
109
Changes
Normal file
109
Changes
Normal file
|
@ -0,0 +1,109 @@
|
||||||
|
2023-01-13 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* Version 1.1.2
|
||||||
|
* Fix name of excludearch method (thanks Michal Josef Špaček)
|
||||||
|
|
||||||
|
2023-01-12 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* Version 1.1.1
|
||||||
|
* Fix problem parsing perl-License-Syntax.spec (thanks Michal Josef Špaček)
|
||||||
|
|
||||||
|
2022-12-09 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* Version 1.1.0
|
||||||
|
* Support ExcludeArch, ExclusiveArch, ExcluseOS, ExclusiveOS
|
||||||
|
|
||||||
|
2021-01-23 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* Version 1.0.3
|
||||||
|
* Add bugtracker to metadata
|
||||||
|
|
||||||
|
2020-11-04 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* Version 1.0.2
|
||||||
|
* Add Test::Exception to prereqs
|
||||||
|
|
||||||
|
2020-11-03 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* Version 1.0.1
|
||||||
|
* Improved tests
|
||||||
|
* Added links to Github repo
|
||||||
|
|
||||||
|
2017-06-23 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* lib/Parse/RPM/Spec.pm: Removed extra whitespace
|
||||||
|
|
||||||
|
2015-07-18 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* .gitignore, .travis.yml, MANIFEST.SKIP: Added .gitignore,
|
||||||
|
.travis.yml and MANIFEST.SKIP
|
||||||
|
|
||||||
|
2015-07-17 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* MANIFEST: Added META.yml to MANIFEST
|
||||||
|
|
||||||
|
2013-08-20 Justin Cook <jscook@users.noreply.github.com>
|
||||||
|
|
||||||
|
* lib/Parse/RPM/Spec.pm: Update Spec.pm Fixed a typo in POD
|
||||||
|
|
||||||
|
2011-10-03 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* lib/Parse/RPM/Spec.pm: Made the spec parser more configurable (and
|
||||||
|
a little more efficient).
|
||||||
|
* lib/Parse/RPM/Spec.pm: Fix typo in documentation.
|
||||||
|
|
||||||
|
2010-07-11 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* lib/Parse/RPM/Spec.pm: Fixed docs to reflect previous fix.
|
||||||
|
* lib/Parse/RPM/Spec.pm: Change Source to return an array of sources
|
||||||
|
(Thanks to Vadim Vatlin for the suggestion).
|
||||||
|
|
||||||
|
2010-02-17 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* lib/Parse/RPM/Spec.pm: Version 0.07
|
||||||
|
* lib/Parse/RPM/Spec.pm: Added some docs to placate
|
||||||
|
Test::Pod::Coverage.
|
||||||
|
|
||||||
|
2010-02-10 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* lib/Parse/RPM/Spec.pm: Bump to version 0.06.
|
||||||
|
* lib/Parse/RPM/Spec.pm, t/file.spec, t/parse-rpm-spec.t: Added
|
||||||
|
support for Epoch field. And tests for it.
|
||||||
|
|
||||||
|
2010-02-09 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* lib/Parse/RPM/Spec.pm: Bump version.
|
||||||
|
* lib/Parse/RPM/Spec.pm, t/parse-rpm-spec.t: Parse the summary
|
||||||
|
correctly. Added a test for that.
|
||||||
|
|
||||||
|
2009-10-27 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* Build.PL: Removed version defintion (use one from .pm)
|
||||||
|
* lib/Parse/RPM/Spec.pm, t/parse-rpm-spec.t: Version 0.04. Handle
|
||||||
|
BuildArch definition. Thanks to Steve Goldner for pointing out the
|
||||||
|
omission.
|
||||||
|
|
||||||
|
2009-08-30 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* Build.PL, lib/Parse/RPM/Spec.pm: Add Moose as a requirement. Bump
|
||||||
|
version number to 0.03 for release.
|
||||||
|
|
||||||
|
2009-07-25 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* lib/Parse/RPM/Spec.pm: Made file attribute mandatory.
|
||||||
|
* MANIFEST, t/{Parse-RPM-Spec.t => parse-rpm-spec.t}: Renamed test
|
||||||
|
file.
|
||||||
|
* t/pod.t, t/pod_coverage.t: Added pod tests.
|
||||||
|
* Build.PL: Bump version number.
|
||||||
|
* Changes: Removed generated file.
|
||||||
|
* README, README.xml: Changed README to text file.
|
||||||
|
* t/Parse-RPM-Spec.t: Changes to support the Moose version.
|
||||||
|
* lib/Parse/RPM/Spec.pm: Switch to using Moose.
|
||||||
|
|
||||||
|
2008-08-25 Dave Cross <dave@perlhacks.com>
|
||||||
|
|
||||||
|
* README, README.xml: Removed README and added README.xml
|
||||||
|
* MANIFEST: Various changes
|
||||||
|
* lib/Parse/RPM/Spec.pm: Added documentation
|
||||||
|
* Build.PL, Changes, MANIFEST, README, lib/Parse/RPM/Spec.pm, t
|
||||||
|
/Parse-RPM-Spec.t, t/file.spec: Initial revision
|
1
MANIFEST
1
MANIFEST
|
@ -9,3 +9,4 @@ t/file.spec
|
||||||
lib/Parse/RPM/Spec.pm
|
lib/Parse/RPM/Spec.pm
|
||||||
Makefile.PL
|
Makefile.PL
|
||||||
META.yml
|
META.yml
|
||||||
|
META.json
|
||||||
|
|
1
MANIFEST.SKIP
Normal file
1
MANIFEST.SKIP
Normal file
|
@ -0,0 +1 @@
|
||||||
|
^MYMETA.yml$
|
|
@ -7,9 +7,9 @@ use warnings;
|
||||||
use Carp;
|
use Carp;
|
||||||
use Moose;
|
use Moose;
|
||||||
|
|
||||||
our $VERSION = '0.07';
|
our $VERSION = 'v1.1.2';
|
||||||
|
|
||||||
has file => ( is => 'rw', isa => 'Str', required => 1 );
|
has file => ( is => 'ro', isa => 'Str', required => 1 );
|
||||||
has name => ( is => 'rw', isa => 'Str' );
|
has name => ( is => 'rw', isa => 'Str' );
|
||||||
has version => ( is => 'rw', isa => 'Str' );
|
has version => ( is => 'rw', isa => 'Str' );
|
||||||
has epoch => ( is => 'rw', isa => 'Str' );
|
has epoch => ( is => 'rw', isa => 'Str' );
|
||||||
|
@ -18,11 +18,45 @@ has summary => ( is => 'rw', isa => 'Str' );
|
||||||
has license => ( is => 'rw', isa => 'Str' );
|
has license => ( is => 'rw', isa => 'Str' );
|
||||||
has group => ( is => 'rw', isa => 'Str' );
|
has group => ( is => 'rw', isa => 'Str' );
|
||||||
has url => ( is => 'rw', isa => 'Str' );
|
has url => ( is => 'rw', isa => 'Str' );
|
||||||
has source => ( is => 'rw', isa => 'Str' );
|
has source => ( is => 'rw', isa => 'ArrayRef[Str]', default => sub { [] } );
|
||||||
has buildroot => ( is => 'rw', isa => 'Str' );
|
has buildroot => ( is => 'rw', isa => 'Str' );
|
||||||
has buildarch => ( is => 'rw', isa => 'Str' );
|
has buildarch => ( is => 'rw', isa => 'Str' );
|
||||||
has buildrequires => ( is => 'rw', isa => 'ArrayRef[Str]' );
|
has buildrequires => ( is => 'rw', isa => 'ArrayRef[Str]', default => sub { [] } );
|
||||||
has requires => ( is => 'rw', isa => 'ArrayRef[Str]' );
|
has requires => ( is => 'rw', isa => 'ArrayRef[Str]', default => sub { [] } );
|
||||||
|
has [ qw( excludearch exclusivearch excludeos exclusiveos ) ]
|
||||||
|
=> ( is => 'rw', isa => 'Str' );
|
||||||
|
|
||||||
|
has parse_spec => (
|
||||||
|
is => 'ro',
|
||||||
|
isa => 'HashRef',
|
||||||
|
lazy_build => 1,
|
||||||
|
);
|
||||||
|
|
||||||
|
sub _build_parse_spec {
|
||||||
|
return {
|
||||||
|
scalars => {
|
||||||
|
name => qr[^Name:\s+(\S+)],
|
||||||
|
version => qr[^Version:\s+(\S+)],
|
||||||
|
epoch => qr[^Epoch:\s+(\S+)],
|
||||||
|
release => qr[^Release:\s+(\S+)],
|
||||||
|
summary => qr[^Summary:\s+(.+)],
|
||||||
|
license => qr[^License:\s+(.+)],
|
||||||
|
group => qr[^Group:\s+(\S+)],
|
||||||
|
url => qr[^(?:URL|Url):\s+(\S+)],
|
||||||
|
buildroot => qr[^BuildRoot:\s+(\S+)],
|
||||||
|
buildarch => qr[^BuildArch:\s+(\S+)],
|
||||||
|
excludearch => qr[^ExcludeArch:\s+(\S+)],
|
||||||
|
exclusivearch => qr[^ExclusiveArch:\s+(\S+)],
|
||||||
|
excludeos => qr[^ExcludeOS:\s+(\S+)],
|
||||||
|
exclusiveos => qr[^ExclusiveOS:\s+(\S+)],
|
||||||
|
},
|
||||||
|
arrays => {
|
||||||
|
source => qr[^Source\d*:\s+(\S+)],
|
||||||
|
buildrequires => qr[^BuildRequires:\s+(.+)],
|
||||||
|
requires => qr[^Requires:\s+(.+)],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
sub BUILD {
|
sub BUILD {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
@ -55,23 +89,25 @@ sub parse_file {
|
||||||
croak "Spec file $file is empty\n";
|
croak "Spec file $file is empty\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
open my $fh, $file or croak "Cannot open $file: $!\n";
|
open my $fh, '<', $file or croak "Cannot open $file: $!\n";
|
||||||
|
|
||||||
while (<$fh>) {
|
my $scalars = $self->parse_spec->{scalars};
|
||||||
/^Name:\s*(\S+)/ and $self->{name} = $1;
|
my $arrays = $self->parse_spec->{arrays};
|
||||||
/^Version:\s*(\S+)/ and $self->{version} = $1;
|
|
||||||
/^Epoch:\s*(\S+)/ and $self->{epoch} = $1;
|
|
||||||
/^Release:\s*(\S+)/ and $self->{release} = $1;
|
|
||||||
/^Summary:\s*(.+)/ and $self->{summary} = $1;
|
|
||||||
/^License:\s*(.+)/ and $self->{license} = $1;
|
|
||||||
/^Group:\s*(\S+)/ and $self->{group} = $1;
|
|
||||||
/^URL:\s*(\S+)/ and $self->{url} = $1;
|
|
||||||
/^Source0?:\s*(\S+)/ and $self->{source} = $1;
|
|
||||||
/^BuildRoot:\s*(\S+)/ and $self->{buildroot} = $1;
|
|
||||||
/^BuildArch:\s*(\S+)/ and $self->{buildarch} = $1;
|
|
||||||
|
|
||||||
/^BuildRequires:\s*(.+)/ and push @{$self->{buildrequires}}, $1;
|
LINE: while (<$fh>) {
|
||||||
/^Requires:\s*(.+)/ and push @{$self->{requires}}, $1;
|
foreach my $attr (keys %$scalars) {
|
||||||
|
if (/$scalars->{$attr}/) {
|
||||||
|
$self->$attr($1);
|
||||||
|
next LINE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach my $attr (keys %$arrays) {
|
||||||
|
if (/$arrays->{$attr}/) {
|
||||||
|
push @{$self->$attr}, $1;
|
||||||
|
next LINE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -105,7 +141,7 @@ Centos, SUSE, Mandriva and many more.
|
||||||
RPMs are build from the source of a packages along with a spec file. The
|
RPMs are build from the source of a packages along with a spec file. The
|
||||||
spec file controls how the RPM is built.
|
spec file controls how the RPM is built.
|
||||||
|
|
||||||
This module creates Perl objects which module spec files. Currently it gives
|
This module creates Perl objects which model spec files. Currently it gives
|
||||||
you simple access to various pieces of information from the spec file.
|
you simple access to various pieces of information from the spec file.
|
||||||
|
|
||||||
=head1 CAVEAT
|
=head1 CAVEAT
|
||||||
|
@ -118,7 +154,7 @@ support for the rest of the file very soon.
|
||||||
|
|
||||||
=head2 $spec = Parse::RPM::Spec->new('some_package.spec')
|
=head2 $spec = Parse::RPM::Spec->new('some_package.spec')
|
||||||
|
|
||||||
Creates a new Parse::EPM::Spec object. Takes one mandatory parameter which
|
Creates a new Parse::RPM::Spec object. Takes one mandatory parameter which
|
||||||
is the path to the spec file that you are interested in. Throws an exception
|
is the path to the spec file that you are interested in. Throws an exception
|
||||||
if it doesn't find a valid spec.
|
if it doesn't find a valid spec.
|
||||||
|
|
||||||
|
@ -131,9 +167,9 @@ yourself.
|
||||||
=head2 $spec->file, $spec->name, $spec->version, $spec->epoch, $spec->release, $spec->summary, $spec->license, $spec->group, $spec->url, $spec->source, $spec->buildroot, $spec->buildarch, $spec->buildrequires, $spec->requires
|
=head2 $spec->file, $spec->name, $spec->version, $spec->epoch, $spec->release, $spec->summary, $spec->license, $spec->group, $spec->url, $spec->source, $spec->buildroot, $spec->buildarch, $spec->buildrequires, $spec->requires
|
||||||
|
|
||||||
Attribute accessors for the spec file object. Each one returns a piece of
|
Attribute accessors for the spec file object. Each one returns a piece of
|
||||||
information from the spec file header. The C<buildrequires> and C<requires>
|
information from the spec file header. The C<source>, C<buildrequires>
|
||||||
methods are slightly different. Because these keys can have multiple values,
|
and C<requires> methods are slightly different. Because these keys can have
|
||||||
they return a reference to an array of values.
|
multiple values, they return a reference to an array of values.
|
||||||
|
|
||||||
=head2 Parse::RPM::Spec->meta
|
=head2 Parse::RPM::Spec->meta
|
||||||
|
|
||||||
|
|
0
t/empty.spec
Normal file
0
t/empty.spec
Normal file
|
@ -12,6 +12,8 @@ BuildArch: noarch
|
||||||
BuildRequires: perl >= 1:5.6.0
|
BuildRequires: perl >= 1:5.6.0
|
||||||
BuildRequires: perl(Module::Build)
|
BuildRequires: perl(Module::Build)
|
||||||
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
||||||
|
ExclusiveArch: megaCPU
|
||||||
|
ExcludeArch: crapCPU
|
||||||
|
|
||||||
%description
|
%description
|
||||||
If you have two arrays and you want to know if they are the same or
|
If you have two arrays and you want to know if they are the same or
|
||||||
|
|
13
t/parse-license-correctly.t
Normal file
13
t/parse-license-correctly.t
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
|
use Parse::RPM::Spec;
|
||||||
|
|
||||||
|
my $spec = Parse::RPM::Spec->new( { file => 't/perl-License-Syntax.spec' } );
|
||||||
|
|
||||||
|
is($spec->license, 'GPL-1.0-or-later OR Artistic-1.0-Perl', 'Correct license');
|
||||||
|
|
||||||
|
done_testing;
|
|
@ -1,16 +1,36 @@
|
||||||
use Test::More tests => 11;
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
BEGIN { use_ok('Parse::RPM::Spec') };
|
BEGIN { use_ok('Parse::RPM::Spec') };
|
||||||
|
|
||||||
ok($spec = Parse::RPM::Spec->new( { file => 't/file.spec' } ));
|
ok(my $spec = Parse::RPM::Spec->new( { file => 't/file.spec' } ),
|
||||||
|
'Got an object');
|
||||||
isa_ok($spec, 'Parse::RPM::Spec');
|
isa_ok($spec, 'Parse::RPM::Spec');
|
||||||
|
|
||||||
is($spec->name, 'perl-Array-Compare');
|
is($spec->name, 'perl-Array-Compare', 'Correct name');
|
||||||
is($spec->summary, 'Perl extension for comparing arrays');
|
is($spec->summary, 'Perl extension for comparing arrays', 'Correct summary');
|
||||||
is($spec->epoch, 1);
|
is($spec->url, 'http://search.cpan.org/dist/Array-Compare/', 'Correct URL');
|
||||||
|
is($spec->epoch, 1, 'Correct epoch');
|
||||||
|
|
||||||
is($spec->version, '1.16');
|
is($spec->version, '1.16', 'Correct version');
|
||||||
$spec->version('1.17');
|
$spec->version('1.17');
|
||||||
is($spec->version, '1.17');
|
is($spec->version, '1.17', 'Changed version correctly');
|
||||||
is($spec->buildarch, 'noarch');
|
is($spec->buildarch, 'noarch', 'Correct build architecture');
|
||||||
is(@{$spec->buildrequires}, 2);
|
is(@{$spec->buildrequires}, 2, 'Correct number of build requirements');
|
||||||
is($spec->buildrequires->[0], 'perl >= 1:5.6.0');
|
is($spec->buildrequires->[0], 'perl >= 1:5.6.0',
|
||||||
|
'First build requirement is correct');
|
||||||
|
|
||||||
|
is($spec->exclusivearch, 'megaCPU', 'Correct exclusive architecture');
|
||||||
|
is($spec->excludearch, 'crapCPU', 'Correct excluded architecture');
|
||||||
|
|
||||||
|
dies_ok { Parse::RPM::Spec->new }
|
||||||
|
'No spec file given';
|
||||||
|
dies_ok { Parse::RPM::Spec->new( file => 'not-there') }
|
||||||
|
'Missing spec file given';
|
||||||
|
dies_ok { Parse::RPM::Spec->new( file => 'empty.spec') }
|
||||||
|
'Empty spec file given';
|
||||||
|
|
||||||
|
done_testing;
|
||||||
|
|
131
t/perl-License-Syntax.spec
Normal file
131
t/perl-License-Syntax.spec
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
Name: perl-License-Syntax
|
||||||
|
Version: 0.13
|
||||||
|
Release: 23%{?dist}
|
||||||
|
Summary: Coding and decoding of license strings using SPDX and SUSE syntax
|
||||||
|
License: GPL-1.0-or-later OR Artistic-1.0-Perl
|
||||||
|
URL: https://metacpan.org/release/License-Syntax
|
||||||
|
Source0: https://cpan.metacpan.org/authors/id/J/JN/JNW/License-Syntax-%{version}.tar.gz
|
||||||
|
BuildArch: noarch
|
||||||
|
# Build
|
||||||
|
BuildRequires: coreutils
|
||||||
|
BuildRequires: make
|
||||||
|
BuildRequires: perl-generators
|
||||||
|
BuildRequires: perl-interpreter
|
||||||
|
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
|
||||||
|
BuildRequires: perl(strict)
|
||||||
|
BuildRequires: perl(warnings)
|
||||||
|
# Runtime
|
||||||
|
BuildRequires: perl(Carp)
|
||||||
|
BuildRequires: perl(Data::Dumper)
|
||||||
|
BuildRequires: perl(DBD::SQLite)
|
||||||
|
BuildRequires: perl(DBI)
|
||||||
|
BuildRequires: perl(POSIX)
|
||||||
|
BuildRequires: perl(Text::CSV)
|
||||||
|
# Tests only
|
||||||
|
BuildRequires: perl(Test::More)
|
||||||
|
# Optional tests only
|
||||||
|
BuildRequires: perl(Pod::Coverage) >= 0.18
|
||||||
|
BuildRequires: perl(Test::Pod) >= 1.22
|
||||||
|
BuildRequires: perl(Test::Pod::Coverage) >= 1.08
|
||||||
|
Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version))
|
||||||
|
Requires: perl(DBD::SQLite)
|
||||||
|
|
||||||
|
%description
|
||||||
|
License::Syntax is an object oriented module. When constructing new
|
||||||
|
License::Syntax objects, you can provide a mapping table for license
|
||||||
|
names. The table is used for recognizing alternate alias names for the
|
||||||
|
licenses (left hand side) and also defines the canonical short names of
|
||||||
|
the licenses (right hand side). The mapping table is consulted twice,
|
||||||
|
before and after decoding the syntax, thus non-terminal mappings may
|
||||||
|
actually be followed.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n License-Syntax-%{version}
|
||||||
|
chmod -c a-x license_syntax.pl
|
||||||
|
|
||||||
|
%build
|
||||||
|
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
|
||||||
|
%{make_build}
|
||||||
|
|
||||||
|
%install
|
||||||
|
%{make_install}
|
||||||
|
rm -f %{buildroot}/%{perl_vendorlib}/License/license_syntax.pl
|
||||||
|
%{_fixperms} %{buildroot}/*
|
||||||
|
|
||||||
|
%check
|
||||||
|
make test
|
||||||
|
|
||||||
|
%files
|
||||||
|
%doc Changes README license_syntax.pl synopsis.csv
|
||||||
|
%{perl_vendorlib}/*
|
||||||
|
%{_mandir}/man3/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-23
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue May 31 2022 Jitka Plesnikova <jplesnik@redhat.com> - 0.13-22
|
||||||
|
- Perl 5.36 rebuild
|
||||||
|
|
||||||
|
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-21
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-20
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.13-19
|
||||||
|
- Perl 5.34 rebuild
|
||||||
|
|
||||||
|
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-18
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-17
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jun 23 2020 Jitka Plesnikova <jplesnik@redhat.com> - 0.13-16
|
||||||
|
- Perl 5.32 rebuild
|
||||||
|
|
||||||
|
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-15
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-14
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri May 31 2019 Jitka Plesnikova <jplesnik@redhat.com> - 0.13-13
|
||||||
|
- Perl 5.30 rebuild
|
||||||
|
|
||||||
|
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-12
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-11
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jun 28 2018 Jitka Plesnikova <jplesnik@redhat.com> - 0.13-10
|
||||||
|
- Perl 5.28 rebuild
|
||||||
|
|
||||||
|
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-9
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-8
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Jun 05 2017 Jitka Plesnikova <jplesnik@redhat.com> - 0.13-7
|
||||||
|
- Perl 5.26 rebuild
|
||||||
|
|
||||||
|
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun May 15 2016 Jitka Plesnikova <jplesnik@redhat.com> - 0.13-5
|
||||||
|
- Perl 5.24 rebuild
|
||||||
|
|
||||||
|
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.13-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jun 05 2015 Jitka Plesnikova <jplesnik@redhat.com> - 0.13-2
|
||||||
|
- Perl 5.22 rebuild
|
||||||
|
|
||||||
|
* Thu Apr 02 2015 Petr Šabata <contyk@redhat.com> 0.13-1
|
||||||
|
- Initial packaging
|
3
t/pod.t
3
t/pod.t
|
@ -1,3 +1,6 @@
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
use Test::More;
|
use Test::More;
|
||||||
eval "use Test::Pod 1.00";
|
eval "use Test::Pod 1.00";
|
||||||
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
|
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
use Test::More;
|
use Test::More;
|
||||||
eval "use Test::Pod::Coverage 1.00";
|
eval "use Test::Pod::Coverage 1.00";
|
||||||
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
|
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
|
||||||
|
|
Loading…
Add table
Reference in a new issue