summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Guinn <elyk03@gmail.com>2015-02-28 20:04:15 -0600
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-03-08 06:35:12 +0700
commit8096b9924257ad5dcbdfd805bd6ff985c3c7378b (patch)
tree01a9efcd294e0f258c4137e5d1336b1005e4d515
parentc2116761843b9e6234d170f1c1d21f6ab3e0c814 (diff)
downloadslackbuilds-8096b9924257ad5dcbdfd805bd6ff985c3c7378b.tar.gz
libraries/lapack: Add man pages.
Thanks to Mario Benincasa for the suggestion. Signed-off-by: Kyle Guinn <elyk03@gmail.com>
-rw-r--r--libraries/lapack/lapack.SlackBuild54
1 files changed, 52 insertions, 2 deletions
diff --git a/libraries/lapack/lapack.SlackBuild b/libraries/lapack/lapack.SlackBuild
index cdfdd9e89b..44526623f0 100644
--- a/libraries/lapack/lapack.SlackBuild
+++ b/libraries/lapack/lapack.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for LAPACK
-# Copyright 2014 Kyle Guinn <elyk03@gmail.com>, USA
+# Copyright 2014-2015 Kyle Guinn <elyk03@gmail.com>, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,7 +24,7 @@
PRGNAM=lapack
VERSION=${VERSION:-3.5.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -121,6 +121,56 @@ sed -i \
-e "/^Libs:/s/-L[^ ]*/-L\${libdir}/" \
$PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/lapack.pc
+# Generate man pages. Also requires some fix-ups:
+# 1. Version is wrong.
+# 2. Only generate on the LAPACK sources.
+# 3. Turn off some repetitive comments.
+# 4. Turn off HAVE_DOT. Graphs are unnecessary for this purpose.
+# 5. Turn off MAN_LINKS. See below.
+sed -i \
+ -e "s/^\(PROJECT_NUMBER *=\).*/\1 ${VERSION}/" \
+ -e "s/^\(INPUT *=\).*/\1 SRC/" \
+ -e "s/^\(REPEAT_BRIEF *=\).*/\1 NO/" \
+ -e "s/^\(HAVE_DOT *=\).*/\1 NO/" \
+ -e "s/^\(MAN_LINKS *=\).*/\1 NO/" \
+ DOCS/Doxyfile_man
+doxygen DOCS/Doxyfile_man
+# Doxygen generates manpages on a file-by-file basis (note the .f extensions).
+# We want a page for each function, not each file. MAN_LINKS creates a page
+# for each function that just sources the page for the corresponding file.
+# This adds a lot of bloat. Luckily, functions map 1:1 with files, so we can
+# rename .f.3 -> .3 to have the page named after the function.
+mkdir -p $PKG/usr/man/man3
+for i in DOCS/man/man3/*.f.3; do
+ gzip -9c $i > $PKG/usr/man/man3/$(basename $i .f.3).3.gz
+done
+# Fix up some special cases where the mapping isn't 1:1.
+ln -s sladiv.3.gz $PKG/usr/man/man3/sladiv1.3.gz
+ln -s sladiv.3.gz $PKG/usr/man/man3/sladiv2.3.gz
+ln -s dladiv.3.gz $PKG/usr/man/man3/dladiv1.3.gz
+ln -s dladiv.3.gz $PKG/usr/man/man3/dladiv2.3.gz
+
+# Generate a few more man pages from the INSTALL directory, but copy only a
+# select few. Some are duplicated by BLAS (lsame.f), by LAPACK (ilaver.f),
+# are unused (slamchf77.f, dlamchf77.f), or are test programs.
+rm -rf DOCS/man
+sed -i "s/^\(INPUT *=\).*/\1 INSTALL/" DOCS/Doxyfile_man
+doxygen DOCS/Doxyfile_man
+gzip -9c DOCS/man/man3/slamch.f.3 > $PKG/usr/man/man3/slamch.3.gz
+gzip -9c DOCS/man/man3/dlamch.f.3 > $PKG/usr/man/man3/dlamch.3.gz
+ln -s slamch.3.gz $PKG/usr/man/man3/slamc3.3.gz
+ln -s dlamch.3.gz $PKG/usr/man/man3/dlamc3.3.gz
+# The timer implementation is chosen at configure time. Install the pages for
+# all implementations and create a link for the chosen one.
+for i in DOCS/man/man3/second_*.f.3 DOCS/man/man3/dsecnd_*.f.3; do
+ gzip -9c $i > $PKG/usr/man/man3/$(basename $i .f.3).3.gz
+done
+TIME_FUNC=$(grep '^TIME_FUNC' shared/CMakeCache.txt | cut -f2 -d=)
+if [ -n "${TIME_FUNC}" ]; then
+ ln -s second_${TIME_FUNC}.3.gz $PKG/usr/man/man3/second.3.gz
+ ln -s dsecnd_${TIME_FUNC}.3.gz $PKG/usr/man/man3/dsecnd.3.gz
+fi
+
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild