From: Andreas K. Hüttel Date: Mon, 11 Apr 2016 21:44:10 +0000 (+0200) Subject: perl-functions.eclass: Add new function perl_doexamples X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=535b81644901cbce9df3885c15602a38db380331;p=gentoo.git perl-functions.eclass: Add new function perl_doexamples --- diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass index e9c3fcbda0f6..1542b98cd45f 100644 --- a/eclass/perl-functions.eclass +++ b/eclass/perl-functions.eclass @@ -298,3 +298,24 @@ perl_check_env() { eerror "Your environment settings may lead to undefined behavior and/or build failures." die "Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details." } + +# @FUNCTION: perl_doexamples +# @USAGE: perl_doexamples "file_1" "file_2" +# @DESCRIPTION: +# Install example files ready-to-run. +# Is called under certain circumstances in perl-module.eclass src_install +# (see the documentation there). +# +perl_doexamples() { + debug-print-function $FUNCNAME "$@" + + einfo "Installing examples into /usr/share/doc/${PF}/examples" + + # no compression since we want ready-to-run scripts + docompress -x /usr/share/doc/${PF}/examples + + docinto examples/ + dodoc -r $@ + + # is there a way to undo "docinto" ? +}