Package Exports
- npm-pkgbuild
Readme
npm-pkgbuild
Create ArchLinux, RPM and Debian packages from npm packages.
usage
In a package directory execute
npm-pkgbuild --rpm --debian --arch --content /destination:build --publish /some/directoryThis will create a arch, rpm and a debian package of the build dir.
upload package
npm-pkgbuild --arch --content build --publish 'https://my.package-service.com/binaries/linux/{{type}}/{{access}}/{{arch}}'You can specify the package content in package.json.
{
"pkgbuild": {
"content": {
"/some/location/" : { "base": "build" },
"/etc/myconfig.json" : "sample-config.json",
"/erc/secret" : { "name": "secret", "mode": "600" },
"/opt/myapp": [
{
"type": "npm-pack"
},
{
"type": "node-modules",
"withoutDevelpmentDependencies": true
}
]
},
"hooks" : "pkg/hooks",
"output": {
"debian" : {},
"rpm" : {},
"arch" : {}
},
"dependencies": { "nginx" : ">=1.12" }
}
}content providers
files (default)
content from the file system
npm-pack
content as provided by npm pack
node-modules
content of all (production) dependencies
options: - withoutDevelpmentDependencies when to stip away dev dependencies (defaults to true)
shared configuration
You can import common configuration from other packages see mf-hoting module as an example.
API
Table of Contents
- usage
- content providers
- files (default)
- API
- install
- license
ContentProvider
Source of package content.
asyncIterator
List all entries.
Returns asyncIterator<ContentEntry> all entries
FileContentProvider
Extends ContentProvider
Content provided form the file system.
Parameters
entryProperties
name
Returns string name of the content provider
NodeModulesContentProvider
Extends ContentProvider
Content from node_modules
Parameters
definitionsentryProperties
name
Returns string name of the content provider
NPMPackContentProvider
Extends ContentProvider
Content from npm pack.
Parameters
definitionsentryProperties
name
Returns string name of the content provider
pkgKeyValuePairOptions
fields
well known package properties https://www.archlinux.org/pacman/PKGBUILD.5.html
fields
- See: https://www.debian.org/doc/debian-policy/ch-controlfields.html
- See: https://linux.die.net/man/5/deb-control
fields
hookMapping
map install hook named from arch to deb
hookMapping
map install hook named from arch to rpm
Field
Type: Object
Properties
Packager
Parameters
propertiesObject
tmpdir
Create tmp directory.
Returns Promise<string> directory path
execute
Execute package generation
Parameters
sourcestransformerdependenciesoptionsexpander
decodePassword
Decode a password
Parameters
passwordstring
Returns string plaintext password
extractFunctions
Extract shell functions from a given text
Parameters
sourceAsyncIterator<string>
Returns AsyncIterator<FunctionDecl>
fieldProvider
Parameters
Returns Function
Expander
Type: Function
Parameters
pathstring
Returns string
copyEntries
Copy content from source into destinationDirectory.
Parameters
sourceAsyncIterator<ContentEntry>destinationDirectorystringexpanderExpander (optional, defaultv=>v)attributesArray<ContentEntryAttribute>
install
With npm do:
npm install npm-pkgbuildlicense
BSD-2-Clause