]>
Commit | Line | Data |
---|---|---|
294891f4 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | ||
5 | %include /usr/lib/rpm/macros.perl | |
6 | Summary: Get, unpack, build and install CPAN modules | |
7 | Name: cpanminus | |
6b43396b | 8 | Version: 1.7040 |
5ebc102f | 9 | Release: 1 |
294891f4 ER |
10 | License: GPL+ or Artistic |
11 | Group: Development/Libraries | |
12 | Source0: http://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-%{name}-%{version}.tar.gz | |
6b43396b | 13 | # Source0-md5: 8f8e43433f42e78d8c4374e1f0f55d31 |
294891f4 | 14 | Source1: http://pkgs.fedoraproject.org/cgit/perl-App-cpanminus.git/plain/fatunpack |
5ebc102f | 15 | # Source1-md5: c69ce04e198446d28e2aaa8ba3291542 |
294891f4 | 16 | URL: http://search.cpan.org/dist/App-cpanminus/ |
294891f4 | 17 | BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30 |
21695127 | 18 | BuildRequires: perl-String-ShellQuote |
21695127 | 19 | BuildRequires: perl-tools-pod |
294891f4 | 20 | BuildRequires: rpm-perlprov >= 4.1-13 |
294891f4 | 21 | Requires: perl(ExtUtils::Install) >= 1.46 |
5ebc102f | 22 | Requires: perl(ExtUtils::MakeMaker) >= 6.58 |
21695127 ER |
23 | Requires: perl-CPAN-DistnameInfo |
24 | Requires: perl-CPAN-Meta-Check | |
25 | Requires: perl-File-pushd | |
26 | Requires: perl-Module-CPANfile | |
27 | Requires: perl-Parse-PMFile | |
28 | Requires: perl-YAML | |
29 | Requires: perl-local-lib | |
294891f4 ER |
30 | BuildArch: noarch |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | Why? It's dependency free, requires zero configuration, and stands | |
35 | alone but it's maintainable and extensible with plug-ins and friendly | |
36 | to shell scripting. When running, it requires only 10 MB of RAM. | |
37 | ||
38 | %prep | |
39 | %setup -q -n App-%{name}-%{version} | |
b3956ea3 ER |
40 | |
41 | %build | |
294891f4 ER |
42 | # Unbundle fat-packed modules |
43 | podselect lib/App/cpanminus.pm > lib/App/cpanminus.pod | |
44 | ||
45 | for F in bin/cpanm lib/App/cpanminus/fatscript.pm; do | |
46 | %{__perl} %{SOURCE1} --libdir lib --filter '^App/cpanminus' "$F" > "${F}.stripped" | |
47 | perl -c -Ilib "${F}.stripped" | |
48 | mv "${F}.stripped" "$F" | |
49 | done | |
50 | ||
b3a24f7f ER |
51 | # strip remains of fatpack |
52 | %{__sed} -i -e '/DO NOT EDIT/,/END OF FATPACK CODE/d' bin/cpanm | |
53 | ||
294891f4 | 54 | %{__perl} Makefile.PL INSTALLDIRS=vendor |
540fa720 ER |
55 | |
56 | # strip pod, already in manual | |
57 | %{__sed} -i -e '/__END__/,$d' bin/cpanm | |
58 | ||
294891f4 ER |
59 | %{__make} |
60 | %{?with_tests:%{__make} test} | |
61 | ||
62 | %install | |
63 | rm -rf $RPM_BUILD_ROOT | |
64 | %{__make} pure_install \ | |
65 | DESTDIR=$RPM_BUILD_ROOT | |
66 | ||
67 | %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/App/cpanminus/.packlist | |
68 | %{__rm} $RPM_BUILD_ROOT%{perl_vendorlib}/App/cpanminus.pod | |
23870d16 ER |
69 | # same as bindir/cpanm |
70 | %{__rm} $RPM_BUILD_ROOT%{perl_vendorlib}/App/cpanminus/fatscript.pm | |
294891f4 ER |
71 | |
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %files | |
76 | %defattr(644,root,root,755) | |
5ebc102f | 77 | %doc Changes README LICENSE |
294891f4 ER |
78 | %attr(755,root,root) %{_bindir}/cpanm |
79 | %{perl_vendorlib}/App/cpanminus.pm | |
80 | %{perl_vendorlib}/App/cpanminus | |
81 | %{_mandir}/man1/cpanm.1* | |
82 | %{_mandir}/man3/App::cpanminus* |