# $Header: /magellan-cvs/smage/include/perl.sminc,v 1.15 2007-06-15 22:06:59 niro Exp $ # inherits {pre,post}install() and {pre,post}remove() to mage file INHERITS="${INHERITS} perl" # taken from gentoo eclass perm-module.eclass perlinfo() { if [ -f /usr/bin/perl ] then POD_DIR="/usr/share/perl/magellan-pods/${version}" fi eval $(perl '-V:version') PERL_VERSION=${version} eval $(perl '-V:installsitearch') SITE_ARCH=${installsitearch} eval $(perl '-V:installarchlib') ARCH_LIB=${installarchlib} eval $(perl '-V:installsitearch') SITE_LIB=${installsitearch} local installvendorlib eval $(perl '-V:installvendorlib') VENDOR_LIB=${installvendorlib} local installvendorarch eval $(perl '-V:installvendorarch') VENDOR_ARCH=${installvendorarch} # handling of DESTDIR changed in makemaker 6.11 MMSIXELEVEN=$(perl -e 'use ExtUtils::MakeMaker; print( $ExtUtils::MakeMaker::VERSION ge "6.11" )') } # taken from gentoo eclass perl-module.eclass updatepod() { local i perlinfo if [ -d "${POD_DIR}" ] then for i in $(find ${POD_DIR} -type f -name "*.pod.arch") do cat ${i} >> ${ARCH_LIB}/perllocal.pod rm -f ${i} done for i in $(find ${POD_DIR} -type f -name "*.pod.site") do cat ${i} >> ${SITE_LIB}/perllocal.pod rm -f ${i} done for i in $(find ${POD_DIR} -type f -name "*.pod.vendor") do cat ${i} >> ${VENDOR_LIB}/perllocal.pod rm -f ${i} done fi } fixlocalpod() { perlinfo if [ -f ${BINDIR}${ARCH_LIB}/perllocal.pod ] then rm -f ${BINDIR}/${ARCH_LIB}/perllocal.pod fi if [ -f ${BINDIR}${SITE_LIB}/perllocal.pod ] then rm -f ${BINDIR}/${SITE_LIB}/perllocal.pod fi if [ -f ${BINDIR}${VENDOR_LIB}/perllocal.pod ] then rm -f ${BINDIR}/${VENDOR_LIB}/perllocal.pod fi } perl_src_prepare() { munpack ${SRCFILE} || die } perl_src_compile() { cd ${SRCDIR} perlinfo export PERL_MM_USE_DEFAULT=1 export PERL_EXTUTILS_AUTOINSTALL="--skipdeps" local configure_opts="$@" if [[ -f Build.PL ]] then perl Build.PL \ --installdirs=vendor \ --destdir=${BINDIR} \ --libdoc= \ || die perl Build build || die elif [[ -f Makefile.PL ]] then perl Makefile.PL \ ${configure_opts} \ PREFIX=/usr \ INSTALLMAN3DIR='none' \ INSTALLDIRS=vendor \ DESTDIR=${BINDIR} \ || die make || die else die "No buildscript detected!" fi fixlocalpod } perl_src_install() { cd ${SRCDIR} local i local stat perlinfo if [[ -f Makefile ]] then make install || die elif [[ -f Build ]] then perl ${SRCDIR}/Build install || die else die "No installscript detected!" fi # clean manfiles for i in $(find ${BINDIR} -type f -name "*.3pm*") do rm ${i} || die done find ${BINDIR}/usr/share/man -depth -type d 2>/dev/null | xargs -r rmdir 2>/dev/null # remove local podfiles fixlocalpod # remove BINDIR from text so files for i in $(find ${BINDIR} -type f | grep -v '.so') do stat=$(file ${i} | grep -i " text") if [[ ${stat}x != x ]] then sed -i "s:${BINDIR}:/:g" ${i} || die fi done local i for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ FAQ LICENSE NEWS README TODO do if [ -f ${SRCDIR}/${i} ] then minstalldocs ${i} || die fi done } export_inherits perl src_prepare src_compile src_install