2 ############################################################
5 # - use the SOURCES/pldcpan.pl script for new perl packages
6 # also available in pldcpan package.
8 ############################################################
11 %bcond_without autodeps # don't BR packages needed only for resolving deps
12 %bcond_without tests # do not perform "make test"
21 # note if it is "same as perl"
22 #License: GPL v1+ or Artistic
23 License: (enter GPL/LGPL/BSD/BSD-like/Artistic/other license name here)
24 Group: Development/Languages/Perl
25 Source0: http://www.cpan.org/modules/by-module/PDIR/%{pdir}-%{pnam}-%{version}.tar.gz
27 Patch0: %{name}-foo.patch
28 # most of CPAN modules have generic URL (substitute pdir and pnam here)
29 URL: http://search.cpan.org/dist/PDIR-PNAM/
30 BuildRequires: perl-devel >= 1:5.8.0
31 BuildRequires: rpm-perlprov >= 4.1-13
32 BuildRequires: rpmbuild(macros) >= 1.745
34 %if %{with autodeps} || %{with tests}
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 %define _noautoreq_perl anything_fake_or_conditional
48 %description -l pl.UTF-8
51 %setup -q -n %{pdir}-%{pnam}-%{version}
54 # fix #!/usr/bin/env perl -w -> #!/usr/bin/perl:
55 %{__sed} -i -e '1s,^#!.*perl,#!%{__perl},' tofu
58 # Don't use pipes here: they generally don't work. Apply a patch.
59 %{__perl} Makefile.PL \
62 # Build.PL based packages
69 # if module isn't noarch, use:
72 # OPTIMIZE="%{rpmcflags}"
74 # for C++ programs, use also CC but specify __cxx:
75 # NOTE: (this) Perl build system doesn't have CXX, but CC is used
78 # OPTIMIZE="%{rpmcflags}"
80 %{?with_tests:%{__make} test}
83 rm -rf $RPM_BUILD_ROOT
84 %{__make} pure_install \
85 DESTDIR=$RPM_BUILD_ROOT
88 destdir=$RPM_BUILD_ROOT
91 rm -rf $RPM_BUILD_ROOT
94 %defattr(644,root,root,755)
96 # NOTE it's mostly easier to copy unpackaged filelist here, and run adapter over the spec.
98 #%%{perl_vendorlib}/PDIR...
99 #%%{perl_vendorarch}/PDIR...