office/openoffice.org: Add submenu support.

Signed-off-by: bedlam <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Juan M. Lasca 2023-05-18 20:48:15 +01:00 committed by Willy Sudiarto Raharjo
parent 453043e9d3
commit 3452699238
No known key found for this signature in database
GPG key ID: 3F617144D7238786
4 changed files with 52 additions and 1 deletions

View file

@ -13,3 +13,10 @@ Apache recommends having either jre or jdk installed, but it is not
required. See more details here:
https://wiki.openoffice.org/wiki/Java_and_OpenOffice.org
NOTE: submenus
By default, the menu entries grouped in a submenu folder
(multilevel menu entry). If you want to disable this, do:
SUBMENU="NO" ./openoffice.org.SlackBuild

View file

@ -35,7 +35,7 @@ PRGNAM=openoffice.org
SRCNAM=openoffice
VERSION=${VERSION:-4.1.14}
BUILD_ID=${BUILD_ID:-9811}
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
SRCSHORT=$(echo $VERSION | cut -f1 -d.)
@ -156,6 +156,23 @@ done
## menu icons!
cp -R $TMP/$SOURCEDIR/RPMS/desktop-integration/usr/share/icons $PKG/usr/share/
# The following was adapted from a patch submitted by Petar Petrov
# Do we want a submenu? For more info:
# https://slackalaxy.com/2021/08/08/xfce-multilevel-menu/
SUBMENU=${SUBMENU:-"YES"}
if [ "$SUBMENU" = "YES" ]; then
# Use a separate "OpenOffice" menu entry within "Office"
mkdir -p $PKG/etc/xdg/menus/applications-merged
cp $CWD/submenus/openoffice.menu $PKG/etc/xdg/menus/applications-merged
# Menu directory structure
mkdir -p $PKG/usr/share/desktop-directories
cp $CWD/submenus/openoffice.directory $PKG/usr/share/desktop-directories
# The category in the .desktop files is commented out to avoid duplication in menus
sed -i "s:Categories:#Categories:" $PKG/usr/share/applications/*.desktop
fi
## Move docs to their expected locations
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cd $PKG/opt/${SRCNAM}${SRCSHORT}

View file

@ -0,0 +1,4 @@
[Desktop Entry]
Type=Directory
Name=OpenOffice
Icon=openoffice4-main

View file

@ -0,0 +1,23 @@
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
<Name>Applications</Name>
<Menu>
<Name>Office</Name>
<Directory>xfce4-office.directory</Directory>
<Menu>
<Name>OpenOffice</Name>
<Directory>openoffice.directory</Directory>
<Include>
<Filename>open-base.desktop</Filename>
<Filename>open-calc.desktop</Filename>
<Filename>open-draw.desktop</Filename>
<Filename>open-impress.desktop</Filename>
<Filename>open-math.desktop</Filename>
<Filename>open-printeradmin.desktop</Filename>
<Filename>open-startcenter.desktop</Filename>
<Filename>open-writer.desktop</Filename>
</Include>
</Menu>
</Menu>
</Menu>