8213941: Debian linux problems in JavaPackager
Submitted-by: asemenyuk
Reviewed-by: herrick, almatvee
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java Fri Aug 16 17:29:33 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java Fri Aug 16 18:13:04 2019 -0400
@@ -140,6 +140,13 @@
+ EMAIL.fetchFrom(params) + ">",
(s, p) -> s);
+ public static final BundlerParamInfo<String> SECTION =
+ new StandardBundlerParam<>(
+ Arguments.CLIOptions.LINUX_CATEGORY.getId(),
+ String.class,
+ params -> "misc",
+ (s, p) -> s);
+
public static final BundlerParamInfo<String> LICENSE_TEXT =
new StandardBundlerParam<> (
"linux.deb.licenseText",
@@ -735,6 +742,7 @@
data.put("APPLICATION_MAINTAINER", MAINTAINER.fetchFrom(params));
data.put("APPLICATION_VERSION", VERSION.fetchFrom(params));
data.put("APPLICATION_RELEASE", RELEASE.fetchFrom(params));
+ data.put("APPLICATION_SECTION", SECTION.fetchFrom(params));
data.put("APPLICATION_LAUNCHER_FILENAME", launcher);
data.put("INSTALLATION_DIRECTORY", LINUX_INSTALL_DIR.fetchFrom(params));
data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params));
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java Fri Aug 16 17:29:33 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java Fri Aug 16 18:13:04 2019 -0400
@@ -124,6 +124,13 @@
params -> I18N.getString("param.license-type.default"),
(s, p) -> s
);
+
+ public static final BundlerParamInfo<String> GROUP =
+ new StandardBundlerParam<>(
+ Arguments.CLIOptions.LINUX_CATEGORY.getId(),
+ String.class,
+ params -> null,
+ (s, p) -> s);
public static final BundlerParamInfo<String> XDG_FILE_PREFIX =
new StandardBundlerParam<> (
@@ -572,6 +579,12 @@
}
data.put("APPLICATION_LICENSE_FILE", licenseFile);
+ String group = GROUP.fetchFrom(params);
+ if (group == null) {
+ group = "";
+ }
+ data.put("APPLICATION_GROUP", group);
+
String deps = LINUX_PACKAGE_DEPENDENCIES.fetchFrom(params);
data.put("PACKAGE_DEPENDENCIES",
deps.isEmpty() ? "" : "Requires: " + deps);
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.control Fri Aug 16 17:29:33 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.control Fri Aug 16 18:13:04 2019 -0400
@@ -1,7 +1,7 @@
Package: APPLICATION_PACKAGE
Version: APPLICATION_VERSION
Release: APPLICATION_RELEASE
-Section: unknown
+Section: APPLICATION_SECTION
Maintainer: APPLICATION_MAINTAINER
Priority: optional
Architecture: APPLICATION_ARCH
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec Fri Aug 16 17:29:33 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec Fri Aug 16 18:13:04 2019 -0400
@@ -6,6 +6,10 @@
Vendor: APPLICATION_VENDOR
Prefix: INSTALLATION_DIRECTORY
Provides: APPLICATION_PACKAGE
+%if "xAPPLICATION_GROUP" != x
+Group: APPLICATION_GROUP
+%endif
+
Autoprov: 0
Autoreq: 0
PACKAGE_DEPENDENCIES
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java Fri Aug 16 17:29:33 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java Fri Aug 16 18:13:04 2019 -0400
@@ -106,6 +106,9 @@
putUnlessNull(bundleParams, CLIOptions.RELEASE.getId(),
getOptionValue(CLIOptions.RELEASE));
+ putUnlessNull(bundleParams, CLIOptions.LINUX_CATEGORY.getId(),
+ getOptionValue(CLIOptions.LINUX_CATEGORY));
+
putUnlessNull(bundleParams,
CLIOptions.WIN_CONSOLE_HINT.getId(),
getOptionValue(CLIOptions.WIN_CONSOLE_HINT));
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Fri Aug 16 17:29:33 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Fri Aug 16 18:13:04 2019 -0400
@@ -325,6 +325,9 @@
LINUX_DEB_MAINTAINER ("linux-deb-maintainer",
OptionCategories.PLATFORM_LINUX),
+ LINUX_CATEGORY ("linux-app-category",
+ OptionCategories.PLATFORM_LINUX),
+
LINUX_RPM_LICENSE_TYPE ("linux-rpm-license-type",
OptionCategories.PLATFORM_LINUX),
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java Fri Aug 16 17:29:33 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java Fri Aug 16 18:13:04 2019 -0400
@@ -122,6 +122,7 @@
if (Platform.getPlatform() == Platform.LINUX) {
options.put(CLIOptions.LINUX_BUNDLE_NAME.getId(), USE.INSTALL);
options.put(CLIOptions.LINUX_DEB_MAINTAINER.getId(), USE.INSTALL);
+ options.put(CLIOptions.LINUX_CATEGORY.getId(), USE.INSTALL);
options.put(CLIOptions.LINUX_RPM_LICENSE_TYPE.getId(), USE.INSTALL);
options.put(CLIOptions.LINUX_PACKAGE_DEPENDENCIES.getId(),
USE.INSTALL);
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties Fri Aug 16 17:29:33 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties Fri Aug 16 18:13:04 2019 -0400
@@ -258,6 +258,9 @@
\ Type of the license ("License: <value>" of the RPM .spec)\n\
\ --linux-app-release <release value>\n\
\ Release value of the RPM <name>.spec file or DEB control file.\n\
+\ --linux-app-category <category value>\n\
+\ Group value of the RPM <name>.spec file or \n\
+\ Section value of DEB control file.\n\
MSG_Help_mac_linux_install_dir=\
\Absolute path of the installation directory of the application\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties Fri Aug 16 17:29:33 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties Fri Aug 16 18:13:04 2019 -0400
@@ -258,6 +258,9 @@
\ Type of the license ("License: <value>" of the RPM .spec)\n\
\ --linux-app-release <release value>\n\
\ Release value of the RPM <name>.spec file or DEB control file.\n\
+\ --linux-app-category <category value>\n\
+\ Group value of the RPM <name>.spec file or \n\
+\ Section value of DEB control file.\n\
MSG_Help_mac_linux_install_dir=\
\Absolute path of the installation directory of the application\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties Fri Aug 16 17:29:33 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties Fri Aug 16 18:13:04 2019 -0400
@@ -258,6 +258,9 @@
\ Type of the license ("License: <value>" of the RPM .spec)\n\
\ --linux-app-release <release value>\n\
\ Release value of the RPM <name>.spec file or DEB control file.\n\
+\ --linux-app-category <category value>\n\
+\ Group value of the RPM <name>.spec file or \n\
+\ Section value of DEB control file.\n\
MSG_Help_mac_linux_install_dir=\
\Absolute path of the installation directory of the application\n\