Embedding some modules

This page is deprecated.

Please use https://wiki.debian.org/Javascript/GroupSourcesTutorial

When we have modules that are unlikely to be needed by other modules we can include it inside another module. Later if other modules also need the embedded module, it can be packaged separately.

See node-tar and node-babel source packages for using pkg-components tool and multiple tarballs. node-tar needs modules only during runtime (it uses debian/components/install script) and node-babel needs them during build (it uses debian/components/build script). Your package must use debhelper >= 11.

  1. Create the directory debian/components and one sub directory for each component

  2. The directory debian/components must be populated with the following files with their content:

    • build config copyright.in install test

  3. Each sub directory for each component must be populated with the following files with their content:
    • control copyright install version watch

  4. You can copy the files from the packages examples and adapt the content to your package
  5. Declare build dependency on pkg-components

  6. Call dh_components from debian/rules

  7. Add node_modules directory to debian/install file and install your components in this directory.

  8. Run uscan-components --verbose to download all orig.tar files or create it in manually (for example node-tar_4.4.6.orig-minizlib.tar.gz)

  9. Add debian/gbp.conf with components info under [DEFAULT]. component = ['serialize-javascript'] (See node-copy-webpack-plugin as example)

  10. Run dpkg-source -b . to generate .dsc file with the component tarball included.

  11. Import the component tarball using gbp import-dsc and pristine-tar commit

  12. Build the package with usual tools (dpkg-buildpackage).

Deprecated method - Use pkg-components and multiple tarballs described above instead.

See node-clone-deep for an example.

  1. Download the module from npmjs.com as given in Javascript/Nodejs/Npm2Deb#Option_1:_Download_via_npmjs.org_.28npm2deb_does_this_by_default.29

  2. Extract and copy it to debian/node_modules
  3. Add debian/.gitignore with this line: !node_modules

  4. export NODE_PATH=debian/node_modules in debian/rules and debian/tests
  5. Install the modules if it is a runtime dependency using debian/install file