Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux DEB package does not set correct permission on jre/lib/jspawnhelper #174

Closed
AstroPixelProcessor opened this issue Mar 19, 2022 · 6 comments
Labels
bug Something isn't working fixed Issue fixed and release pending

Comments

@AstroPixelProcessor
Copy link
Contributor

I'm submitting a…

  • [X ] bug report

Short description of the issue/suggestion:

Linux DEB installer installs a non working java application in terms of being able to load native libs from external library JOGL (OpenGL) that needs to execute a script in user TMP directory to load native libs per platform.

By setting permissions of 755 (rwx,rx,rx) to jspawnhelper in jre/lib/jspawnhelper when the package is installed the issue is solved.

In the RPM packager this is done correctly and explicitely already, so needs to be fixed for the DEB packager.

Please tell us about your environment:

  • JavaPackager version: 1.6.5
  • OS version: Problem confirmed on Linux Mint 20, Ubuntu 20, It is likely that all DEB distributions are affected.
  • JDK version: OpenJDK 17 (Temurin)
  • Build tool:
    • [ X ] Maven
@AstroPixelProcessor
Copy link
Contributor Author

Hi @fvarrui ,

After installation of the DEB package, the issue is solved 100% if the user performs:

sudo chmod 755 jre/lib/jspanwhelper

from the package installation folder, so the DEB installer needs to perform this and then all will be okay ;-)

Cheers,
Mabula

@AstroPixelProcessor
Copy link
Contributor Author

AstroPixelProcessor commented Mar 19, 2022

@fvarrui,

in src/main/java/io.github.fvarrui.javapackager/packagers/GernerateDEB you can add the following to the

if (bundleJre) {

}

part to fix it :

// set correct permissions on jre/lib/jspawnhelper

Mapper javaSpawnHelperMapper = new Mapper();
javaSpawnHelperMapper.setType("perm");
javaSpawnHelperMapper.setFileMode("755");
javaSpawnHelperMapper.setPrefix("/opt/" + name + "/" + jreDirectoryName + "/lib");

File jSpawnHelperFile = new File(appFolder, jreDirectoryName + "/lib/jspawnhelper");

Data javaSpawnHelperData = new Data();
javaSpawnHelperData.setType("file");
javaSpawnHelperData.setSrc(jSpawnHelperFile);
javaSpawnHelperData.addMapper(javaSpawnHelperMapper);

dataProducers.add(javaSpawnHelperData);

//

Now the DEB installer produces a working application on Linux Mint and Ubuntu and probably thus on all DEB distributions.

Cheers,
Mabula

@fvarrui fvarrui added the bug Something isn't working label Mar 22, 2022
@fvarrui
Copy link
Owner

fvarrui commented Mar 22, 2022

Hi @AstroPixelProcessor!
Changes applied in JavaPackager 1.6.6-SNAPSHOT and published in issue-174 branch.
Thanks!

@AstroPixelProcessor
Copy link
Contributor Author

Awesome @fvarrui , thank you very much !

@fvarrui
Copy link
Owner

fvarrui commented Mar 25, 2022

I'll release JavaPackager 1.6.6 to Maven Central ASAP.
Thanks!

@fvarrui fvarrui added the fixed Issue fixed and release pending label Mar 25, 2022
@fvarrui
Copy link
Owner

fvarrui commented Apr 5, 2022

JavaPackager v1.6.6 released to Maven Central

@fvarrui fvarrui closed this as completed Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Issue fixed and release pending
Projects
None yet
Development

No branches or pull requests

2 participants