]> git.pld-linux.org Git - projects/template-specs.git/blobdiff - perl.spec
py_comp/py_ocomp must be before py_postclean
[projects/template-specs.git] / perl.spec
index 99e723b638b67e0115ac17a60cc3561da2e804ba..9113daefaff0b0cf19cf76fd0d1a5a89dd963cba 100644 (file)
--- a/perl.spec
+++ b/perl.spec
+#
+############################################################
+#
+# NOTE
+# - use the SOURCES/pldcpan.pl script for new perl packages
+#   also available in pldcpan package.
+#
+############################################################
+#
+# Conditional build:
+%bcond_without autodeps        # don't BR packages needed only for resolving deps
+%bcond_without tests   # do not perform "make test"
+#
+%define                pdir    PDIR
+%define                pnam    PNAM
 %include       /usr/lib/rpm/macros.perl
-%define        pdir    -
-%define        pnam    -
 Summary:       -
-Summary(de):   -
-Summary(fr):   -
-Summary(pl):   -
-Summary(tr):   -
-Name:          perl-
+Summary(pl.UTF-8):     -
+Name:          perl-PDIR-PNAM
 Version:       -
 Release:       -
-Epoch:         -
-License:       - (enter GPL/LGPL/BSD/BSD-like/other license name here)
+# note if it is "same as perl"
+#License:      GPL v1+ or Artistic
+License:       (enter GPL/LGPL/BSD/BSD-like/Artistic/other license name here)
 Group:         Development/Languages/Perl
-Vendor:                -
-Icon:          -
-Source0:       ftp://ftp.cpan.org/pub/CPAN/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz
-Source1:       %{name}
-Source2:       %{name}
-Patch0:                %{name}
-Patch1:                %{name}
-Patch2:                %{name}
-URL:           -
-BuildRequires: perl >= 5.6
-BuildRequires: rpm-perlprov >= 3.0.3-16
+Source0:       http://www.cpan.org/modules/by-module/PDIR/%{pdir}-%{pnam}-%{version}.tar.gz
+# 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/
+# macros BR if _noautoreq_perl is used
+#BuildRequires:        rpmbuild(macros) >= 1.654
+BuildRequires: perl-devel >= 1:5.8.0
+BuildRequires: rpm-perlprov >= 4.1-13
 BuildRequires: -
+%if %{with autodeps} || %{with tests}
+BuildRequires: perl-
+BuildRequires: perl-
+%endif
 Requires:      -
-Prereq:                -
 Provides:      -
 Obsoletes:     -
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%description
-
-%description -l de
-
-%description -l fr
+%define                _noautoreq_perl anything_fake_or_conditional
 
-%description -l pl
+%description
 
-%description -l tr
+%description -l pl.UTF-8
 
 %prep
 %setup -q -n %{pdir}-%{pnam}-%{version}
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
+
+# fix #!/usr/bin/env perl -w -> #!/usr/bin/perl:
+%{__sed} -i -e '1s,^#!.*perl,#!%{__perl},' tofu
 
 %build
-perl Makefile.PL
+# 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} OPTIMIZE="%{rpmcflags}"
+# %{__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}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
-%{__make} install \
+%{__make} pure_install \
        DESTDIR=$RPM_BUILD_ROOT
 
+./Build install \
+       destdir=$RPM_BUILD_ROOT
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
 %doc Changes README
+# NOTE it's mostly easier to copy unpackaged filelist here, and run adapter over the spec.
 # use macros:
-#%{perl_sitelib}/...
-#%{perl_sitearch}/...
+#%%{perl_vendorlib}/PDIR...
+#%%{perl_vendorarch}/PDIR...
+%{_mandir}/man3/*
This page took 0.03071 seconds and 4 git commands to generate.