Coder Social home page Coder Social logo

debify's Introduction

debify

This 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.

Installation

$ npm install -g debify

Usage

This utility requires two arguments: DATA_DIRECTORY and CONTROL_DIRECTORY:

$ debify <DATA_DIRECTORY> <CONTROL_DIRECTORY>

It creates a DEB-package using contents of DATA_DIRECTORY and metadata from CONTROL_DIRECTORY which must contain at least control file—the binary package control file with the control fields for the package. There are five mandatory control fields: Package, Version, Architecture, Maintainer, and Description. The fields can have hard-coded values or can refer to environment variables using ${VARIABLE_NAME} syntax. All other metadata files (such as conffiles, postinst, postrm, preinst and prerm) is used as well if present in CONTROL_DIRECTORY.

Example

Let's say there is a web application (named example) which consists of three files: index.html, index.js and index.css. To create a DEB-package which installs them into /var/www/example directory, we will need a control file like this one:

Package: example
Version: 1.0.0${SUFFIX}
Architecture: all
Maintainer: John Doe <[email protected]>
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, and the newly created control 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 debian directories as the fist and second arguments respectively (we assume that current working directory is example):

$ 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 Version control field refers to SUFFIX environment variable, we can use it for creating release candidates (example_1.0.0rc1-all.deb) without changing the control file:

$ SUFFIX=rc1 debify data debian

debify's People

Contributors

ivansanchez avatar windicted avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.