1 | # Provides/Requires filtering is different from rpm 4.9 onwards
|
---|
2 | %global rpm49 %(rpm --version | perl -p -e 's/^.* (\\d+)\\.(\\d+).*/sprintf("%d.%03d",$1,$2) ge 4.009 ? 1 : 0/e' 2>/dev/null || echo 0)
|
---|
3 |
|
---|
4 | # Run extra test
|
---|
5 | #%if ! (0%{?rhel})
|
---|
6 | #%bcond_without perl_Sub_Exporter_enables_extra_test
|
---|
7 | #%else
|
---|
8 | #%bcond_with perl_Sub_Exporter_enables_extra_test
|
---|
9 | #%endif
|
---|
10 |
|
---|
11 | Name: perl-Sub-Exporter
|
---|
12 | Version: 0.987
|
---|
13 | Release: 1%{?dist}
|
---|
14 | Summary: Sophisticated exporter for custom-built routines
|
---|
15 | License: GPL+ or Artistic
|
---|
16 | URL: https://metacpan.org/release/Sub-Exporter
|
---|
17 | Source0: http://cpan.metacpan.org/authors/id/R/RJ/RJBS/Sub-Exporter-%{version}.tar.gz
|
---|
18 | BuildArch: noarch
|
---|
19 | # Build
|
---|
20 | BuildRequires: coreutils
|
---|
21 | BuildRequires: findutils
|
---|
22 | BuildRequires: make
|
---|
23 | BuildRequires: perl-generators
|
---|
24 | #BuildRequires: perl-interpreter
|
---|
25 | BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30
|
---|
26 | # Module
|
---|
27 | BuildRequires: perl(Carp)
|
---|
28 | BuildRequires: perl(Data::OptList) >= 0.1
|
---|
29 | BuildRequires: perl(Package::Generator)
|
---|
30 | BuildRequires: perl(Params::Util) >= 0.14
|
---|
31 | #BuildRequires: perl(Sub::Iperl-Sub-Exporter.specnstall) >= 0.92
|
---|
32 | # Test suite
|
---|
33 | #BuildRequires: perl(base)
|
---|
34 | #BuildRequires: perl(Exporter)
|
---|
35 | #BuildRequires: perl(File::Spec)
|
---|
36 | #BuildRequires: perl(IO::Handle)
|
---|
37 | #BuildRequires: perl(IPC::Open3)
|
---|
38 | #BuildRequires: perl(lib)
|
---|
39 | #BuildRequires: perl(subs)
|
---|
40 | #BuildRequires: perl(Test::More) >= 0.94
|
---|
41 | # Extra tests
|
---|
42 | #%if %{with perl_Sub_Exporter_enables_extra_test}
|
---|
43 | #BuildRequires: perl(Test::Pod) >= 1.41
|
---|
44 | #%endif
|
---|
45 | # Runtime
|
---|
46 | Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
---|
47 | Requires: perl(Package::Generator)
|
---|
48 |
|
---|
49 | # Don't want doc-file provides or dependencies
|
---|
50 | %global our_docdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
|
---|
51 | %global __provides_exclude_from ^%{our_docdir}/
|
---|
52 | %global __requires_exclude_from ^%{our_docdir}/
|
---|
53 |
|
---|
54 | %description
|
---|
55 | Sub::Exporter provides a sophisticated alternative to Exporter.pm. It allows
|
---|
56 | for renaming, currying/sub-generation, and other cool stuff.
|
---|
57 |
|
---|
58 | ACHTUNG! If you're not familiar with Exporter or exporting, read
|
---|
59 | Sub::Exporter::Tutorial first!
|
---|
60 |
|
---|
61 | %prep
|
---|
62 | %setup -q -n Sub-Exporter-%{version}
|
---|
63 |
|
---|
64 | # Fix shellbangs
|
---|
65 | find t/ -type f -exec \
|
---|
66 | perl -MExtUtils::MakeMaker -e 'ExtUtils::MM_Unix->fixin(qw{{}})' \;
|
---|
67 |
|
---|
68 | # Filter bogus provides/requires if we don't have rpm ⥠4.9
|
---|
69 | %if ! %{rpm49}
|
---|
70 | %global provfilt /bin/sh -c "%{__perl_provides} | grep -Ev '^perl[(]Test::SubExporter.*[)]'"
|
---|
71 | %global __perl_provides %{provfilt}
|
---|
72 | %global reqfilt /bin/sh -c "%{__perl_requires} | grep -Ev '^perl[(](base|Test::SubExporter.*)[)]'"
|
---|
73 | %global __perl_requires %{reqfilt}
|
---|
74 | %endif
|
---|
75 |
|
---|
76 | %build
|
---|
77 | perl Makefile.PL INSTALLDIRS=vendor
|
---|
78 | make %{?_smp_mflags}
|
---|
79 | make manifypods
|
---|
80 |
|
---|
81 | %install
|
---|
82 | make pure_install DESTDIR=%{buildroot}
|
---|
83 | find %{buildroot} -type f -name .packlist -delete
|
---|
84 | %{_fixperms} -c %{buildroot}
|
---|
85 |
|
---|
86 | %check
|
---|
87 | #make test
|
---|
88 | #%if %{with perl_Sub_Exporter_enables_extra_test}
|
---|
89 | #make test TEST_FILES="$(echo $(find xt/ -name '*.t'))"
|
---|
90 | #%endif
|
---|
91 |
|
---|
92 | %files
|
---|
93 | %doc Changes README t/
|
---|
94 | %dir %{perl_vendorlib}/Sub/
|
---|
95 | %dir %{perl_vendorlib}/Sub/Exporter/
|
---|
96 | %{perl_vendorlib}/Sub/Exporter.pm
|
---|
97 | %{perl_vendorlib}/Sub/Exporter/Util.pm
|
---|
98 | %doc %{perl_vendorlib}/Sub/Exporter/Cookbook.pod
|
---|
99 | %doc %{perl_vendorlib}/Sub/Exporter/Tutorial.pod
|
---|
100 | #%{_mandir}/man3/Sub::Exporter.3*
|
---|
101 | #%{_mandir}/man3/Sub::Exporter::Cookbook.3*
|
---|
102 | #%{_mandir}/man3/Sub::Exporter::Tutorial.3*
|
---|
103 | #%{_mandir}/man3/Sub::Exporter::Util.3*
|
---|
104 | %{_mandir}/man3/*.3*
|
---|
105 |
|
---|
106 | %changelog
|
---|
107 |
|
---|
108 | * Thu May 17 2018 Elbert Pol <elbert.pol@gmail.com> - 0.987-1
|
---|
109 | - initial rpm for OS2
|
---|