217 return true; |
217 return true; |
218 } |
218 } |
219 |
219 |
220 @Override |
220 @Override |
221 public boolean validate(Map<String, ? super Object> params) |
221 public boolean validate(Map<String, ? super Object> params) |
222 throws UnsupportedPlatformException, ConfigException { |
222 throws ConfigException { |
223 try { |
223 try { |
224 if (params == null) throw new ConfigException( |
224 if (params == null) throw new ConfigException( |
225 I18N.getString("error.parameters-null"), |
225 I18N.getString("error.parameters-null"), |
226 I18N.getString("error.parameters-null.advice")); |
226 I18N.getString("error.parameters-null.advice")); |
227 |
227 |
754 private File getConfig_IconFile(File rootDir, |
754 private File getConfig_IconFile(File rootDir, |
755 Map<String, ? super Object> params) { |
755 Map<String, ? super Object> params) { |
756 return new File(rootDir, APP_NAME.fetchFrom(params) + ".png"); |
756 return new File(rootDir, APP_NAME.fetchFrom(params) + ".png"); |
757 } |
757 } |
758 |
758 |
759 private File getConfig_InitScriptFile(Map<String, ? super Object> params) { |
|
760 return new File(LinuxAppBundler.getRootDir( |
|
761 APP_IMAGE_ROOT.fetchFrom(params), params), |
|
762 BUNDLE_NAME.fetchFrom(params) + ".init"); |
|
763 } |
|
764 |
|
765 private File getConfig_ControlFile(Map<String, ? super Object> params) { |
759 private File getConfig_ControlFile(Map<String, ? super Object> params) { |
766 return new File(CONFIG_DIR.fetchFrom(params), "control"); |
760 return new File(CONFIG_DIR.fetchFrom(params), "control"); |
767 } |
761 } |
768 |
762 |
769 private File getConfig_PreinstallFile(Map<String, ? super Object> params) { |
763 private File getConfig_PreinstallFile(Map<String, ? super Object> params) { |
813 public String getName() { |
807 public String getName() { |
814 return I18N.getString("deb.bundler.name"); |
808 return I18N.getString("deb.bundler.name"); |
815 } |
809 } |
816 |
810 |
817 @Override |
811 @Override |
818 public String getDescription() { |
|
819 return I18N.getString("deb.bundler.description"); |
|
820 } |
|
821 |
|
822 @Override |
|
823 public String getID() { |
812 public String getID() { |
824 return "deb"; |
813 return "deb"; |
825 } |
814 } |
826 |
815 |
827 @Override |
816 @Override |
828 public String getBundleType() { |
817 public String getBundleType() { |
829 return "INSTALLER"; |
818 return "INSTALLER"; |
830 } |
|
831 |
|
832 @Override |
|
833 public Collection<BundlerParamInfo<?>> getBundleParameters() { |
|
834 Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>(); |
|
835 results.addAll(LinuxAppBundler.getAppBundleParameters()); |
|
836 results.addAll(getDebBundleParameters()); |
|
837 return results; |
|
838 } |
|
839 |
|
840 public static Collection<BundlerParamInfo<?>> getDebBundleParameters() { |
|
841 return Arrays.asList( |
|
842 BUNDLE_NAME, |
|
843 COPYRIGHT, |
|
844 MENU_GROUP, |
|
845 DESCRIPTION, |
|
846 EMAIL, |
|
847 ICON_PNG, |
|
848 LICENSE_FILE, |
|
849 VENDOR |
|
850 ); |
|
851 } |
819 } |
852 |
820 |
853 @Override |
821 @Override |
854 public File execute(Map<String, ? super Object> params, |
822 public File execute(Map<String, ? super Object> params, |
855 File outputParentDir) throws PackagerException { |
823 File outputParentDir) throws PackagerException { |
856 return bundle(params, outputParentDir); |
824 return bundle(params, outputParentDir); |
857 } |
825 } |
858 |
826 |
859 @Override |
827 @Override |
860 public boolean supported(boolean runtimeInstaller) { |
828 public boolean supported(boolean runtimeInstaller) { |
|
829 return isSupported(); |
|
830 } |
|
831 |
|
832 public static boolean isSupported() { |
861 if (Platform.getPlatform() == Platform.LINUX) { |
833 if (Platform.getPlatform() == Platform.LINUX) { |
862 if (testTool(TOOL_DPKG, "1")) { |
834 if (testTool(TOOL_DPKG, "1")) { |
863 return true; |
835 return true; |
864 } |
836 } |
865 } |
837 } |