-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add option for a custom SPEC file (#245)
- Loading branch information
1 parent
0ca9555
commit ab6694f
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
%define _binary_payload w<%= compressionLevel %>.xzdio | ||
|
||
Name: <%= name %> | ||
Version: <%= version %> | ||
Release: <%= revision %>%{?dist} | ||
<% if (description) { print(`Summary: ${description}\n`) } | ||
%> | ||
<% if (license) { print(`License: ${license}\n`) } | ||
if (homepage) { print(`URL: ${homepage}\n`) } | ||
if (license || homepage) { print('\n') } | ||
%>Requires: <%= requires.join(', ') %> | ||
AutoReqProv: no | ||
|
||
<% if (productDescription) { | ||
%>%description | ||
<% print(productDescription) | ||
print('\n\n\n') } | ||
%>%install | ||
mkdir -p %{buildroot}/usr/ | ||
cp <%= process.platform === 'darwin' ? '-R' : '-r' %> usr/* %{buildroot}/usr/ | ||
|
||
|
||
%files | ||
/usr/bin/<%= name %> | ||
/usr/lib/<%= name %>/ | ||
/usr/share/applications/<%= name %>.desktop | ||
/usr/share/doc/<%= name %>/ | ||
<% if (_.isObject(icon)) { | ||
_.forEach(icon, function (path, resolution) { | ||
%>/usr/share/icons/hicolor/<%= resolution %>/apps/<%= name %><%= resolution === 'symbolic' ? '-symbolic' : '' %>.<%= ['scalable', 'symbolic'].includes(resolution) ? 'svg' : 'png' %> | ||
<% }) } else { | ||
%>/usr/share/pixmaps/<%= name %>.png | ||
<% } %> | ||
|
||
%changelog | ||
* Wed Feb 02 2022 John Doe <johndoe@johndoe.com> - 0.1 | ||
- First release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,6 +163,25 @@ describe('module', function () { | |
} | ||
) | ||
|
||
describeInstaller( | ||
'with an app with a custom SPEC file', | ||
{ | ||
src: 'test/fixtures/app-with-asar/', | ||
options: { | ||
arch: 'x86', | ||
specTemplate: 'test/fixtures/custom.spec.ejs' | ||
} | ||
}, | ||
'generates a `.rpm` package with custom spec', | ||
async outputDir => { | ||
await assertASARRpmExists(outputDir) | ||
const stdout = await spawn('rpm', ['-qp', '--changelog', 'footest.x86.rpm'], { cwd: outputDir }) | ||
if (!stdout.includes('* Wed Feb 02 2022 John Doe <[email protected]> - 0.1\n- First release')) { | ||
throw new Error(`RPM missing changelog:\n ${stdout}`) | ||
} | ||
} | ||
) | ||
|
||
if (process.platform === 'darwin') { | ||
describeInstaller( | ||
'with an app with %_target_os linux', | ||
|