2 ############################################################
5 # - use the SOURCES/pldcpan.pl script for new perl packages
6 # also available in pldcpan package.
8 ############################################################
11 %bcond_without tests # do not perform "make test"
20 # note if it is "same as perl"
21 #License: GPL v1+ or Artistic
22 License: (enter GPL/LGPL/BSD/BSD-like/Artistic/other license name here)
23 Group: Development/Languages/Perl
24 Source0: http://www.cpan.org/modules/by-module/PDIR/%{pdir}-%{pnam}-%{version}.tar.gz
26 Patch0: %{name}-foo.patch
27 # most of CPAN modules have generic URL (substitute pdir and pnam here)
28 URL: https://metacpan.org/release/PDIR-PNAM
29 BuildRequires: perl-devel >= 1:5.8.0
30 BuildRequires: rpm-perlprov >= 4.1-13
31 BuildRequires: rpmbuild(macros) >= 1.745
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 %define _noautoreq_perl anything_fake_or_conditional
47 %description -l pl.UTF-8
50 %setup -q -n %{pdir}-%{pnam}-%{version}
53 # fix #!/usr/bin/env perl -w -> #!/usr/bin/perl:
54 %{__sed} -i -e '1s,^#!.*perl,#!%{__perl},' tofu
57 # Don't use pipes here: they generally don't work. Apply a patch.
58 %{__perl} Makefile.PL \
61 # Build.PL based packages
68 # if module isn't noarch, use:
71 # OPTIMIZE="%{rpmcflags}"
73 # for C++ programs, use also CC but specify __cxx:
74 # NOTE: (this) Perl build system doesn't have CXX, but CC is used
77 # OPTIMIZE="%{rpmcflags}"
79 %{?with_tests:%{__make} test}
82 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...