angstrom: prefer the git version of tslib
[openembedded.git] / classes / cpan.bbclass
blobb522423243485bb0f411e2683b6acd8b6295e47e
2 # This is for perl modules that use the old Makefile.PL build system
4 inherit cpan-base
6 NATIVE_INSTALL_WORKS = "1"
8 cpan_do_configure () {
9         yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS}
10         if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
11                 . ${STAGING_LIBDIR}/perl/config.sh
12                 sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
13                         -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
14                         -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${datadir}/perl5:" \
15                         -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5:" \
16                         -e "s:\(INSTALLVENDORMAN1DIR = \).*:\1${D}${man1dir}:" \
17                         -e "s:\(INSTALLVENDORMAN3DIR = \).*:\1${D}${man3dir}:" \
18                         -e "s:\(INSTALLVENDORBIN = \).*:\1${D}${bindir}:" \
19                         -e "s:\(INSTALLVENDORSCRIPT = \).*:\1${D}${bindir}:" \
20                         -e "s:\(LDDLFLAGS.*\)${STAGING_LIBDIR_NATIVE}:\1${STAGING_LIBDIR}:" \
21                         Makefile
22         fi
25 cpan_do_compile () {
26         oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}"
29 cpan_do_install () {
30         oe_runmake DESTDIR="${D}" install_vendor
31         for PERLSCRIPT in `grep -rIl '#!${bindir}/perl' ${D}`; do
32                 sed -i -e 's|^#!${bindir}/perl|#!/usr/bin/env perl|' $PERLSCRIPT
33         done
36 EXPORT_FUNCTIONS do_configure do_compile do_install