]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | ############################################################ | |
3 | # | |
4 | # NOTE | |
5 | # - use the SOURCES/pldcpan.pl script for new perl packages | |
6 | # also available in pldcpan package. | |
7 | # | |
8 | ############################################################ | |
9 | # | |
10 | # Conditional build: | |
11 | %bcond_without autodeps # don't BR packages needed only for resolving deps | |
12 | %bcond_without tests # do not perform "make test" | |
13 | # | |
14 | %define pdir PDIR | |
15 | %define pnam PNAM | |
16 | %include /usr/lib/rpm/macros.perl | |
17 | Summary: - | |
18 | Summary(pl.UTF-8): - | |
19 | Name: perl-PDIR-PNAM | |
20 | Version: - | |
21 | Release: - | |
22 | # note if it is "same as perl" | |
23 | #License: GPL v1+ or Artistic | |
24 | License: (enter GPL/LGPL/BSD/BSD-like/Artistic/other license name here) | |
25 | Group: Development/Languages/Perl | |
26 | Source0: http://www.cpan.org/modules/by-module/PDIR/%{pdir}-%{pnam}-%{version}.tar.gz | |
27 | # Source0-md5: | |
28 | Patch0: %{name}-foo.patch | |
29 | # most of CPAN modules have generic URL (substitute pdir and pnam here) | |
30 | URL: http://search.cpan.org/dist/PDIR-PNAM/ | |
31 | # macros BR if _noautoreq_perl is used | |
32 | #BuildRequires: rpmbuild(macros) >= 1.654 | |
33 | BuildRequires: perl-devel >= 1:5.8.0 | |
34 | BuildRequires: rpm-perlprov >= 4.1-13 | |
35 | BuildRequires: - | |
36 | %if %{with autodeps} || %{with tests} | |
37 | BuildRequires: perl- | |
38 | BuildRequires: perl- | |
39 | %endif | |
40 | Requires: - | |
41 | Provides: - | |
42 | Obsoletes: - | |
43 | BuildArch: noarch | |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %define _noautoreq_perl anything_fake_or_conditional | |
47 | ||
48 | %description | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | ||
52 | %prep | |
53 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
54 | %patch0 -p1 | |
55 | ||
56 | # fix #!/usr/bin/env perl -w -> #!/usr/bin/perl: | |
57 | %{__sed} -i -e '1s,^#!.*perl,#!%{__perl},' tofu | |
58 | ||
59 | %build | |
60 | # Don't use pipes here: they generally don't work. Apply a patch. | |
61 | %{__perl} Makefile.PL \ | |
62 | INSTALLDIRS=vendor | |
63 | ||
64 | # Build.PL based packages | |
65 | %{__perl} Build.PL \ | |
66 | perl=%{__perl} \ | |
67 | installdirs=vendor | |
68 | ./Build | |
69 | ||
70 | %{__make} | |
71 | # if module isn't noarch, use: | |
72 | # %{__make} \ | |
73 | # CC="%{__cc}" | |
74 | # OPTIMIZE="%{rpmcflags}" | |
75 | ||
76 | # for C++ programs, use also CC but specify __cxx: | |
77 | # NOTE: (this) Perl build system doesn't have CXX, but CC is used | |
78 | #%{__make} \ | |
79 | # CC="%{__cxx}" \ | |
80 | # OPTIMIZE="%{rpmcflags}" | |
81 | ||
82 | %{?with_tests:%{__make} test} | |
83 | ||
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | %{__make} pure_install \ | |
87 | DESTDIR=$RPM_BUILD_ROOT | |
88 | ||
89 | ./Build install \ | |
90 | destdir=$RPM_BUILD_ROOT | |
91 | ||
92 | %clean | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %files | |
96 | %defattr(644,root,root,755) | |
97 | %doc Changes README | |
98 | # NOTE it's mostly easier to copy unpackaged filelist here, and run adapter over the spec. | |
99 | # use macros: | |
100 | #%%{perl_vendorlib}/PDIR... | |
101 | #%%{perl_vendorarch}/PDIR... | |
102 | %{_mandir}/man3/* |