Debian Codegraph @

debian/createmanpages

raw
1 #!/bin/sh
2
3 set -e
4
5 if [ ! -x /usr/bin/help2man ]; then
6 echo "E: Missing /usr/bin/help2man, please install it from the cognate package."
7 exit 1
8 fi
9
10 if [ ! -n "$NAME" ]; then
11 NAME=`grep "^Description:" debian/control | sed 's/^Description: *//' | head -n1`
12 fi
13
14 if [ ! -n "$VERSION" ]; then
15 VERSION=`dpkg-parsechangelog | awk '/^Version:/ {print $2}' | sed -e 's/^[0-9]*://' -e 's/-.*//' -e 's/[+~]dfsg$//'`
16 fi
17
18 if [ ! -n "$PROGNAME" ]; then
19 PROGNAME=`grep "^Package:" debian/control | sed 's/^Package: *//' | head -n1`
20 fi
21
22 MANDIR=debian
23 PROGNAME=yaegi
24 HELPOPTION='--help'
25 NAME='Yet Another Elegant Go Interpreter'
26
27 echo "PROGNAME: '$PROGNAME'"
28 echo "NAME: '$NAME'"
29 echo "VERSION: '$VERSION'"
30 echo "MANDIR: '$MANDIR'"
31 echo "HELPOPTION: '$HELPOPTION'"
32
33 mkdir -p $MANDIR
34
35
36 AUTHOR=".SH AUTHOR\n \
37 This manpage was written by $DEBFULLNAME for the Debian distribution and\n \
38 can be used for any other usage of the program.\
39 "
40
41 # If program name is different from package name or title should be
42 # different from package short description change this here
43 progname=${PROGNAME}
44 help2man --no-info --no-discard-stderr --help-option="$HELPOPTION" \
45 --name="$NAME" \
46 --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
47 echo $AUTHOR >> $MANDIR/${progname}.1
48
49 echo "$MANDIR/*.1" > debian/yaegi.manpages
50
51 cat <<EOT
52 Please enhance the help2man output in '$MANDIR/${progname}.1'.
53 To inspect it, try 'nroff -man $MANDIR/${progname}.1'.
54 If very unhappy, try passing the HELPOPTION as an environment variable.
55 The following web page might be helpful in doing so:
56 http://liw.fi/manpages/
57 EOT