public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Jesus Rivero" <neurogeek@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] dev/neurogeek:master commit in: eclass/
Date: Fri, 23 Aug 2013 18:38:20 +0000 (UTC)	[thread overview]
Message-ID: <1377283051.83fa26f430ee23c7b11a6c18dfa866692996726f.neurogeek@gentoo> (raw)

commit:     83fa26f430ee23c7b11a6c18dfa866692996726f
Author:     Jesus Rivero <jesus.riveroa <AT> gmail <DOT> com>
AuthorDate: Fri Aug 23 18:37:31 2013 +0000
Commit:     Jesus Rivero <neurogeek <AT> gentoo <DOT> org>
CommitDate: Fri Aug 23 18:37:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/neurogeek.git;a=commit;h=83fa26f4

Tweaks to npm.eclass

---
 eclass/npm.eclass | 47 ++++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/eclass/npm.eclass b/eclass/npm.eclass
index 65b7447..b6a2cde 100644
--- a/eclass/npm.eclass
+++ b/eclass/npm.eclass
@@ -7,8 +7,8 @@
 # Jesus Rivero <neurogeek@gentoo.org>
 # @BLURB: Eclass for NodeJS packages available through the npm registry.
 # @DESCRIPTION:
-# This eclass contains various functions that may be useful when
-# dealing with packages from the npm registry, for NodeJS.
+# This eclass contains various functions that may be useful when dealing with
+# packages from the npm registry, for NodeJS.
 # Requires EAPI=2 or later.
 
 case ${EAPI} in
@@ -29,37 +29,30 @@ NPM_MODULE="${PN}"
 # @ECLASS-VARIABLE: NPM_FILES
 # @INTERNAL
 # @DESCRIPTION:
-# Files and directories that usually come in a standard
-# NodeJS/npm module.
-NPM_FILES="lib package.json index.js"
+# Files and directories that usually come in a standard NodeJS/npm module.
+NPM_FILES="index.js lib package.json ${PN}.js"
 
 # @ECLASS-VARIABLE: NPM_DOCS
-# @INTERNAL
 # @DESCRIPTION:
-# Document files that usually come in a standard
-# NodeJS/npm module.
-NPM_DOCS="README* LICENSE HISTORY*"
+# Document files that come in a NodeJS/npm module, outside of the usual docs
+# list of README*, ChangeLog AUTHORS* etc. These are only installed if 'doc' is
+# in ${USE}
+# NPM_DOCS="README* LICENSE HISTORY*"
 
 # @ECLASS-VARIABLE: NPM_EXTRA_FILES
 # @DESCRIPTION:
-# If additional dist files are present in the NodeJS/npm module
-# that are not listed in NPM_FILES, then this is the place to put them in.
+# If additional dist files are present in the NodeJS/npm module that are not
+# listed in NPM_FILES, then this is the place to put them in.
 # Can be either files, or directories.
 # Example: NPM_EXTRA_FILES="rigger.js modules"
 
-# @ECLASS-VARIABLE: NPM_EXTRA_DOCS
-# @DESCRIPTION:
-# Variable for additional document files that are not listed
-# in NPM_DOCS
-# Example: NPM_EXTRA_DOCS="docs index.html"
-
 HOMEPAGE="https://www.npmjs.org/package/${PN}"
 SRC_URI="http://registry.npmjs.org/${PN}/-/${P}.tgz"
 
 # @FUNCTION: npm-src_unpack
 # @DESCRIPTION:
-# Default src_unpack function for NodeJS/npm packages. This funtions
-# unpacks the source code, then renames the 'package' dir to $S
+# Default src_unpack function for NodeJS/npm packages. This funtions unpacks
+# the source code, then renames the 'package' dir to ${S}.
 
 npm_src_unpack() {
     unpack "${A}"
@@ -69,15 +62,14 @@ npm_src_unpack() {
 # @FUNCTION: npm-src_compile
 # @DESCRIPTION:
 # This function does nothing.
-
 npm_src_compile() {
     true
 }
 
 # @FUNCTION: npm-src_install
 # @DESCRIPTION:
-# This function installs the NodeJS/npm module to an appropriate location,
-# also taking care of NPM_FILES, NPM_EXTRA_FILES, NPM_DOCS and NPM_EXTRA_DOCS
+# This function installs the NodeJS/npm module to an appropriate location, also
+# taking care of NPM_FILES, NPM_EXTRA_FILES, NPM_DOCS
 
 npm_src_install() {
     local npm_files="${NPM_FILES} ${NPM_EXTRA_FILES}"
@@ -91,9 +83,18 @@ npm_src_install() {
             cp -r "${S}/$f" ${node_modules}
         fi
     done
+
+	# Install docs usually found in NodeJS/NPM packages.
+	local f
+	for f in README* HISTORY* ChangeLog AUTHORS NEWS TODO CHANGES \
+			THANKS BUGS FAQ CREDITS CHANGELOG*; do
+		if [[ -s ${f} ]]; then
+			dodoc "${f}"
+		fi
+	done
     
     if has doc ${USE}; then
-        local npm_docs="${NPM_DOCS} ${NPM_EXTRA_DOCS}"
+        local npm_docs="${NPM_DOCS}"
 
         for f in $npm_docs
         do


             reply	other threads:[~2013-08-23 18:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 18:38 Jesus Rivero [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-08-23 21:33 [gentoo-commits] dev/neurogeek:master commit in: eclass/ Jesus Rivero
2013-07-10 14:50 Jesus Rivero
2013-07-10 14:35 Jesus Rivero
2013-07-10 12:27 Jesus Rivero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377283051.83fa26f430ee23c7b11a6c18dfa866692996726f.neurogeek@gentoo \
    --to=neurogeek@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox