"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.rpmArch = rpmArch; exports.default = void 0; require("source-map-support/register"); var _makerBase = _interopRequireDefault(require("@electron-forge/maker-base")); var _path = _interopRequireDefault(require("path")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function rpmArch(nodeArch) { switch (nodeArch) { case 'ia32': return 'i386'; case 'x64': return 'x86_64'; case 'armv7l': return 'armv7hl'; case 'arm': return 'armv6hl'; default: return nodeArch; } } class MakerRpm extends _makerBase.default { constructor(...args) { super(...args); _defineProperty(this, "name", 'rpm'); _defineProperty(this, "defaultPlatforms", ['linux']); _defineProperty(this, "requiredExternalBinaries", ['rpmbuild']); } isSupportedOnCurrentPlatform() { return this.isInstalled('electron-installer-redhat'); } async make({ dir, makeDir, targetArch }) { // eslint-disable-next-line global-require, import/no-unresolved const installer = require('electron-installer-redhat'); const outDir = _path.default.resolve(makeDir, 'rpm', targetArch); await this.ensureDirectory(outDir); const { packagePaths } = await installer({ ...this.config, arch: rpmArch(targetArch), src: dir, dest: outDir, rename: undefined }); return packagePaths; } } exports.default = MakerRpm; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9NYWtlclJwbS50cyJdLCJuYW1lcyI6WyJycG1BcmNoIiwibm9kZUFyY2giLCJNYWtlclJwbSIsIk1ha2VyQmFzZSIsImlzU3VwcG9ydGVkT25DdXJyZW50UGxhdGZvcm0iLCJpc0luc3RhbGxlZCIsIm1ha2UiLCJkaXIiLCJtYWtlRGlyIiwidGFyZ2V0QXJjaCIsImluc3RhbGxlciIsInJlcXVpcmUiLCJvdXREaXIiLCJwYXRoIiwicmVzb2x2ZSIsImVuc3VyZURpcmVjdG9yeSIsInBhY2thZ2VQYXRocyIsImNvbmZpZyIs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