3 %bcond_without tests # do not perform "make test"
5 Summary: Extract distribution name and version from a distribution filename
6 Name: perl-CPAN-DistnameInfo
9 License: GPL+ or Artistic
10 Group: Development/Libraries
11 Source0: http://www.cpan.org/authors/id/G/GB/GBARR/CPAN-DistnameInfo-%{version}.tar.gz
12 # Source0-md5: 06bc803c0e4fb7735ddc7282163f1cc3
13 URL: http://search.cpan.org/dist/CPAN-DistnameInfo/
14 BuildRequires: perl(ExtUtils::MakeMaker)
15 BuildRequires: perl-Encode
16 BuildRequires: rpm-perlprov >= 4.1-13
18 BuildRequires: perl(Data::Dumper)
19 BuildRequires: perl(Test::More)
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 Many online services that are centered around CPAN attempt to
26 associate multiple uploads by extracting a distribution name from the
27 filename of the upload. For most distributions this is easy as they
28 have used ExtUtils::MakeMaker or Module::Build to create the
29 distribution, which results in a uniform name. But sadly not all
30 uploads are created in this way.
32 CPAN::DistnameInfo uses heuristics that have been learnt by
33 <http://search.cpan.org/> to extract the distribution name and version
34 from filenames and also report if the version is to be treated as a
38 %setup -q -n CPAN-DistnameInfo-%{version}
41 %{__perl} Makefile.PL INSTALLDIRS=vendor
43 %{?with_tests:%{__make} test}
46 rm -rf $RPM_BUILD_ROOT
47 %{__make} pure_install \
48 DESTDIR=$RPM_BUILD_ROOT
50 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/CPAN/DistnameInfo/.packlist
53 rm -rf $RPM_BUILD_ROOT
56 %defattr(644,root,root,755)
58 %{perl_vendorlib}/CPAN/DistnameInfo.pm
59 %{_mandir}/man3/CPAN::DistnameInfo.3pm*