From 7da847b1167ca430391ebb481bb0247ad9c1f019 Mon Sep 17 00:00:00 2001 From: Felipe Castillo Date: Mon, 17 Dec 2018 10:32:44 -0800 Subject: [PATCH 1/4] Wraps %description to lines of 80 characters --- src/installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/installer.js b/src/installer.js index ebe585c..80f18c0 100644 --- a/src/installer.js +++ b/src/installer.js @@ -70,7 +70,7 @@ function getOptions (data, defaults) { // Wrap the extended description to avoid rpmlint warning about // `description-line-too-long`. - options.productDescription = wrap(options.productDescription, {width: 100, indent: ''}) + options.productDescription = wrap(options.productDescription, {width: 80, indent: ''}) // Scan if there are any installation scripts and adds them to the options return generateScripts(options) From dc4d108d9701bf4f19b5ac5ea35e2bd3481a821b Mon Sep 17 00:00:00 2001 From: Felipe Castillo Date: Mon, 17 Dec 2018 10:46:15 -0800 Subject: [PATCH 2/4] options.description cannot end with a perior --- src/installer.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/installer.js b/src/installer.js index 80f18c0..55ec73d 100644 --- a/src/installer.js +++ b/src/installer.js @@ -68,6 +68,15 @@ function getOptions (data, defaults) { // Flatten everything for ease of use. const options = _.defaults({}, data, data.options, defaults) + if (!options.description && !options.productDescription) { + throw new Error(`No Description or ProductDescription provided. Please set either a description in the app's package.json or provide it in the options.`) + } + + if (options.description) { + // Do not end with a period + options.description = options.description.replace(/\.*$/, '') + } + // Wrap the extended description to avoid rpmlint warning about // `description-line-too-long`. options.productDescription = wrap(options.productDescription, {width: 80, indent: ''}) From a8f65ab8ee25fb120cd864f0e8e1ad6421ac555e Mon Sep 17 00:00:00 2001 From: Felipe Castillo Date: Mon, 17 Dec 2018 12:37:57 -0800 Subject: [PATCH 3/4] Remove depecated options.group --- README.md | 6 ------ resources/spec.ejs | 1 - src/installer.js | 1 - 3 files changed, 8 deletions(-) diff --git a/README.md b/README.md index 7214ae8..04b58f3 100644 --- a/README.md +++ b/README.md @@ -263,12 +263,6 @@ Default: `package.license` License of the package, used in the [`License` field of the `spec` file](https://fedoraproject.org/wiki/How_to_create_an_RPM_package#Creating_a_SPEC_file). -#### options.group -Type: `String` -Default: `undefined` - -Group of the package, used in the [`Group` field of the `spec` file](https://fedoraproject.org/wiki/How_to_create_an_RPM_package#Creating_a_SPEC_file). - #### options.arch Type: `String` Default: `undefined` diff --git a/resources/spec.ejs b/resources/spec.ejs index 1fe5fed..e82fd56 100644 --- a/resources/spec.ejs +++ b/resources/spec.ejs @@ -4,7 +4,6 @@ <% } %><% if (description) { %>Summary: <%= description %> <% } %><% if (homepage) { %>URL: <%= homepage %> <% } %><% if (license) { %>License: <%= license %> -<% } %><% if (group) { %>Group: <%= group %> <% } %> AutoReqProv: no <% if (requires) { %>Requires: <%= requires.join(', ') %> diff --git a/src/installer.js b/src/installer.js index 55ec73d..9e35247 100644 --- a/src/installer.js +++ b/src/installer.js @@ -29,7 +29,6 @@ const getDefaults = function (data) { return Object.assign(common.getDefaultsFromPackageJSON(pkg), { version: pkg.version || '0.0.0', license: pkg.license, - group: undefined, requires: [ 'lsb', 'libXScrnSaver' From 08011703d1df5ab20915a91c2e0da116a2b845d6 Mon Sep 17 00:00:00 2001 From: Felipe Castillo Date: Mon, 17 Dec 2018 12:43:22 -0800 Subject: [PATCH 4/4] Add README note about options.description --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 04b58f3..13a27e8 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,8 @@ Generic name of the application (e.g. `Text Editor`), used in the [`GenericName` Type: `String` Default: `package.description` -Short description of the application, used in the [`Summary` field of the `spec` file](https://fedoraproject.org/wiki/How_to_create_an_RPM_package#Creating_a_SPEC_file). +Short, one-line description of the application; do not end with a period. +Used in the [`Summary` field of the `spec` file](https://fedoraproject.org/wiki/How_to_create_an_RPM_package#Creating_a_SPEC_file). #### options.productDescription Type: `String`