Skip to content

Commit 521683f

Browse files
committed
fix issue 419 in deb and rpm, and fix deb control file missing architecture
1 parent 514265d commit 521683f

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

src/main/java/io/github/fvarrui/javapackager/model/Arch.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ public static Arch getArch(String archString) {
2929
public static Arch getDefault() {
3030
return getArch(SystemUtils.OS_ARCH);
3131
}
32+
33+
public String toDebArchitecture() {
34+
switch (this) {
35+
case aarch64: return "arm64";
36+
case x64: return "amd64";
37+
case x86: return "i386";
38+
default: return null;
39+
}
40+
}
3241

3342
public Architecture toRpmArchitecture() {
3443
switch (this) {

src/main/java/io/github/fvarrui/javapackager/packagers/GenerateDeb.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected File doApply(LinuxPackager packager) throws Exception {
6565
File javaFile = new File(appFolder, jreDirectoryName + "/bin/java");
6666
File mimeXmlFile = packager.getMimeXmlFile();
6767
File installationPath = packager.getLinuxConfig().getInstallationPath();
68-
File appPath = new File(installationPath, name);
68+
String appPath = new File(installationPath, name).toPath().normalize().toString();
6969

7070
// generates desktop file from velocity template
7171
File desktopFile = new File(assetsFolder, name + ".desktop");
@@ -82,14 +82,14 @@ protected File doApply(LinuxPackager packager) throws Exception {
8282

8383
// create data producers collections
8484

85-
List<DataProducer> conffilesProducers = new ArrayList<>();
85+
List<DataProducer> confFilesProducers = new ArrayList<>();
8686
List<DataProducer> dataProducers = new ArrayList<>();
8787

8888
// builds app folder data producer, except executable file and jre/bin/java
8989

9090
Mapper appFolderMapper = new Mapper();
9191
appFolderMapper.setType("perm");
92-
appFolderMapper.setPrefix(appPath.getAbsolutePath());
92+
appFolderMapper.setPrefix(appPath);
9393
appFolderMapper.setFileMode("644");
9494

9595
Data appFolderData = new Data();
@@ -104,7 +104,7 @@ protected File doApply(LinuxPackager packager) throws Exception {
104104

105105
Mapper executableMapper = new Mapper();
106106
executableMapper.setType("perm");
107-
executableMapper.setPrefix(appPath.getAbsolutePath());
107+
executableMapper.setPrefix(appPath);
108108
executableMapper.setFileMode("755");
109109

110110
Data executableData = new Data();
@@ -190,7 +190,7 @@ protected File doApply(LinuxPackager packager) throws Exception {
190190

191191
// builds deb file
192192

193-
DebMaker debMaker = new DebMaker(console, dataProducers, conffilesProducers);
193+
DebMaker debMaker = new DebMaker(console, dataProducers, confFilesProducers);
194194
debMaker.setDeb(debFile);
195195
debMaker.setControl(controlFile.getParentFile());
196196
debMaker.setCompression("gzip");

src/main/java/io/github/fvarrui/javapackager/packagers/GenerateRpm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected File doApply(LinuxPackager packager) throws Exception {
4545
Architecture arch = packager.getArch().toRpmArchitecture();
4646
File mimeXmlFile = packager.getMimeXmlFile();
4747
File installationPath = packager.getLinuxConfig().getInstallationPath();
48-
File appPath = new File(installationPath, name);
48+
String appPath = new File(installationPath, name).toPath().normalize().toString();
4949

5050
// generates desktop file from velocity template
5151
File desktopFile = new File(assetsFolder, name + ".desktop");

src/main/resources/linux/control.vtl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ Package: ${info.name}
22
Version: ${info.version}
33
Section: misc
44
Priority: optional
5-
Architecture: ${info.arch.deb}
5+
Architecture: ${info.arch.toDebArchitecture()}
66
Maintainer: ${info.organizationName} <$!{info.organizationEmail}>
77
Description: ${info.description}
8-
Distribution: development
8+
Distribution: stable
99
#if(${info.url})
1010
Homepage: ${info.url}
1111
#end

0 commit comments

Comments
 (0)