From cf73d2bc958317e2e63e1f94584807ceb33d9706 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Mon, 14 Oct 2019 15:16:51 +0200 Subject: [PATCH 1/4] Add linux desktop launcher --- build.gradle | 2 +- buildres/linux/jabref.desktop | 12 ++++++++++++ buildres/linux/postinst | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 buildres/linux/jabref.desktop diff --git a/build.gradle b/build.gradle index e2e07d632b8..a7c3add4c7d 100644 --- a/build.gradle +++ b/build.gradle @@ -626,7 +626,7 @@ if (OperatingSystem.current().isLinux()) { tasks.jpackageImage.doLast { copy { from("${projectDir}/buildres/linux") { - include "org.jabref.jabref.json", "jabrefHost.py" + include "org.jabref.jabref.json", "jabrefHost.py", "jabref.desktop" } into "$buildDir/distribution/JabRef/lib" } diff --git a/buildres/linux/jabref.desktop b/buildres/linux/jabref.desktop new file mode 100644 index 00000000000..e284eccd63d --- /dev/null +++ b/buildres/linux/jabref.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Name=JabRef +GenericName=BibTeX Editor +Comment=JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. +Type=Application +Terminal=false +Icon=/opt/jabref/lib/JabRef.png +Exec=/opt/jabref/bin/JabRef %U +Keywords=bibtex;biblatex;latex;bibliography +Categories=Office; +StartupWMClass=org-jabref-JabRefMain +MimeType=text/x-bibtex; diff --git a/buildres/linux/postinst b/buildres/linux/postinst index 5fc0de1ee5d..e549bb529cf 100644 --- a/buildres/linux/postinst +++ b/buildres/linux/postinst @@ -21,8 +21,8 @@ case "$1" in configure) INSTALL_PATH="/usr/lib/mozilla/native-messaging-hosts/" mkdir -p $INSTALL_PATH - \cp /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH - chmod a+x "/opt/jabref/lib/jabrefHost.py" + install -D -m0755 /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH + install -D -m0644 /opt/jabref/lib/jabref.desktop /usr/share/applications/ ;; abort-upgrade|abort-remove|abort-deconfigure) From c08724068405382473fed1a884d25f11d61bd505 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Mon, 14 Oct 2019 15:20:02 +0200 Subject: [PATCH 2/4] install -D creates leading components --- buildres/linux/postinst | 1 - 1 file changed, 1 deletion(-) diff --git a/buildres/linux/postinst b/buildres/linux/postinst index e549bb529cf..685ea6de53e 100644 --- a/buildres/linux/postinst +++ b/buildres/linux/postinst @@ -20,7 +20,6 @@ set -e case "$1" in configure) INSTALL_PATH="/usr/lib/mozilla/native-messaging-hosts/" - mkdir -p $INSTALL_PATH install -D -m0755 /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH install -D -m0644 /opt/jabref/lib/jabref.desktop /usr/share/applications/ ;; From e68acbe5c3b311b8d439286b23416c23a66b098d Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Mon, 14 Oct 2019 22:23:27 +0200 Subject: [PATCH 3/4] Use templates for copyright desktop postinst --- build.gradle | 12 +++++++++--- buildres/linux/JabRef.png | Bin 0 -> 3454 bytes buildres/linux/copyright | 5 +++++ buildres/linux/desktop.properties | 1 + buildres/linux/jabref-JabRef.desktop | 11 +++++++++++ buildres/linux/jabref.desktop | 12 ------------ buildres/linux/postinst | 2 +- 7 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 buildres/linux/JabRef.png create mode 100644 buildres/linux/copyright create mode 100644 buildres/linux/desktop.properties create mode 100644 buildres/linux/jabref-JabRef.desktop delete mode 100644 buildres/linux/jabref.desktop diff --git a/build.gradle b/build.gradle index a7c3add4c7d..4270b7ea072 100644 --- a/build.gradle +++ b/build.gradle @@ -594,8 +594,14 @@ jlink { installerOptions = [ '--vendor', 'JabRef', '--app-version', "${project.version}", - //'--temp', "$buildDir/installer", - '--resource-dir', "${projectDir}/buildres/linux" + // '--temp', "$buildDir/installer", + '--resource-dir', "${projectDir}/buildres/linux", + '--linux-menu-group', 'Office;', + '--linux-rpm-license-type', 'MIT', + // '--license-file', "${projectDir}/LICENSE.md", + '--file-associations', "${projectDir}/buildres/linux/desktop.properties", + '--description', 'JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format.', + '--linux-shortcut' ] } @@ -626,7 +632,7 @@ if (OperatingSystem.current().isLinux()) { tasks.jpackageImage.doLast { copy { from("${projectDir}/buildres/linux") { - include "org.jabref.jabref.json", "jabrefHost.py", "jabref.desktop" + include "org.jabref.jabref.json", "jabrefHost.py" } into "$buildDir/distribution/JabRef/lib" } diff --git a/buildres/linux/JabRef.png b/buildres/linux/JabRef.png new file mode 100644 index 0000000000000000000000000000000000000000..e807e0448d315ea926ba1b8d296b70e6e705fa6c GIT binary patch literal 3454 zcmV-^4T18BP)z>%8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H14Esq$K~#90?VEjc)a8}OKlk^WyrP79P&~DZ78k3P?h)CZ+TEpY zwic>DW+t|SLQN(RKse+L!rI~;ZT=Xpj{l~gdZq;5>U zXUp}aS=RGo&JM;)c! z=AwD^<5O)sT@=l$AMYsjHXCXl1szIWc~4+j|5$TU&xHe0cKAmV*b^1fz2MqJ{}Fz)Z#ZnqWL2u)Nb>wJY9k!T{LIypM>=OEID#$Zo-U zzAI4kBh_$^D=hTb#@<@6N|2{Ob7SfcfIiXXukntQIDo_LtpWKy5YxBi0&4x!nP2v< zjS?3@9Hri`DaPZVbBO8UD*9-5Tg|q3+le!v%=efo?TMUGIBp2OzU$5AeT@};0CUP3 zC!15J+vhv| z)y=A?qty3}{`^yKE4m4oIGnv?oDv2=lSC^C?m*b-aQk)^&8r{Z{X*6I{bS7;3bA8I zt<&vYnX17^-P#z@56>9AU+r#Le!6I0{dkAlw-aF}a7U^(lW|Ho2F#xS+^0<2g(4B= zfXo1{PqCf%4VChaK-C@*#P0Szi}FOItWPlS9&Q=!bT{3ugx&&j!j4OQPoQd*Dq39H zFxwK{1WZWLpN~KfsIog0%4J4dv!n z^lV&w&R*tyTvU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ln?toPJFr%Gm%o8w!rfe&C-nqMQwYT+{f(Wk8g( z0iXjTTGn2Zh;k0k>1zALb%7}7a0VC|ABJC)>XKX=7%ZmR1zGyFP_zOYH z5#}@Gdd(=n3TJ=~K!u!9;;+Czt7yx>^|sFF_4;Ip1g7$#%BEFW9|fJFvJm(xqwr;> z!e9Ud&A!5I{I4p0!=SaZt@>oT%8@{A1GYKKe79K^3q)`Oe|DuDl*k={!3;?2f>=Tf z0NpCua_?=u2QvMWL_8t^e9GhTJpJa$u`?oBVJE#C?U!I^2B?uu;_Jbwn0i}PT5?Qt zbE^N<%LI{tz5=}BTF`W3UnumLh%N;Ad?xn7oHNgWKPtLiMK|@dt@wE+4vYkmK(7bZ z7nQBQPgKeUnM)e?h=yc98g~R=S7B4m+3X!Vb}aj2ntqQ8A}`?QF4u)blFK!pG>)~%TeI{tL+=8_L04(HZ2C};=Q28&({w;E?Bl1GOE5i32 grHy}Qp*H~hA77DHO_lL3L;wH)07*qoM6N<$f=W=UA^-pY literal 0 HcmV?d00001 diff --git a/buildres/linux/copyright b/buildres/linux/copyright new file mode 100644 index 00000000000..5e06048e6f0 --- /dev/null +++ b/buildres/linux/copyright @@ -0,0 +1,5 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: * +Copyright: APPLICATION_COPYRIGHT +License: APPLICATION_LICENSE_TEXT \ No newline at end of file diff --git a/buildres/linux/desktop.properties b/buildres/linux/desktop.properties new file mode 100644 index 00000000000..a7798f073f5 --- /dev/null +++ b/buildres/linux/desktop.properties @@ -0,0 +1 @@ +mime-type=text/x-bibtex; \ No newline at end of file diff --git a/buildres/linux/jabref-JabRef.desktop b/buildres/linux/jabref-JabRef.desktop new file mode 100644 index 00000000000..47b3b7c5105 --- /dev/null +++ b/buildres/linux/jabref-JabRef.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=APPLICATION_NAME +GenericName=BibTeX Editor +Comment=APPLICATION_DESCRIPTION +Exec=APPLICATION_LAUNCHER +Icon=APPLICATION_ICON +Terminal=false +Type=Application +Categories=DEPLOY_BUNDLE_CATEGORY +Keywords=bibtex;biblatex;latex;bibliography +StartupWMClass=org-jabref-JabRefMain \ No newline at end of file diff --git a/buildres/linux/jabref.desktop b/buildres/linux/jabref.desktop deleted file mode 100644 index e284eccd63d..00000000000 --- a/buildres/linux/jabref.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Name=JabRef -GenericName=BibTeX Editor -Comment=JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. -Type=Application -Terminal=false -Icon=/opt/jabref/lib/JabRef.png -Exec=/opt/jabref/bin/JabRef %U -Keywords=bibtex;biblatex;latex;bibliography -Categories=Office; -StartupWMClass=org-jabref-JabRefMain -MimeType=text/x-bibtex; diff --git a/buildres/linux/postinst b/buildres/linux/postinst index 685ea6de53e..40791c02384 100644 --- a/buildres/linux/postinst +++ b/buildres/linux/postinst @@ -21,7 +21,7 @@ case "$1" in configure) INSTALL_PATH="/usr/lib/mozilla/native-messaging-hosts/" install -D -m0755 /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH - install -D -m0644 /opt/jabref/lib/jabref.desktop /usr/share/applications/ + DESKTOP_COMMANDS_INSTALL ;; abort-upgrade|abort-remove|abort-deconfigure) From 9ed91c7d256c8f7be19edc16f7cd91e9e32008a6 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Tue, 15 Oct 2019 14:47:05 +0200 Subject: [PATCH 4/4] add postrm to remove native-messagin-hosts python script --- buildres/linux/prerm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 buildres/linux/prerm diff --git a/buildres/linux/prerm b/buildres/linux/prerm new file mode 100644 index 00000000000..1c6f04c7db5 --- /dev/null +++ b/buildres/linux/prerm @@ -0,0 +1,32 @@ +#!/bin/sh +# postrm script for APPLICATION_PACKAGE +# +# see: dh_installdeb(1) +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + INSTALL_PATH="/usr/lib/mozilla/native-messaging-hosts/" + if grep --quiet '"path": "/opt' /usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json; then + rm -D -m0755 /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0 \ No newline at end of file