Skip to content

Commit aa4585d

Browse files
LyzardKingtobiasdiez
authored andcommitted
Add linux desktop launcher (#5444)
* Add linux desktop launcher * install -D creates leading components * Use templates for copyright desktop postinst * add postrm to remove native-messagin-hosts python script
1 parent 2588a1c commit aa4585d

File tree

7 files changed

+59
-5
lines changed

7 files changed

+59
-5
lines changed

build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,14 @@ jlink {
590590
installerOptions = [
591591
'--vendor', 'JabRef',
592592
'--app-version', "${project.version}",
593-
//'--temp', "$buildDir/installer",
594-
'--resource-dir', "${projectDir}/buildres/linux"
593+
// '--temp', "$buildDir/installer",
594+
'--resource-dir', "${projectDir}/buildres/linux",
595+
'--linux-menu-group', 'Office;',
596+
'--linux-rpm-license-type', 'MIT',
597+
// '--license-file', "${projectDir}/LICENSE.md",
598+
'--file-associations', "${projectDir}/buildres/linux/desktop.properties",
599+
'--description', 'JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format.',
600+
'--linux-shortcut'
595601
]
596602
}
597603

buildres/linux/JabRef.png

3.37 KB
Loading

buildres/linux/copyright

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
3+
Files: *
4+
Copyright: APPLICATION_COPYRIGHT
5+
License: APPLICATION_LICENSE_TEXT

buildres/linux/desktop.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mime-type=text/x-bibtex;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Desktop Entry]
2+
Name=APPLICATION_NAME
3+
GenericName=BibTeX Editor
4+
Comment=APPLICATION_DESCRIPTION
5+
Exec=APPLICATION_LAUNCHER
6+
Icon=APPLICATION_ICON
7+
Terminal=false
8+
Type=Application
9+
Categories=DEPLOY_BUNDLE_CATEGORY
10+
Keywords=bibtex;biblatex;latex;bibliography
11+
StartupWMClass=org-jabref-JabRefMain

buildres/linux/postinst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ set -e
2020
case "$1" in
2121
configure)
2222
INSTALL_PATH="/usr/lib/mozilla/native-messaging-hosts/"
23-
mkdir -p $INSTALL_PATH
24-
\cp /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH
25-
chmod a+x "/opt/jabref/lib/jabrefHost.py"
23+
install -D -m0755 /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH
24+
DESKTOP_COMMANDS_INSTALL
2625
;;
2726

2827
abort-upgrade|abort-remove|abort-deconfigure)

buildres/linux/prerm

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
# postrm script for APPLICATION_PACKAGE
3+
#
4+
# see: dh_installdeb(1)
5+
set -e
6+
7+
# summary of how this script can be called:
8+
# * <postrm> `remove'
9+
# * <postrm> `purge'
10+
# * <old-postrm> `upgrade' <new-version>
11+
# * <new-postrm> `failed-upgrade' <old-version>
12+
# * <new-postrm> `abort-install'
13+
# * <new-postrm> `abort-install' <old-version>
14+
# * <new-postrm> `abort-upgrade' <old-version>
15+
# * <disappearer's-postrm> `disappear' <overwriter>
16+
# <overwriter-version>
17+
# for details, see http://www.debian.org/doc/debian-policy/ or
18+
# the debian-policy package
19+
case "$1" in
20+
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
21+
INSTALL_PATH="/usr/lib/mozilla/native-messaging-hosts/"
22+
if grep --quiet '"path": "/opt' /usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json; then
23+
rm -D -m0755 /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH
24+
;;
25+
26+
*)
27+
echo "postrm called with unknown argument \`$1'" >&2
28+
exit 1
29+
;;
30+
esac
31+
32+
exit 0

0 commit comments

Comments
 (0)