Linux HOWTOs

About | Home | Search


HOWTO: help2man
Description: Creates a man page from --help and --version output of a program
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# GNU help2man 1.47.4
# ===================
# Slackware 14.1: help2man 1.43.3
# Slackware 14.2: help2man 1.46.5

# Prerequisites:
# Perl
# texinfo
# gettext >= 0.12.1 (0.11.5 doesn't have the required preloadable_libintl.so)

# If you have trouble downloading it with the URL below:
# http://ftp.gnu.org/gnu/help2man/
# ftp://ftp.gnu.org/gnu/help2man/

# Get it
cd
test -f installed/help2man-1.47.4.tar.xz &&
 mv installed/help2man-1.47.4.tar.xz .
test ! -f help2man-1.47.4.tar.xz &&
 wget http://ftpmirror.gnu.org/help2man/help2man-1.47.4.tar.xz

# Verify tarball w/ sha1sum:
# (this came from my gpg-verified tarball)
echo "5bc859694eb7b8f7196514bf42c449b7dd6cfc27  help2man-1.47.4.tar.xz" | \
sha1sum -c

# Verify tarball w/ sha256sum:
# (this also came from my gpg-verified tarball)
echo "d4ecf697d13f14dd1a78c5995f06459bff706fd1ce593d1c02d81667c0207753  h\
elp2man-1.47.4.tar.xz" | sha256sum -c

# Verify tarball w/ gpg:
( gpg --list-keys B28C5995 > /dev/null 2>&1 || gpg --recv-keys B28C5995 ) &&
 wget -nc http://ftp.gnu.org/gnu/help2man/help2man-1.47.4.tar.xz.sig &&
  gpg --verify help2man-1.47.4.tar.xz.sig && rm help2man-1.47.4.tar.xz.sig

# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "help2man-*" -exec rm -r {} \;
tar xJvf ~/help2man-1.47.4.tar.xz
cd help2man-1.47.4
test $UID = 0 && chown -R root:root .

# Configure the build - 64-bit
test $(uname -m) = 'x86_64' &&
./configure --infodir=/usr/local/info --libdir=/usr/local/lib64 \
--mandir=/usr/local/man --disable-nls

# Configure the build - anything else
test $(uname -m) != 'x86_64' &&
./configure --infodir=/usr/local/info --mandir=/usr/local/man --disable-nls

# Build it
make

# Become root to install it
su

# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg help2man

# Install/update the perl module Locale::gettext (used to be just
# 'gettext'):
perl -MCPAN -e shell
install Bundle::CPAN
install Locale::gettext
exit

# Install help2man
make install

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/help2man-*.tar.* installed/help2man_*.tar.*
mv help2man-1.47.4.tar.xz installed/


# If you ever want to uninstall help2man, this should do it:
cd
su
test -d src/help2man-* && ( cd src/help2man-* ; make uninstall )
rm -f /usr/local/bin/help2man /usr/local/info/help2man.info
test -d /usr/local/lib/help2man && rm -r /usr/local/lib/help2man
test -d /usr/local/lib64/help2man && rm -r /usr/local/lib64/help2man
exit
find ~/src -maxdepth 1 -type d -name "help2man-*" -exec rm -r {} \;
rm -f ~/installed/help2man-*.tar.*

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>