Differences between revisions 14 and 16 (spanning 2 versions)
Revision 14 as of 2014-05-09 19:36:14
Size: 1428
Editor: ?JérémyLal
Comment:
Revision 16 as of 2014-05-10 12:45:28
Size: 1684
Editor: LeoIannacone
Comment:
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
= Debian JavaScript Policy = = Introduction =
Line 13: Line 13:
== Package naming == == Policy ==
Line 15: Line 15:
Given a '''foo''' library, packages must be named according to the following rules:  0. given a '''foo''' library, binary package '''must''' be called '''libjs-foo''' and the ''source'' package name '''should''' be called '''foo.js''';
Line 17: Line 17:
 * 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''';  0. '''should''' recommend ''javascript-common'' in debian/control
Line 19: Line 19:
{{{#!wiki 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.
}}}
 0. '''should''' be installed to `/usr/share/javascript/foo/`
 
 0. '''should''' ship a ''minified'' version for each script, generated at build time (use ''uglifyjs'' to this purpose)
Line 23: Line 23:
{{{#!wiki note
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.
}}}
 0. '''should''' generate a '''node-foo''' binary package if the script is usable also for [[Javascript/Nodejs|Nodejs]]
Line 27: Line 25:
== Paths ==
The scripts should be installed to `/usr/share/javascript/foo/`.
Please remember that it's preferable if you name the repository after the source package name (i.e. ''foo.js.git'' for foo.js). This isn't a hard requirement though.
Line 30: Line 27:
== Exclude auto-generated files from source ==
Strict application of '''DFSG''' requires files generated from source in upstream tarball to be excluded, unless it is possible to regenerate the files and prove they are identical to the ones in the tarball.
Line 31: Line 30:
== javascript-common ==
Packages installing files in /usr/share/javascript should add ''javascript-common'' to the ''Recommends'' control field.
Minified files and browserified files are examples of such files that '''could''' be excluded for that reason. A convenient way to achieve this is to use the '''Files-Excluded''' field in '''debian/copyright''', for more information please see [[UscanEnhancements]].

This document is still work in progress.

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

Introduction

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

Policy

  1. given a foo library, binary package must be called libjs-foo and the source package name should be called foo.js;

  2. should recommend javascript-common in debian/control

  3. should be installed to /usr/share/javascript/foo/

  4. should ship a minified version for each script, generated at build time (use uglifyjs to this purpose)

  5. should generate a node-foo binary package if the script is usable also for Nodejs

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

Exclude auto-generated files from source

Strict application of DFSG requires files generated from source in upstream tarball to be excluded, unless it is possible to regenerate the files and prove they are identical to the ones in the tarball.

Minified files and browserified files are examples of such files that could be excluded for that reason. A convenient way to achieve this is to use the Files-Excluded field in debian/copyright, for more information please see UscanEnhancements.