create ArchLinux, RPM and Debian packages from npm packages
npm install npm-pkgbuild









Create ArchLinux, RPM, Debian and Docker packages from npm packages.
In a package directory execute
``shell`
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.
`shell`
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.
`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" }
}
}
Defining where the package content should come from.
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-hosting or mf-hosting-frontend modules.
* allInputs
* allOutputs
* npmArchMapping
* content2Sources
* Parameters
* PackageDefinition
* Properties
* extractFromPackage
* Parameters
* NPMPackContentProvider
* Parameters
* Properties
* name
* NodeModulesContentProvider
* Parameters
* Properties
* asyncIterator
* name
* FileContentProvider
* Parameters
* asyncIterator
* name
* NFTContentProvider
* Parameters
* asyncIterator
* name
* ContentProvider
* Parameters
* Properties
* asyncIterator
* DEBIAN
* hookMapping
* attributes
* prepare
* Parameters
* pkgKeyValuePairOptions
* attributes
* quoteFile
* Parameters
* RPM
* hookMapping
* attributes
* prepare
* Parameters
* OCI
* DOCKER
* attributes
* prepare
* Parameters
* BUILDAH
* Packager
* Parameters
* packageName
* Parameters
* hookContent
* dependencyExpression
* Parameters
* tmpdir
* prepare
* Parameters
* create
* Parameters
* workspaceLayout
* prepare
* Parameters
* Packager
* Parameters
* packageName
* Parameters
* hookContent
* dependencyExpression
* Parameters
* tmpdir
* prepare
* Parameters
* create
* Parameters
* workspaceLayout
* prepare
* Parameters
* Field
* Properties
* deleteKey
* Parameters
* copyNodeModules
* Parameters
* PublishingDetail
* Properties
* createPublishingDetails
* Parameters
* publish
* Parameters
* utf8StreamOptions
* decodePassword
* Parameters
* FunctionDecl
* Properties
* extractFunctions
* Parameters
* fieldProvider
* Parameters
* Expander
* Parameters
* copyEntries
* Parameters
All content providers (input)
All output formats
Node architecture name to os native arch name mapping
{@see
Delivers ContentProviders from pkgbuild.content definition.
* content Object from pkgbuild.contentdir
*
Returns Iterable<ContentProvider>
Type: Object
* properties Object values describing the package attributes
* properties.dependencies Object properties.replaces
* Object properties.conficts
* Object sources
* Array<ContentProvider> content providersoutput
* Object package typevariant
* Object identifier of the variant
* variant.name string name of the variantvariant.arch
* string name of the architecture
Extract package definition from package.json.
* for each architecture deliver a new result
* if no architecture is given one result set is provided nethertheless
* architectures are taken from cpu (node arch ids) and from pkgbuild.arch (raw arch ids)
* architecture given in a variant definition are used to restrict the set of avaliable architectures
* options Object (optional, default {})
* options.dir string? where to look for package.jsonoptions.verbose
* boolean? logenv
* Object as delared in process.env (optional, default {})
Returns AsyncIterable<PackageDefinition>
Extends ContentProvider
Content from npm pack.
* definitions Object entryProperties
* Object to be set for each entrydirectoryProperties
*
* dir string
Returns string name of the content provider
Extends ContentProvider
Content from node\_modules.
Requires .npmrc or NPM\_TOKEN environment
* definitions entryProperties
* directoryProperties
*
* withoutDevelpmentDependencies boolean
List all entries.
Returns AsyncIterable<(ContentEntry | CollectionEntry)> all entries
Returns string name of the content provider
Extends ContentProvider
Content provided form the file system.
* definitions (Object | string) entryProperties
* directoryProperties
*
Returns AsyncIterable<(ContentEntry | CollectionEntry)> all entries
Returns string name of the content provider
Extends ContentProvider
Content provided form the file system.
* definitions (Object | string) entryProperties
* Object? directoryProperties
* Object?
Returns AsyncIterable\
Returns string name of the content provider
Source of package content.
* definitions Object entryProperties
* Object? directoryProperties
* Object?
* dir string
List all entries.
Returns AsyncIterable<(ContentEntry | CollectionEntry)> all entries
Extends Packager
Create .deb packages
Map install hook named from default (arch) to deb.
* See:
* See:
#### Parameters
* options Object variant
* Object
* variant.arch string
Type: Object
well known package properties
* name
Extends Packager
Produce rpm packages.
Map install hook named from default (arch) to rpm.
* See:
Check for rpmbuild presence.
#### Parameters
* options Object variant
* Object
* variant.arch string
Returns Promise<boolean> true when rpmbuild executable is present
Extends Packager
Low level OCI compatible packager
Extends Packager
docker image build
* See:
Check for docker presence.
#### Parameters
* options Object variant
* Object
* variant.arch string
Returns Promise<boolean> true when docker executable is present
Extends DOCKER
Use buildah @see
* properties
What is the package name in the package eco-system.
#### Parameters
* name string
Returns string package name in the target eco-system
Generate hook content entries
Returns AsyncIterable\
Forms an expression string form name and expression.
If tere is no valid exression name only is delivered.
#### Parameters
* name string expression
* (string | boolean | undefined)
Returns string
Create tmp directory.
Returns Promise<string> directory path
Prepares artifact generation.
#### Parameters
* options Object
* options.staging string? options.destination
* string? publishingDetail
* Object?
Returns Promise<{properties: Object, destination: string, tmpdir: string, staging: string}>
Execute package generation.
#### Parameters
* sources Object transformer
* Array<Object> publishingDetails
* Array<PublishingDetail> options
* Object expander
* function (string): string?
Returns Promise<string> identifier of the resulting package
Returns {named: object, others: Array<string>}
#### Parameters
* options Object variant
* Object
Base Packager
* properties Object
What is the package name in the package eco-system.
#### Parameters
* name string
Returns string package name in the target eco-system
Generate hook content entries
Returns AsyncIterable\
Forms an expression string form name and expression.
If tere is no valid exression name only is delivered.
#### Parameters
* name string expression
* (string | boolean | undefined)
Returns string
Create tmp directory.
Returns Promise<string> directory path
Prepares artifact generation.
#### Parameters
* options Object
* options.staging string? options.destination
* string? publishingDetail
* Object?
Returns Promise<{properties: Object, destination: string, tmpdir: string, staging: string}>
Execute package generation.
#### Parameters
* sources Object transformer
* Array<Object> publishingDetails
* Array<PublishingDetail> options
* Object expander
* function (string): string?
Returns Promise<string> identifier of the resulting package
Returns {named: object, others: Array<string>}
#### Parameters
* options Object variant
* Object
Type: Object
* alias string interchangeable field nametype
* string default
* any mandatory
* boolean
* source string dest
* string options
* Object (optional, default defaultOptions)
Type: Object
* url string properties
* Object scheme
* string username
* string? password
* string?
* locations Array<string> (optional, default [])properties
* Object?
* properties.PKGBUILD_PUBLISH string? properties.arch
* string? properties.access
* string? properties.type
* string? properties.username
* string?
Returns Array<PublishingDetail>
* artifactIdentifier string publishingDetail
* PublishingDetail? properties
* Object? logger
* function (any): void (optional, default console.log)
Type: BufferEncoding
Decode a password
* password string
Returns string plaintext password
Type: Object
Extract shell functions from a given text.
* source AsyncIterable<string>
Returns AsyncIterable<FunctionDecl>
* properties Object attributes
* Object
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 AsyncIterable\destinationDirectory
* string expander
* Expander (optional, default v=>v)
With npm do:
`shell``
npm install npm-pkgbuild
BSD-2-Clause