X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=perl.spec;h=32b9c04b96886a5bd79de301207c5ae81d6b0082;hb=09ee490b9341053ed93cc56bff608305ff469d01;hp=efb1f6719f78c15e3c45961a393ff7a7baf89438;hpb=3f2b97007154fd1870814ffbb3f214703548f9ab;p=projects%2Ftemplate-specs.git diff --git a/perl.spec b/perl.spec index efb1f67..32b9c04 100644 --- a/perl.spec +++ b/perl.spec @@ -8,10 +8,8 @@ ############################################################ # # Conditional build: -%bcond_without autodeps # don't BR packages needed only for resolving deps %bcond_without tests # do not perform "make test" # -%include /usr/lib/rpm/macros.perl %define pdir PDIR %define pnam PNAM Summary: - @@ -27,11 +25,12 @@ Source0: http://www.cpan.org/modules/by-module/PDIR/%{pdir}-%{pnam}-%{version}.t # Source0-md5: Patch0: %{name}-foo.patch # most of CPAN modules have generic URL (substitute pdir and pnam here) -URL: http://search.cpan.org/dist/PDIR-PNAM/ +URL: https://metacpan.org/release/PDIR-PNAM BuildRequires: perl-devel >= 1:5.8.0 BuildRequires: rpm-perlprov >= 4.1-13 +BuildRequires: rpmbuild(macros) >= 1.745 BuildRequires: - -%if %{with autodeps} || %{with tests} +%if %{with tests} BuildRequires: perl- BuildRequires: perl- %endif @@ -41,7 +40,7 @@ Obsoletes: - BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) -%define _noautoreq 'perl(anything_fake_or_conditional)' +%define _noautoreq_perl anything_fake_or_conditional %description @@ -51,14 +50,30 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %setup -q -n %{pdir}-%{pnam}-%{version} %patch0 -p1 +# fix #!/usr/bin/env perl -w -> #!/usr/bin/perl: +%{__sed} -i -e '1s,^#!.*perl,#!%{__perl},' tofu + %build # Don't use pipes here: they generally don't work. Apply a patch. %{__perl} Makefile.PL \ INSTALLDIRS=vendor +# Build.PL based packages +%{__perl} Build.PL \ + perl=%{__perl} \ + installdirs=vendor +./Build + %{__make} # if module isn't noarch, use: # %{__make} \ +# CC="%{__cc}" +# OPTIMIZE="%{rpmcflags}" + +# for C++ programs, use also CC but specify __cxx: +# NOTE: (this) Perl build system doesn't have CXX, but CC is used +#%{__make} \ +# CC="%{__cxx}" \ # OPTIMIZE="%{rpmcflags}" %{?with_tests:%{__make} test} @@ -69,6 +84,9 @@ rm -rf $RPM_BUILD_ROOT %{__make} pure_install \ DESTDIR=$RPM_BUILD_ROOT +./Build install \ + destdir=$RPM_BUILD_ROOT + %clean rm -rf $RPM_BUILD_ROOT