Discussion:
[Slackbuilds-users] libreoffice.SlackBuild: request for enhancement
Sebastien BALLET
2018-10-17 15:37:30 UTC
Permalink
Hello,

The .desktop files installed in /opt/libreoffice<VER>/share/xdg and
symlinks to that files in /usr/share/applications have version number
in their name (ex libreoffice6.1-writer.desktop) which force user to
re-create/update any links/reference (placed on KDE desktop for instance)
to that files on each libreoffice version number increment.

To avoid that, the patch below (also in attachment) creates symlinks
without libreoffice version number in their names in
/usr/share/applications.

8<---------------------------------------------------------------------------------------------
--- libreoffice.SlackBuild.orig 2018-09-29 02:53:10.000000000 +0200
+++ libreoffice.SlackBuild 2018-10-17 17:29:22.368225124 +0200
@@ -130,6 +130,17 @@
ln -sf ../../opt/libreoffice$SRCSHORT/program/swriter lowriter

cd -
+
+# creates symlinks in /usr/share/applications to libreoffice .desktop
files
+# (found in /opt/libreoffice<version>/share/xdg) without libreoffice
version
+# number in symlink names.
+#
+cd $PKG/usr/share/applications
+ for APP in base calc draw impress math startcenter writer ; do
+ ln -sf ../../../opt/libreoffice$SRCSHORT/share/xdg/$APP.desktop
$PRGNAM-$APP.desktop
+ done
+cd -
+
# Remove DejaVu and Liberation fonts - these are included in other packages
rm -f
opt/libreoffice$SRCSHORT/share/fonts/truetype/{DejaVu,Liberation}*.ttf
8<---------------------------------------------------------------------------------------------
--
SeB
Willy Sudiarto Raharjo
2018-10-17 17:13:42 UTC
Permalink
Post by Sebastien BALLET
The .desktop files installed in /opt/libreoffice<VER>/share/xdg and
symlinks to that files in /usr/share/applications have version number 
in their name (ex libreoffice6.1-writer.desktop) which force user to
re-create/update any links/reference (placed on KDE desktop for instance)
to that files on each libreoffice version number increment.
To avoid that, the patch below (also in attachment) creates symlinks
without libreoffice version number in their names in
/usr/share/applications.
Hi Sebastien

Thanks for the patch.
I tested here and it creates a duplicate entries since the old .desktop
files are still there :)
--
Willy Sudiarto Raharjo
Sebastien BALLET
2018-10-17 18:36:17 UTC
Permalink
Hello,

oh ! I forgot to mention that the patch does not remove the "original"
symlinks found in /usr/share/applications (ie. those with version number).
If you want to get rid of those and have only "unversioned" symlinks, the
patch below (and in attachment) should do the trick:

8<-------------------------------------------------------------------
--- libreoffice.SlackBuild.orig 2018-10-17 20:26:30.628052769 +0200
+++ libreoffice.SlackBuild 2018-10-17 20:26:30.628052769 +0200
@@ -130,6 +130,24 @@
ln -sf ../../opt/libreoffice$SRCSHORT/program/swriter lowriter

cd -
+
+# the .desktop files installed in /opt/libreoffice<VER>/share/xdg and
+# symlinks to that files in /usr/share/applications have version number
+# in their name (ex libreoffice6.1-writer.desktop) which force user to
+# re-create/update any link/reference (ex: on KDE/XFCE desktop, in fluxbox
+# menu file, in wmalauncher configuration file,...) to that files on each
+# libreoffice version number increment.
+#
+# To avoid that, the code below deletes the "versioned" symlinks
+# and creates news without version number in their names.
+#
+cd $PKG/usr/share/applications
+ for APP in base calc draw impress math startcenter writer xsltfilter ; do
+ rm -f $PRGNAM$SRCSHORT-$APP.desktop
+ ln -sf ../../../opt/libreoffice$SRCSHORT/share/xdg/$APP.desktop
$PRGNAM-$APP.desktop
+ done
+cd -
+
# Remove DejaVu and Liberation fonts - these are included in other packages
rm -f
opt/libreoffice$SRCSHORT/share/fonts/truetype/{DejaVu,Liberation}*.ttf
8<-------------------------------------------------------------------

With that, you'll only find "unversioned" symlinks :

8<-------------------------------------------------------------------
$ ls -ld /usr/share/applications/libreoffice*.desktop
lrwxrwxrwx 1 root root 50 oct. 17 20:22
/usr/share/applications/libreoffice-base.desktop ->
../../../opt/libreoffice6.1/share/xdg/base.desktop
lrwxrwxrwx 1 root root 50 oct. 17 20:22
/usr/share/applications/libreoffice-calc.desktop ->
../../../opt/libreoffice6.1/share/xdg/calc.desktop
lrwxrwxrwx 1 root root 50 oct. 17 20:22
/usr/share/applications/libreoffice-draw.desktop ->
../../../opt/libreoffice6.1/share/xdg/draw.desktop
lrwxrwxrwx 1 root root 53 oct. 17 20:22
/usr/share/applications/libreoffice-impress.desktop ->
../../../opt/libreoffice6.1/share/xdg/impress.desktop
lrwxrwxrwx 1 root root 50 oct. 17 20:22
/usr/share/applications/libreoffice-math.desktop ->
../../../opt/libreoffice6.1/share/xdg/math.desktop
lrwxrwxrwx 1 root root 57 oct. 17 20:22
/usr/share/applications/libreoffice-startcenter.desktop ->
../../../opt/libreoffice6.1/share/xdg/startcenter.desktop
lrwxrwxrwx 1 root root 52 oct. 17 20:22
/usr/share/applications/libreoffice-writer.desktop ->
../../../opt/libreoffice6.1/share/xdg/writer.desktop
lrwxrwxrwx 1 root root 56 oct. 17 20:22
/usr/share/applications/libreoffice-xsltfilter.desktop ->
../../../opt/libreoffice6.1/share/xdg/xsltfilter.desktop
8<-------------------------------------------------------------------

--
SeB

Le mer. 17 oct. 2018 à 19:13, Willy Sudiarto Raharjo <
Post by Willy Sudiarto Raharjo
Post by Sebastien BALLET
The .desktop files installed in /opt/libreoffice<VER>/share/xdg and
symlinks to that files in /usr/share/applications have version number
in their name (ex libreoffice6.1-writer.desktop) which force user to
re-create/update any links/reference (placed on KDE desktop for instance)
to that files on each libreoffice version number increment.
To avoid that, the patch below (also in attachment) creates symlinks
without libreoffice version number in their names in
/usr/share/applications.
Hi Sebastien
Thanks for the patch.
I tested here and it creates a duplicate entries since the old .desktop
files are still there :)
--
Willy Sudiarto Raharjo
_______________________________________________
SlackBuilds-users mailing list
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
Willy Sudiarto Raharjo
2018-10-17 21:04:28 UTC
Permalink
Post by Sebastien BALLET
oh ! I forgot to mention that the patch does not remove the "original"
symlinks found in /usr/share/applications (ie. those with version
number). If you want to get rid of those and have only "unversioned"
Thanks

pushed in my branch
--
Willy Sudiarto Raharjo
Loading...