msmcomm: bump SRCREV for latest updates
[openembedded.git] / classes / cpan.bbclass
blob97de5fbfb1eddc72b35d88d7f43385187f1ae3e6
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
23         find . -name Makefile | xargs sed -i -e "s:bin/perl.real:bin/perl:g"
26 cpan_do_compile () {
27         oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}"
30 cpan_do_install () {
31         oe_runmake DESTDIR="${D}" install_vendor
32         for PERLSCRIPT in `grep -rIl '#!${bindir}/perl' ${D}`; do
33                 sed -i -e 's|^#!${bindir}/perl|#!/usr/bin/env perl|' $PERLSCRIPT
34         done
37 EXPORT_FUNCTIONS do_configure do_compile do_install