Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specs fixes #97

Merged
merged 4 commits into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -263,12 +264,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`
Expand Down
1 change: 0 additions & 1 deletion resources/spec.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ') %>
Expand Down
12 changes: 10 additions & 2 deletions src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -68,9 +67,18 @@ 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: 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)
Expand Down