pkg-rpm
Create a RedHat-RPM package for a Node.js executable.
Last updated 13 days ago by mcasimir .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pkg-rpm 
SYNC missed versions from official npm registry.

pkg-rpm

Create a Debian package from an executable binary.

Usage

pkg-rpm requires a specific structure for your binary directory. For example:

.
└── project 
    ├── LICENSE
    ├── README.md
    ├── package.json
    └── dist 
        └── executable 

Your source directory must have a package.json for a properly generated SPECS/packageName.spec with the following fields:

  • name
  • description
  • license
  • homepage
const pkgRhel = require('pkg-rpm')
const path = require('path')

const opts = {
  version: '0.0.1',
  name: 'executable',
  dest: path.join(__dirname, 'project', 'dist'),
  src: path.join(__dirname, 'project'), 
  input: path.join(__dirname, 'project', 'dist', 'executable'),
  arch: 'amd64',
  logger: console.log
}

await pkgRhel(opts)

API

await pkgRhel(opts)

Creates a RedHat package in your dest directory. Under the hood pkgRhel generates an applicable SPECS/packageName.spec file and runs rpmbuild to create the package.

Options:

  • opts.version: Version number of the package.
  • opts.name: Name of the package.
  • opts.dest: Destination where to write the final package. It will be saved as name-version-arch.rpm in the provided dest.
  • opts.src: Path to source directory. Must have a package.json.
  • opts.input: Binary to be packaged.
  • opts.arch: Architecture. You can specify: x64 or amd64.
  • opts.logger: Logger to help you debug. Defaults to debug.

The full directory structure that pkgRhel creates is as follows:

.
└── pkg-rpm-tmpdirectory (created by pkgRhel.createStagingDir())
    ├── BUILD
    │   └── provided_binary (copied over with pkgRhel.copyApplication())
    ├── BUILDROOT
    ├── RPMS (this will contain the built RPM)
    │   └── amd64 (current architecture directory)
    │       └── packageName-version-arch.rpm (created by pkgRhel.createPackage())
    ├── SOURCES
    ├── SPECS
    │   └── module.spec (will be created with pkgRhel.createSpec())
    └── SRPMS

See Also:

License

Apache-2.0

Current Tags

  • 1.0.3                                ...           latest (13 days ago)

4 Versions

  • 1.0.3                                ...           13 days ago
  • 1.0.2                                ...           3 months ago
  • 1.0.1                                ...           5 months ago
  • 1.0.0                                ...           5 months ago
Downloads
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |