Skip to content

Commit

Permalink
feat(linux): Package name can be specified using packageName option (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltan-mihalyi authored Mar 2, 2021
1 parent be4a1fb commit 622aaef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
14 changes: 14 additions & 0 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,13 @@
"string"
]
},
"packageName": {
"description": "The name of the package.",
"type": [
"null",
"string"
]
},
"priority": {
"description": "The [Priority](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Priority) attribute.",
"type": [
Expand Down Expand Up @@ -1736,6 +1743,13 @@
"string"
]
},
"packageName": {
"description": "The name of the package.",
"type": [
"null",
"string"
]
},
"publish": {
"anyOf": [
{
Expand Down
5 changes: 5 additions & 0 deletions packages/app-builder-lib/src/options/linuxOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ export interface LinuxTargetSpecificOptions extends CommonLinuxOptions, TargetSp
*/
readonly packageCategory?: string | null

/**
* The name of the package.
*/
readonly packageName?: string | null

readonly vendor?: string | null
readonly maintainer?: string | null

Expand Down
3 changes: 2 additions & 1 deletion packages/app-builder-lib/src/targets/fpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { installPrefix, LinuxTargetHelper } from "./LinuxTargetHelper"
import { getLinuxToolsPath } from "./tools"

interface FpmOptions {
name: string
maintainer: string | undefined
vendor: string
url: string
Expand Down Expand Up @@ -83,6 +84,7 @@ export default class FpmTarget extends Target {
}

return {
name: options.packageName ?? this.packager.appInfo.linuxPackageName,
maintainer: author!!,
url: projectUrl!!,
vendor: options.vendor || author!!,
Expand Down Expand Up @@ -124,7 +126,6 @@ export default class FpmTarget extends Target {
const synopsis = options.synopsis
const args = [
"--architecture", toLinuxArchString(arch, target),
"--name", appInfo.linuxPackageName,
"--after-install", scripts[0],
"--after-remove", scripts[1],
"--description", smarten(target === "rpm" ? this.helper.getDescription(options)! : `${synopsis || ""}\n ${this.helper.getDescription(options)}`),
Expand Down

0 comments on commit 622aaef

Please sign in to comment.