LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 01-29-2020, 08:16 PM   #1
phalange
Member
 
Registered: May 2018
Distribution: Slackware, FreeBSD, Debian
Posts: 355

Rep: Reputation: 184Reputation: 184
Creating slackbuild, struggling with man pages


I'm working on a Slackbuild and bumping on the man pages.

The build works fine in all other respects, but I get an error on the "find $PKG/usr/man" line that the directory can't be found.

I added the cp -r line as a test because there is a 'man' directory containing manual pages as asciidocs in the expanded tarball's top level. But this hack simply resulted in man docs that went to /usr/man/ instead of /usr/man/man1 and were unreadable as well (the 'man' command gave a "bogus filename" error after install).

Please excuse boilerplate in the script below, it's a work in progress.

Any advice is most appreciated.

Code:
PRGNAM=picom			# replace with name of program
VERSION=${VERSION:-7.5}	        # replace with version of program
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}		# the "_SBo" is required

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}	# For consistency's sake, use this
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}	# Drop the package in /tmp

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e # Exit on most errors

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

mkdir build
cd build
  CFLAGS="$SLKCFLAGS" \
  CXXFLAGS="$SLKCFLAGS" \
  meson .. \
    --buildtype=release \
    --infodir=/usr/info \
    --libdir=/usr/lib${LIBDIRSUFFIX} \
    --localstatedir=/var \
    --mandir=/usr/man \
    --prefix=/usr \
    --sysconfdir=/etc
  ninja
  DESTDIR=$PKG ninja install
cd ..

# Strip binaries and libraries - this can be done with 'make install-strip'
# in many source trees, and that's usually acceptable if so, but if not,
# use this:
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

# Compress man pages
# If the man pages are installed to /usr/share/man instead, you'll need to either
# add the --mandir=/usr/man flag to configure or move them manually after the
# make install process is run.
cp -r $TMP/$PRGNAM-$VERSION/man $PKG/usr/

find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done

# Remove perllocal.pod and other special files that don't need to be installed,
# as they will overwrite what's already on the system.  If this is not needed,
# remove it from the script.
# Remove 'special' files
find $PKG -name perllocal.pod \
  -o -name ".packlist" \
  -o -name "*.bs" \
  | xargs rm -f

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  CONTRIBUTORS COPYING LICENSE.spdx README.md README_orig.md \
  $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

# Copy the slack-desc (and a custom doinst.sh if necessary) into ./install
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

# Make the package; be sure to leave it in $OUTPUT
# If package symlinks need to be created during install *before*
# your custom contents of doinst.sh runs, then add the -p switch to
# the makepkg command below -- see makepkg(8) for details
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
 
Old 01-29-2020, 08:55 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
I am at my work computer and am unable to run the script, but have a look in your $PKG/ directory and see what's there. It should be /tmp/SBo/package-picom/

Quick look through is that it seems normal, but maybe this program doesn't include a man page or sticks it somewhere not expected. If it is supposed to have a man page, you could try searching the above folder for what you're looking for. Then you can check and see if there's a configuration option that needs to be tweaked or if you need to manually move it to where it needs to be.
 
1 members found this post helpful.
Old 01-29-2020, 10:51 PM   #3
Skaendo
Senior Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
According to Arch, there is a (actually 2) manpage, but it might be in the non-normal place. You might need to move it with your SlackBuild from
$PKG/usr/share/man to $PKG/usr/man

a simple:
Code:
mv $PKG/usr/share/man $PKG/usr
should do the trick.

They might also already be compressed by the build, in which case you don't need to recompress them and you can remove that command from the SlackBuild.

Last edited by Skaendo; 01-29-2020 at 10:57 PM.
 
1 members found this post helpful.
Old 01-30-2020, 04:29 AM   #4
franzen
Member
 
Registered: Nov 2012
Distribution: slackware
Posts: 535

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Quote:
Originally Posted by phalange View Post
I'm working on a Slackbuild and bumping on the man pages.
The build works fine in all other respects, but I get an error on the "find $PKG/usr/man" line that the directory can't be found.
I added the cp -r line as a test because there is a 'man' directory containing manual pages as asciidocs in the expanded tarball's top level.
Maybe something like this helps:
Code:
a2x --doctype manpage --format manpage $PRGNAM.1.txt
mkdir -p $PKG/usr/man/man1
cat $PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1
 
1 members found this post helpful.
Old 01-30-2020, 10:06 PM   #5
phalange
Member
 
Registered: May 2018
Distribution: Slackware, FreeBSD, Debian
Posts: 355

Original Poster
Rep: Reputation: 184Reputation: 184
Quote:
Originally Posted by Skaendo View Post
According to Arch, there is a (actually 2) manpage
Yeah I did find two in there, one for the main app and the second for transparency settings. Thanks for the link.


Quote:
Originally Posted by franzen View Post
Maybe something like this helps:
Code:
a2x --doctype manpage --format manpage $PRGNAM.1.txt
mkdir -p $PKG/usr/man/man1
cat $PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1
This is really helpful franzen, thanks.

The code I settled on is this, and the man pages now work perfectly.
Code:
a2x --doctype manpage --format manpage $TMP/$PRGNAM-$VERSION/man/$PRGNAM.1.asciidoc
a2x --doctype manpage --format manpage $TMP/$PRGNAM-$VERSION/man/$PRGNAM-trans.1.asciidoc
mkdir -p $PKG/usr/man/man1
cat $TMP/$PRGNAM-$VERSION/man/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1
cat $TMP/$PRGNAM-$VERSION/man/$PRGNAM-trans.1 > $PKG/usr/man/man1/$PRGNAM-trans.1

find $PKG/usr/man/ -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man/ -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
Thanks everyone for the feedback, it's much appreciated.
 
1 members found this post helpful.
  


Reply



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
man not working if man pages are on NFS share ehereth Linux - Software 21 08-10-2018 02:06 PM
BLFS 8.1: OpenSP places man pages in usr/man jr_bob_dobbs Linux From Scratch 1 02-13-2018 07:23 PM
[SOLVED] man pages - man command phillyfilly Linux - Newbie 4 02-10-2014 05:41 AM
What do you use for creating man pages? Randux Slackware 10 05-31-2006 04:18 AM

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

All times are GMT -5. The time now is 12:28 AM.

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