summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Fredric <kentfredric@gmail.com>2016-12-02 03:24:00 +1300
committerKent Fredric <kentnl@gentoo.org>2017-09-17 12:06:57 +1200
commit946a111b1814f683802fce5634574cf5001000d3 (patch)
treebd63735b71a64494c24e1ce11f78511ee5b7eb5d
parentperl-functions.eclass: Sync perl_delete_packlist (diff)
downloadperl-overlay-946a111b1814f683802fce5634574cf5001000d3.tar.gz
perl-overlay-946a111b1814f683802fce5634574cf5001000d3.tar.bz2
perl-overlay-946a111b1814f683802fce5634574cf5001000d3.zip
perl-functions.eclass: Sync perl_doexamples from ::Gentoo
-rw-r--r--eclass/perl-functions.eclass29
1 files changed, 29 insertions, 0 deletions
diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass
index a54b27318..5a84698f0 100644
--- a/eclass/perl-functions.eclass
+++ b/eclass/perl-functions.eclass
@@ -404,3 +404,32 @@ perl_check_env() {
die "Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details."
}
+# @FUNCTION: perl_doexamples
+# @USAGE: <list of files or globs>
+# @DESCRIPTION:
+# Install example files ready-to-run.
+# Is called under certain circumstances in perl-module.eclass src_install
+# (see the documentation there).
+#
+# Example:
+# @CODE
+# src_install() {
+# perl-module_src_install
+# use examples && perl_doexamples "eg/*"
+# }
+# @CODE
+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/
+ # Lack of quoting here is important in order to support glob expansion
+ # in DIST_EXAMPLES=( ), which is defined before source extraction occurs
+ dodoc -r $@
+
+ # is there a way to undo "docinto" ?
+}