perl-functions.eclass: Add new function perl_doexamples
authorAndreas K. Hüttel <dilfridge@gentoo.org>
Mon, 11 Apr 2016 21:44:10 +0000 (23:44 +0200)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Mon, 11 Apr 2016 21:48:42 +0000 (23:48 +0200)
eclass/perl-functions.eclass

index e9c3fcbda0f6de00e45a9aacb1cdc5e95edc2dab..1542b98cd45f03e83c6fde505f0b5b81d2d49ba3 100644 (file)
@@ -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" ?
+}