Cross-platform utility for creating DEB-packages
npm install debifyThis is a cross-platform utility for creating DEB-packages. It is written in
pure JavaScript and doesn't rely on any system utilities (such as dpkg, ar,tar, etc), so it can be used on MacOS, Windows, and GNU/Linux.
Initially debify was intended to be used for creating DEB-packages from
single-page web applications, so that they can be installed into Debian based
GNU/Linux distributions in a proper way, i.e. using standard package managers
like apt, aptitude or dpkg, but since it's a general tool, you can
"debify" anything you want.
`` bash`
$ npm install -g debify
This utility requires two arguments: DATA_DIRECTORY and CONTROL_DIRECTORY:
` bash`
$ debify
It creates a DEB-package using contents of DATA_DIRECTORY and metadata fromCONTROL_DIRECTORY which must contain at least control file—the binaryPackage
package control file
with the control fields for the package. There are five mandatory control
fields: , Version, Architecture, Maintainer, and Description.${VARIABLE_NAME}
The fields can have hard-coded values or can refer to environment variables
using syntax. All other metadata files (such as conffiles,postinst, postrm, preinst and prerm) is used as well if present inCONTROL_DIRECTORY.
Let's say there is a web application (named example) which consists of threeindex.html
files: , index.js and index.css. To create a DEB-package which/var/www/example
installs them into directory, we will need a control file
like this one:
``
Package: example
Version: 1.0.0${SUFFIX}
Architecture: all
Maintainer: John Doe
Description: An example web-application
Also we will need data and debian directories. We will place index.html,index.js and index.css into desired subdirectory under the former directory,control
and the newly created file into the latter directory. At the end we
should got the following directory structure:
``
example
├── data
│ └── var
│ └── www
│ └── example
│ ├── index.css
│ ├── index.html
│ └── index.js
└── debian
└── control
No we can launch debify utility giving it paths to data and debianexample
directories as the fist and second arguments respectively (we assume that
current working directory is ):
` bash`
$ debify data debian
This will create the DEB-package in the current working directory. According to
the control file it will be named example_1.0.0-all.deb, but since VersionSUFFIX
control field refers to environment variable, we can use it forexample_1.0.0rc1-all.deb
creating release candidates () without changing thecontrol file:
` bash``
$ SUFFIX=rc1 debify data debian