LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-13-2019, 10:28 AM   #1
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Xubuntu
Posts: 459
Blog Entries: 2

Rep: Reputation: 194Reputation: 194
A patch to get libreoffice-{help,lang}pack.SlackBuild to properly generate slack-desc files.


The ‘libreoffice-helppack’ and ‘libreoffice-langpack’ SlackBuilds do not properly generate their package description files, ‘slack-desc’. They simply install a fixed copy of the file, in which the base package name is invariably set to “libreoffice-helppack” and “libreoffice-langpack”, respectively. Since this package name is incorrect, the package description will not get displayed while such a package is being installed.

The following patches will dynamically generate the package description files, with the correct base package names. I tested the patched SlackBuild scripts on the longest occurring language name, “ca-valencia”, to verify that they would not produce any excessively long output lines.

Patch for ‘libreoffice-helppack’.
Code:
--- libreoffice-helppack.SlackBuild.orig	2019-10-13 16:24:54.593156985 +0200
+++ libreoffice-helppack.SlackBuild	2019-10-13 16:36:08.444184022 +0200
@@ -90,7 +90,31 @@
 cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
 
 mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
+SLACKDESC_BASENAME="${PRGNAM}"'_'"${PKG_LANG}"
+SLACKDESC_SPACENAM=$(echo "${SLACKDESC_BASENAME}" | sed 's/./ /g')
+LANGNAMES_JS="$PKG"'/opt/libreoffice'"${SRCSHORT}"'/help/'"${LOLANG}"'/langnames.js'
+SLACKDESC_LANGNAME=$(sed -nre 's~^ *"'"${LOLANG}"'" *: *"([^"]+)".*$~\1~p' "${LANGNAMES_JS}" 2> /dev/null || echo "${LOLANG}")
+cat > "$PKG"'/install/slack-desc' <<//*END_OF_SLACK_DESC
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+${SLACKDESC_SPACENAM}|-----handy-ruler------------------------------------------------------|
+${SLACKDESC_BASENAME}: ${SLACKDESC_BASENAME} (for LibreOffice Productivity Suite)
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}: Built-in Help Pack for LibreOffice productivity suite.
+${SLACKDESC_BASENAME}: Language: ${SLACKDESC_LANGNAME}.
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}: Homepage: https://www.libreoffice.org
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}:
+//*END_OF_SLACK_DESC
 
 # Fix ownership and permissions and make the package
 chown -R root:root .
NOTE: In addition to getting the base package name right, this patch will include a line that shows the full name of the language to which the package applies. (It gets this name from the ‘langnames.js’ file extracted from the RPM).

Patch for ‘libreoffice-langpack’.
Code:
--- libreoffice-langpack.SlackBuild.orig	2019-10-13 16:42:19.642198915 +0200
+++ libreoffice-langpack.SlackBuild	2019-10-13 16:44:49.833204942 +0200
@@ -95,7 +95,29 @@
 cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
 
 mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
+SLACKDESC_BASENAME="${PRGNAM}"'_'"${PKG_LANG}"
+SLACKDESC_SPACENAM=$(echo "${SLACKDESC_BASENAME}" | sed 's/./ /g')
+cat > "$PKG"'/install/slack-desc' <<//*END_OF_SLACK_DESC
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+${SLACKDESC_SPACENAM}|-----handy-ruler------------------------------------------------------|
+${SLACKDESC_BASENAME}: ${SLACKDESC_BASENAME} (for LibreOffice Productivity Suite)
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}: Built-in Help Pack for LibreOffice productivity suite.
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}: Homepage: https://www.libreoffice.org
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}:
+${SLACKDESC_BASENAME}:
+//*END_OF_SLACK_DESC
 
 # Fix ownership and permissions and make the package
 chown -R root:root .
(Unfortunately, the language pack RPMs do not come with something like the ‘langnames.js’ file, so the package description cannot show the full language name.)
 
Old 10-13-2019, 04:59 PM   #2
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 914

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Since this relates to a SlackBuilds.org SlackBuild (rather than Slackware itself), suggestions like this are better posted to SlackBuilds-users@slackbuilds.org or, better still, emailed directly to the maintainer - who is always shown in the relevant .info file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] $LANG per user doesn't obey the global $LANG set in /etc/profile.d/lang.sh me_h Slackware 23 11-20-2016 07:28 AM
[Patch and SlackBuild] Grub-2.02~beta2 SlackBuild and Patch. ReaperX7 Slackware 3 01-28-2015 09:30 AM
What is the use of lang in <head lang=''> tooparam Programming 2 02-01-2006 05:55 PM
Can't get intallpkg to display contents of slack-desc in custom packages. jtX Slackware 4 03-16-2004 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration