fvarrui / JavaPackager

:package: Gradle/Maven plugin to package Java applications as native Windows, MacOS, or Linux executables and create installers for them.
GNU General Public License v3.0
1.07k stars 134 forks source link

Debian file associations #274

Closed schadfield closed 1 year ago

schadfield commented 1 year ago

I'm submitting a…

Short description of the issue/suggestion:

When I install the deb file created by JavaPackager my custom file association for *.kif files is not being created.

Steps to reproduce the issue/enhancement:

  1. Create a deb file by building the project (https://github.com/schadfield/shogi-explorer).
  2. Install the deb file with dpkg: dpkg -i shogi-explorer/target/packages/linux/ShogiExplorer_.deb

What is the expected behavior?

Files with extension "kif" are associated with mime type "application/x-shogi-explorer".

What is the current behavior?

The files remain associated with "text/plain".

The deb file includes "ShogiExplorer.xml" but this is not installed anywhere on the system.

Please tell us about your environment:

fvarrui commented 1 year ago

Hi @schadfield! I've just have a look into it and, as you said, it seems that ShogiExplorer.xml file (which associates mime type with file extension) is not being distributed:

fran@fran-VirtualBox:~/shogi-explorer/target/packages/linux$ dpkg -c ShogiExplorer_4.15.0.deb 
drwxr-xr-x root/root         0 2022-12-23 12:22 ./opt/
drwxr-xr-x root/root         0 2022-12-23 12:22 ./opt/ShogiExplorer/
drwxr-xr-x root/root         0 2022-12-23 12:22 ./opt/ShogiExplorer/libs/
-rw-r--r-- root/root    149642 2022-12-23 12:22 ./opt/ShogiExplorer/ShogiExplorer.png
-rw-r--r-- root/root     11017 2022-12-23 12:22 ./opt/ShogiExplorer/libs/AbsoluteLayout-RELEASE160.jar
-rw-r--r-- root/root     12659 2022-12-23 12:22 ./opt/ShogiExplorer/libs/appdirs-1.2.1.jar
-rw-r--r-- root/root    485898 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-anim-1.16.jar
-rw-r--r-- root/root    424607 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-awt-util-1.16.jar
-rw-r--r-- root/root    704905 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-bridge-1.16.jar
-rw-r--r-- root/root    112371 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-codec-1.16.jar
-rw-r--r-- root/root      8431 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-constants-1.16.jar
-rw-r--r-- root/root    330361 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-css-1.16.jar
-rw-r--r-- root/root    184060 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-dom-1.16.jar
-rw-r--r-- root/root     10239 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-ext-1.16.jar
-rw-r--r-- root/root    192085 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-gvt-1.16.jar
-rw-r--r-- root/root     11464 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-i18n-1.16.jar
-rw-r--r-- root/root     76872 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-parser-1.16.jar
-rw-r--r-- root/root     25198 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-script-1.16.jar
-rw-r--r-- root/root      6665 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-shared-resources-1.16.jar
-rw-r--r-- root/root    232734 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-svg-dom-1.16.jar
-rw-r--r-- root/root    227487 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-svggen-1.16.jar
-rw-r--r-- root/root    129300 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-transcoder-1.16.jar
-rw-r--r-- root/root    127485 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-util-1.16.jar
-rw-r--r-- root/root     33870 2022-12-23 12:22 ./opt/ShogiExplorer/libs/batik-xml-1.16.jar
-rw-r--r-- root/root     83613 2022-12-23 12:22 ./opt/ShogiExplorer/libs/commons-io-1.3.1.jar
-rw-r--r-- root/root     38015 2022-12-23 12:22 ./opt/ShogiExplorer/libs/commons-logging-1.0.4.jar
-rw-r--r-- root/root  14386028 2022-12-23 12:22 ./opt/ShogiExplorer/libs/icu4j-72.1.jar
-rw-r--r-- root/root    330246 2022-12-23 12:22 ./opt/ShogiExplorer/libs/jcommon-1.0.23.jar
-rw-r--r-- root/root   1565065 2022-12-23 12:22 ./opt/ShogiExplorer/libs/jfreechart-1.0.19.jar
-rw-r--r-- root/root     55481 2022-12-23 12:22 ./opt/ShogiExplorer/libs/jfreechart-swt-1.0.jar
-rw-r--r-- root/root   1509440 2022-12-23 12:22 ./opt/ShogiExplorer/libs/jna-5.6.0.jar
-rw-r--r-- root/root   2735878 2022-12-23 12:22 ./opt/ShogiExplorer/libs/jna-platform-5.6.0.jar
-rw-r--r-- root/root     29680 2022-12-23 12:22 ./opt/ShogiExplorer/libs/mxparser-1.2.2.jar
-rw-r--r-- root/root   1919744 2022-12-23 12:22 ./opt/ShogiExplorer/libs/org.eclipse.swt.cocoa.macosx.x86_64-4.3.jar
-rw-r--r-- root/root     18236 2022-12-23 12:22 ./opt/ShogiExplorer/libs/swtgraphics2d-1.0.jar
-rw-r--r-- root/root    220536 2022-12-23 12:22 ./opt/ShogiExplorer/libs/xml-apis-1.4.01.jar
-rw-r--r-- root/root     85686 2022-12-23 12:22 ./opt/ShogiExplorer/libs/xml-apis-ext-1.3.04.jar
-rw-r--r-- root/root    675889 2022-12-23 12:22 ./opt/ShogiExplorer/libs/xmlgraphics-commons-2.7.jar
-rw-r--r-- root/root      7188 2022-12-23 12:22 ./opt/ShogiExplorer/libs/xmlpull-1.1.3.1.jar
-rw-r--r-- root/root    633140 2022-12-23 12:22 ./opt/ShogiExplorer/libs/xstream-1.4.19.jar
-rwxr-xr-x root/root   5214389 2022-12-23 12:22 ./opt/ShogiExplorer/ShogiExplorer
drwxr-xr-x root/root         0 2022-12-23 12:22 ./usr/
drwxr-xr-x root/root         0 2022-12-23 12:22 ./usr/share/
drwxr-xr-x root/root         0 2022-12-23 12:22 ./usr/share/applications/
-rw-r--r-- root/root       332 2022-12-23 12:22 ./usr/share/applications/ShogiExplorer.desktop
drwxr-xr-x root/root         0 2022-12-23 12:22 ./usr/local/
drwxr-xr-x root/root         0 2022-12-23 12:22 ./usr/local/bin/
lrwxrwxrwx root/root         0 2022-12-23 12:22 ./usr/local/bin/ShogiExplorer -> /opt/ShogiExplorer/ShogiExplorer

I'll try to fix this asap. Thanks!

fvarrui commented 1 year ago

Currently working on this issue. Find changes in issue-274 branch.

fvarrui commented 1 year ago

It seems to be working fine now with DEB packages:

image

Testing with RPM packages!

fvarrui commented 1 year ago

You can test this version of JavaPackager following next steps:

git clone https://github.com/fvarrui/JavaPackager --branch issue-274
cd JavaPackager
./gradlew publishToMavenLocal

Last step will install JavaPackager 1.7.0-SNAPSHOT in your local repo.

Build with Java 11 (not higher), due to Gradle incompatibility (should fix this one day 😅 )

Finally, change JavaPackager version in your pom.xml to 1.7.0-SNAPSHOT and:

mvn clean package

You can use whatever Java version you want to build your app (AFAIK ShogiExplorer needs 17?) ... just Java 11 to build the plugin

fvarrui commented 1 year ago

RPM packages also seems to be working fine

fvarrui commented 1 year ago

Branch issue-274 merged into devel, ready to be released

schadfield commented 1 year ago

Thanks. I am afraid I haven't had a chance to test it yet.

fvarrui commented 1 year ago

Hi @schadfield! Don't worry, you can test it from devel branch

schadfield commented 1 year ago

I have tested the devel branch version on Debian 11 and it works correctly. Thank you very much.

fvarrui commented 1 year ago

Great! Thanks

fvarrui commented 1 year ago

I tested RPM on Fedora 37 and it works fine too

schadfield commented 1 year ago

Enjoy analysing your shogi games ;-)

fvarrui commented 1 year ago

JavaPackager 1.7.0 released to Maven Central