3 ### Install library manual pages with many symlinks
5 ### (c) 2003, 2013, 2016, 2020 Straylight/Edgeware
8 ###----- Licensing notice ---------------------------------------------------
10 ### This file is part of the Common Files Distribution (`common').
12 ### `Common' is free software; you can redistribute it and/or modify
13 ### it under the terms of the GNU General Public License as published by
14 ### the Free Software Foundation; either version 2 of the License, or
15 ### (at your option) any later version.
17 ### `Common' is distributed in the hope that it will be useful,
18 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ### GNU General Public License for more details.
22 ### You should have received a copy of the GNU General Public License
23 ### along with `common'; if not, write to the Free Software Foundation,
24 ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 ext="" mandir=/usr/local/man srcdir=. inst=install mode=644
28 while [ $# -gt 0 ]; do
31 echo "$0: [-e EXT] [-d DIR] [-i INSTALL] [-m MODE] [un]install FILE ..."
34 -e) ext=$2; shift 2 ;;
35 -d) mandir=$2; shift 2 ;;
36 -i) inst=$2; shift 2 ;;
37 -m) mode=$2; shift 2 ;;
38 -s) srcdir=$2; shift 2 ;;
40 -*) echo >&2 "$0: unknown option \`$1'"; exit 1 ;;
46 install | uninstall) ;;
47 *) echo >&2 "$0: unknown operation \`$1'"; exit 1 ;;
50 base=${i##*/} sec=${base##*.}
53 echo -n " Installing manpage $base$ext"
54 $inst -d "$mandir/man$sec"
55 $inst -m $mode "$srcdir/$i" "$mandir/man$sec/$base$ext"
58 rm -f "$mandir/man$sec/$base$ext"
61 for l in `sed 's:^\.\\\" *@::p; d' "$srcdir/$i"`; do
64 if [ "$l.$sec" != "$base" ]; then
66 echo ".so man$sec/$base$ext" >"$mandir/man$sec/$l.$sec$ext"
67 chmod $mode "$mandir/man$sec/$l.$sec$ext"
71 rm -f "$mandir/man$sec/$l.$sec$ext"