Skip to content

Commit

Permalink
Fix hardcoded Path in XDG Intgration and add DEB/RPM Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoellnitz committed Mar 25, 2024
1 parent 7d80ce2 commit 925ec09
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 11 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ based EncFS.

- Only when using algorithms other than AES with such oldish JRE: JCE Extension

We recommend using Java 11 or 17 LTS versions if possible.


## Installation and Application Start

Expand All @@ -118,9 +120,8 @@ You can start the application through
- a Unix shell script ('bin/JFileSync3')
- a XDG launcher script ('bin/JFileSync3.desktop')

ATTENTION: Because JFileSync3 is distributed as a ZIP archive, Unix users will
have to give executable rights manually before launching the application, e.g.:
'chmod a+rx bin/JFileSync3'.
The XDG launcher script can be automatically modified to reflect the current
path with the script `prepare_xdg_file.sh`.

Nearly all functions of JFileSync3 can be controlled via the Graphical User
Interface (GUI). However, JFileSync3 provides full access to all features
Expand Down Expand Up @@ -185,8 +186,8 @@ Required packages for JFileSync3 development (not included in the distribution):

Used, and as a result recommended, development tools are:

* OpenJDK 11.0
* Netbeans 17
* OpenJDK 11, 17, or 21 respectively.
* Netbeans 17 or above

The following structure describes all directories and files included in the
JFileSync3 source repository:
Expand Down Expand Up @@ -236,7 +237,7 @@ and can be started - e.g. for IDE integration - through
./gradlew run
```

Take the ZIP file from build/distributions.
Take the ZIP, DEB, or RPM file from build/distributions.

A small test-suite can be found in profiles/test (which is not packaged in the
distribution zip) and can be called via
Expand Down
51 changes: 48 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013-2023 Martin Goellnitz
* Copyright (C) 2013-2024 Martin Goellnitz
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -18,6 +18,7 @@
plugins {
id "edu.sc.seis.launch4j" version "2.5.4"
id "net.ossindex.audit" version "0.4.11"
id "com.netflix.nebula.ospackage" version "11.8.1"
}
def l4j = true

Expand Down Expand Up @@ -119,7 +120,7 @@ if (l4j) {
errTitle = project.name
// jreMinVersion = '11'
// splashFileName= 'win/JFileSync3-640x350-splash.bmp'
copyright = '(C) 2002-2023, J. Heidrich, M. Goellnitz'
copyright = '(C) 2002-2024, J. Heidrich, M. Goellnitz'
downloadUrl = 'https://adoptium.net/de/temurin/releases'
supportUrl = 'https://github.com/mgoellnitz/JFileSync3'
icon = "$project.projectDir/win/JFileSync3.ico"
Expand Down Expand Up @@ -148,7 +149,50 @@ startScripts {
}
}

distZip.dependsOn startScripts
ospackage {
packageName = 'jfilesync'
version = '3.0-SNAPSHOT'
maintainer = 'Martin Goellnitz'
url = 'https://mgoellnitz.github.io/JFileSync3'
into("/usr/share/applications") {
from 'xdg'
include '*.desktop'
}
into("/usr/share/icons/hicolor/64x64") {
from 'xdg'
include '*.png'
}
into("/usr/share/$project.name") {
from '.'
include 'legal/*.*'
include 'profiles/*.*'
include 'README.md'
}
into("/usr/lib/$packageName/lib") {
from "build/install/$project.name/lib"
include '*.jar'
}
into("/usr/lib/$packageName/script") {
from "build/install/$project.name/bin"
include "$project.name"
}
}

installDist.dependsOn startScripts

buildDeb.dependsOn installDist

buildDeb {
link("/usr/bin/$project.name", "/usr/lib/$packageName/script/$project.name")
}

buildRpm.dependsOn buildDeb

buildRpm {
link("/usr/bin/$project.name", "/usr/lib/$packageName/script/$project.name")
}

distZip.dependsOn buildRpm

distZip {
// TODO: later...
Expand All @@ -175,6 +219,7 @@ distZip {
from 'xdg'
include '*.desktop'
include '*.png'
include 'prepare*.sh'
}
// legal stuff, examples, and documentation
into(project.name) {
Expand Down
4 changes: 2 additions & 2 deletions xdg/JFileSync3.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Encoding=UTF-8
Name=JFileSync3 - 3.0-SNAPSHOT
Comment=Syncing and Encryption
Exec=/opt/JFileSync3/bin/JFileSync3
Icon=/opt/JFileSync3/bin/JFileSync3.png
Exec=JFileSync3
Icon=JFileSync3.png
Categories=Application;Java
Version=1.0
Type=Application
Expand Down
17 changes: 17 additions & 0 deletions xdg/prepare_desktop_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
DIR=$(dirname $(readlink -f $0))
if [ -f $DIR/../lib/JFileSync3.jar ] ; then
if [ -f ~/.config/user-dirs.dirs ] ; then
DESKTOP_DIR=~/$(cat ~/.config/user-dirs.dirs |grep XDG_DESKTOP_DIR|sed -e 's/^.*HOME.\(.*\)./\1/g')
else
if [ -f ~/.config/user-dirs.dirs ] ; then
DESKTOP_DIR=~/$(cat /etc/xdg/user-dirs.defaults |grep DESKTOP|sed -e 's/^.*=\(.*\)$/\1/g')
else
DESKTOP_DIR=~/Desktop
fi
fi
PATTERN=$(echo $DIR|sed -e 's/\//\\\//g')\\/
sed -i.bak -e "s/^Exec=.*/Exec=${PATTERN}JFileSync3/" $DIR/JFileSync3.desktop
sed -i.bak -e "s/^Icon=.*/Icon=${PATTERN}JFileSync3.png/" $DIR/JFileSync3.desktop
rm $DIR/JFileSync3.desktop.bak
fi

0 comments on commit 925ec09

Please sign in to comment.