Skip to content
Permalink
Browse files

feat(maker): add the rpm maker for the linux target

  • Loading branch information
malept committed Dec 4, 2016
1 parent 20ae889 commit 85821f273d669a29e2567545154fa0d08a61067f
Showing with 40 additions and 1 deletion.
  1. +5 −0 .travis.yml
  2. +2 −1 package.json
  3. +33 −0 src/makers/linux/rpm.js
@@ -5,6 +5,11 @@ os:
- linux
- osx

addons:
apt:
packages:
- rpm

env:
matrix:
- NODE_INSTALLER=npm
@@ -82,6 +82,7 @@
}
},
"optionalDependencies": {
"electron-installer-debian": "^0.4.0"
"electron-installer-debian": "^0.4.0",
"electron-installer-redhat": "^0.3.0"
}
}
@@ -0,0 +1,33 @@
import installer from 'electron-installer-redhat';
import path from 'path';
import pify from 'pify';

import { ensureFile } from '../../util/ensure-output';

function rpmArch(nodeArch) {
switch (nodeArch) {
case 'ia32': return 'i386';
case 'x64': return 'x86_64';
case 'arm':
if (process.config.variables.arm_version === '7') {
return 'armv7hl';
}
return 'armv6hl';
default: return nodeArch;
}
}

export default async (dir, appName, forgeConfig, packageJSON) => { // eslint-disable-line
const arch = rpmArch(process.arch);
const outPath = path.resolve(dir, '../make', `${packageJSON.name}_${packageJSON.version}_${arch}.rpm`);

await ensureFile(outPath);
const rpmDefaults = {
arch,
dest: path.dirname(outPath),
src: dir,
};
const rpmConfig = Object.assign({}, forgeConfig.electronInstallerRedhat, rpmDefaults);

await pify(installer)(rpmConfig);
};

0 comments on commit 85821f2

Please sign in to comment.
You can’t perform that action at this time.