Create ArchLinux, RPM and Debian packages from npm packages.
In a package directory execute
npm-pkgbuild --rpm --debian --arch --content /destination:build --publish /some/directory
This will create a arch, rpm and a debian package of the build dir.
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 from the file system
content as provided by npm pack
content of all (production) dependencies
options: - withoutDevelpmentDependencies when to stip away dev dependencies (defaults to true)
You can import common configuration from other packages see mf-hoting module as an example.
- ContentProvider
- FileContentProvider
- packageNameMapping
- decodePassword
- extractFunctions
- fieldProvider
- Expander
- copyEntries
- NFTContentProvider
- NodeModulesContentProvider
- NPMPackContentProvider
- pkgKeyValuePairOptions
- fields
- fields
- fields
- hookMapping
- hookMapping
- Field
- Packager
- available
Source of package content.
List all entries.
Returns asyncIterator<ContentEntry> all entries
Extends ContentProvider
Content provided form the file system.
-
entryProperties
Returns string name of the content provider
What is the node name in the package eco-system
Decode a password
password
string
Returns string plaintext password
Extract shell functions from a given text.
source
AsyncIterator<string>
Returns AsyncIterator<FunctionDecl>
Returns Function
Type: Function
path
string
Returns string
Copy content from source into destinationDirectory. Destination paths a generated without leading '/' (as for entry names too).
source
AsyncIterator<ContentEntry>destinationDirectory
stringexpander
Expander (optional, defaultv=>v
)attributes
Array<ContentEntryAttribute>
Extends ContentProvider
Content provided form the file system.
-
entryProperties
Returns string name of the content provider
Extends ContentProvider
Content from node_modules
definitions
entryProperties
Returns string name of the content provider
Extends ContentProvider
Content from npm pack.
Returns string name of the content provider
well known package properties https://www.archlinux.org/pacman/PKGBUILD.5.html
- See: https://www.debian.org/doc/debian-policy/ch-controlfields.html
- See: https://linux.die.net/man/5/deb-control
map install hook named from arch to deb
map install hook named from arch to rpm
Type: Object
properties
Object
Create tmp directory.
Returns Promise<string> directory path
Execute package generation
sources
transformer
dependencies
options
expander
Check for rpmbuild presence.
Returns boolean true when rpmbuild is present
With npm do:
npm install npm-pkgbuild
BSD-2-Clause