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"
16 %include /usr/lib/rpm/macros.perl
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
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
36 %if %{with autodeps} || %{with tests}
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 %define _noautoreq_perl anything_fake_or_conditional
50 %description -l pl.UTF-8
53 %setup -q -n %{pdir}-%{pnam}-%{version}
56 # fix #!/usr/bin/env perl -w -> #!/usr/bin/perl:
57 %{__sed} -i -e '1s,^#!.*perl,#!%{__perl},' tofu
60 # Don't use pipes here: they generally don't work. Apply a patch.
61 %{__perl} Makefile.PL \
64 # Build.PL based packages
71 # if module isn't noarch, use:
74 # OPTIMIZE="%{rpmcflags}"
76 # for C++ programs, use also CC but specify __cxx:
77 # NOTE: (this) Perl build system doesn't have CXX, but CC is used
80 # OPTIMIZE="%{rpmcflags}"
82 %{?with_tests:%{__make} test}
85 rm -rf $RPM_BUILD_ROOT
86 %{__make} pure_install \
87 DESTDIR=$RPM_BUILD_ROOT
90 destdir=$RPM_BUILD_ROOT
93 rm -rf $RPM_BUILD_ROOT
96 %defattr(644,root,root,755)
98 # NOTE it's mostly easier to copy unpackaged filelist here, and run adapter over the spec.
100 #%%{perl_vendorlib}/PDIR...
101 #%%{perl_vendorarch}/PDIR...