130 if (params.containsKey(VENDOR.getID())) { |
130 if (params.containsKey(VENDOR.getID())) { |
131 vendor = VENDOR.fetchFrom(params); |
131 vendor = VENDOR.fetchFrom(params); |
132 } else { |
132 } else { |
133 vendor = "jpackage"; |
133 vendor = "jpackage"; |
134 } |
134 } |
135 String appName = APP_FS_NAME.fetchFrom(params); |
135 String appName = APP_NAME.fetchFrom(params); |
136 |
136 |
137 return (vendor + "-" + appName).replaceAll("\\s", ""); |
137 return (vendor + "-" + appName).replaceAll("\\s", ""); |
138 } catch (Exception e) { |
138 } catch (Exception e) { |
139 if (Log.isDebug()) { |
139 if (Log.isDebug()) { |
140 e.printStackTrace(); |
140 e.printStackTrace(); |
296 Files.copy(licenseFile.toPath(), target.toPath()); |
296 Files.copy(licenseFile.toPath(), target.toPath()); |
297 |
297 |
298 sb.append("%license "); |
298 sb.append("%license "); |
299 sb.append(LINUX_INSTALL_DIR.fetchFrom(params)); |
299 sb.append(LINUX_INSTALL_DIR.fetchFrom(params)); |
300 sb.append("/"); |
300 sb.append("/"); |
301 sb.append(APP_FS_NAME.fetchFrom(params)); |
301 sb.append(APP_NAME.fetchFrom(params)); |
302 sb.append("/app/"); |
302 sb.append("/app/"); |
303 sb.append(licenseFile.getName()); |
303 sb.append(licenseFile.getName()); |
304 } |
304 } |
305 |
305 |
306 return sb.toString(); |
306 return sb.toString(); |
488 if (faIcon != null && faIcon.exists()) { |
488 if (faIcon != null && faIcon.exists()) { |
489 int size = getSquareSizeOfImage(faIcon); |
489 int size = getSquareSizeOfImage(faIcon); |
490 |
490 |
491 if (size > 0) { |
491 if (size > 0) { |
492 File target = new File(rootDir, |
492 File target = new File(rootDir, |
493 APP_FS_NAME.fetchFrom(params) |
493 APP_NAME.fetchFrom(params) |
494 + "_fa_" + faIcon.getName()); |
494 + "_fa_" + faIcon.getName()); |
495 IOUtils.copyFile(faIcon, target); |
495 IOUtils.copyFile(faIcon, target); |
496 |
496 |
497 // xdg-icon-resource install --context mimetypes |
497 // xdg-icon-resource install --context mimetypes |
498 // --size 64 awesomeapp_fa_1.png |
498 // --size 64 awesomeapp_fa_1.png |
499 // application-x.vnd-awesome |
499 // application-x.vnd-awesome |
575 private Map<String, String> createReplacementData( |
575 private Map<String, String> createReplacementData( |
576 Map<String, ? super Object> params) throws IOException { |
576 Map<String, ? super Object> params) throws IOException { |
577 Map<String, String> data = new HashMap<>(); |
577 Map<String, String> data = new HashMap<>(); |
578 |
578 |
579 data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params)); |
579 data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params)); |
580 data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params)); |
580 data.put("APPLICATION_FS_NAME", APP_NAME.fetchFrom(params)); |
581 data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params)); |
581 data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params)); |
582 data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params)); |
582 data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params)); |
583 data.put("APPLICATION_VERSION", VERSION.fetchFrom(params)); |
583 data.put("APPLICATION_VERSION", VERSION.fetchFrom(params)); |
584 data.put("APPLICATION_LAUNCHER_FILENAME", |
584 data.put("APPLICATION_LAUNCHER_FILENAME", APP_NAME.fetchFrom(params)); |
585 APP_FS_NAME.fetchFrom(params)); |
|
586 data.put("INSTALLATION_DIRECTORY", LINUX_INSTALL_DIR.fetchFrom(params)); |
585 data.put("INSTALLATION_DIRECTORY", LINUX_INSTALL_DIR.fetchFrom(params)); |
587 data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params)); |
586 data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params)); |
588 data.put("DEPLOY_BUNDLE_CATEGORY", CATEGORY.fetchFrom(params)); |
587 data.put("DEPLOY_BUNDLE_CATEGORY", CATEGORY.fetchFrom(params)); |
589 // TODO rpm categories |
588 // TODO rpm categories |
590 data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params)); |
589 data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params)); |
599 return data; |
598 return data; |
600 } |
599 } |
601 |
600 |
602 private File getConfig_DesktopShortcutFile(File rootDir, |
601 private File getConfig_DesktopShortcutFile(File rootDir, |
603 Map<String, ? super Object> params) { |
602 Map<String, ? super Object> params) { |
604 return new File(rootDir, |
603 return new File(rootDir, APP_NAME.fetchFrom(params) + ".desktop"); |
605 APP_FS_NAME.fetchFrom(params) + ".desktop"); |
|
606 } |
604 } |
607 |
605 |
608 private File getConfig_IconFile(File rootDir, |
606 private File getConfig_IconFile(File rootDir, |
609 Map<String, ? super Object> params) { |
607 Map<String, ? super Object> params) { |
610 return new File(rootDir, |
608 return new File(rootDir, APP_NAME.fetchFrom(params) + ".png"); |
611 APP_FS_NAME.fetchFrom(params) + ".png"); |
|
612 } |
609 } |
613 |
610 |
614 private File getConfig_SpecFile(Map<String, ? super Object> params) { |
611 private File getConfig_SpecFile(Map<String, ? super Object> params) { |
615 return new File(RPM_IMAGE_DIR.fetchFrom(params), |
612 return new File(RPM_IMAGE_DIR.fetchFrom(params), |
616 APP_FS_NAME.fetchFrom(params) + ".spec"); |
613 APP_NAME.fetchFrom(params) + ".spec"); |
617 } |
614 } |
618 |
615 |
619 private File buildRPM(Map<String, ? super Object> params, |
616 private File buildRPM(Map<String, ? super Object> params, |
620 File outdir) throws IOException { |
617 File outdir) throws IOException { |
621 Log.verbose(MessageFormat.format(I18N.getString( |
618 Log.verbose(MessageFormat.format(I18N.getString( |