Differences between revisions 12 and 13
Revision 12 as of 2013-09-02 14:19:06
Size: 2407
Editor: BenArmstrong
Comment: Dropped nodejs versioned dep as agreed on in http://lists.alioth.debian.org/pipermail/pkg-javascript-devel/2013-August/005936.html
Revision 13 as of 2014-04-15 11:14:07
Size: 1279
Editor: ?LeoIannacone
Comment: Udpated and moved information about nodejs module to right page
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
 * if the library is usable from within the NodeJS framework, the ''binary'' package name '''must''' be called '''node-foo''', and the ''source'' package name '''should''' be called the same;
 * if the library is usable both from a web-browser ''and'' from NodeJS, it should generate ''two binary packages'', each called as described above.

{{{#!wi
ki note
if the library is usable both from a web-browser ''and'' from NodeJS, it should generate ''two binary packages'', each called as described above and in [[Javascript/Nodejs/Manual|Nodejs/Manual]] page.
}}}
Line 26: Line 28:
=== libjs-foo ===
Line 29: Line 30:
=== node-foo ===
The scripts should be installed to `/usr/lib/nodejs/` or `/usr/lib/nodejs/foo/`. The choice depends whether the module is contained in a single file or in multiple files. In case the latter is true, please refer to the [[http://nodejs.org/docs/latest/api/modules.html#folders_as_Modules|upstream documentation]] (also available in `/usr/share/doc/nodejs/api/modules.html#folders_as_Modules`) to understand how to correctly make it available to the NodeJS framework.


== Binary rename of node to nodejs ==

The program name "node" is conflicting with another package.
Technical committee decided to fix this by [[http://bugs.debian.org/614907#108|renaming node to nodejs]].
To comply to this, it is often as simple as :
 * Depends nodejs
 * change shebangs to #!/usr/bin/nodejs
 * rename node to nodejs in makefiles
 * do not depend on nodejs-legacy

Some programs are a bit less obvious to fix, for example they can spawn nodejs instances using "node" name.

This document is still work in progress.

Please check the mailing list archives for the latest discussions about it.

Debian JavaScript Policy

This page describes the policy that packages with Javascript libraries should follow.

Package naming

Given a foo library, packages must be named according to the following rules:

  • if the library is usable from within a web-browser, the binary package name must be called libjs-foo, and the source package name should be called foo.js;

if the library is usable both from a web-browser and from NodeJS, it should generate two binary packages, each called as described above and in Nodejs/Manual page.

Please remember that it's preferable if you name the repository after the source package name (i.e. foo.js.git for foo.js and node-foo.git for node-foo). This isn't a hard requirement though.

Paths

The scripts should be installed to /usr/share/javascript/foo/.