1613 |
15 Feb 23 |
peter |
#!/bin/sh |
1613 |
15 Feb 23 |
peter |
#$Id$ |
1613 |
15 Feb 23 |
peter |
#@configure_input@ |
1613 |
15 Feb 23 |
peter |
4 |
|
1613 |
15 Feb 23 |
peter |
# Copyright (C) 2023 Peter Johansson |
1613 |
15 Feb 23 |
peter |
6 |
# |
1613 |
15 Feb 23 |
peter |
# This file is part of svndigest, https://dev.thep.lu.se/svndigest |
1613 |
15 Feb 23 |
peter |
8 |
# |
1613 |
15 Feb 23 |
peter |
# This program is free software; you can redistribute it and/or modify |
1613 |
15 Feb 23 |
peter |
# it under the terms of the GNU General Public License as published by |
1613 |
15 Feb 23 |
peter |
# the Free Software Foundation; either version 3 of the License, or |
1613 |
15 Feb 23 |
peter |
# (at your option) any later version. |
1613 |
15 Feb 23 |
peter |
13 |
# |
1613 |
15 Feb 23 |
peter |
# This is distributed in the hope that it will be useful, but |
1613 |
15 Feb 23 |
peter |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
1613 |
15 Feb 23 |
peter |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1613 |
15 Feb 23 |
peter |
# General Public License for more details. |
1613 |
15 Feb 23 |
peter |
18 |
# |
1613 |
15 Feb 23 |
peter |
# You should have received a copy of the GNU General Public License |
1613 |
15 Feb 23 |
peter |
# along with svndigest. If not, see <https://www.gnu.org/licenses/>. |
1613 |
15 Feb 23 |
peter |
21 |
|
1613 |
15 Feb 23 |
peter |
# Script used when help2man is not available or we are cross |
1613 |
15 Feb 23 |
peter |
# compiling. It just copies the distributed man page; if there is no |
1613 |
15 Feb 23 |
peter |
# man page, it creates a stub man page instead. |
1613 |
15 Feb 23 |
peter |
25 |
|
1613 |
15 Feb 23 |
peter |
srcdir="@srcdir@" |
1613 |
15 Feb 23 |
peter |
RELEASE_YEAR=@RELEASE_YEAR@ |
1613 |
15 Feb 23 |
peter |
VERSION=@VERSION@ |
1613 |
15 Feb 23 |
peter |
29 |
|
1613 |
15 Feb 23 |
peter |
out= |
1613 |
15 Feb 23 |
peter |
while test $# -gt 0; do |
1613 |
15 Feb 23 |
peter |
case "$1" in |
1613 |
15 Feb 23 |
peter |
-o) shift; out=$1;; |
1613 |
15 Feb 23 |
peter |
34 |
*) ;; |
1613 |
15 Feb 23 |
peter |
esac |
1613 |
15 Feb 23 |
peter |
shift |
1613 |
15 Feb 23 |
peter |
done |
1613 |
15 Feb 23 |
peter |
38 |
|
1613 |
15 Feb 23 |
peter |
test -z "$out" && echo "error: no out provided" >&2 && exit 1 |
1613 |
15 Feb 23 |
peter |
40 |
|
1613 |
15 Feb 23 |
peter |
# if we find the distributed man page in $srcdir, copy it into the |
1613 |
15 Feb 23 |
peter |
# builddir. Copy via temporary file, in case src and target are the |
1613 |
15 Feb 23 |
peter |
# same file. |
1613 |
15 Feb 23 |
peter |
dist_man=$srcdir/$out |
1613 |
15 Feb 23 |
peter |
test -f $dist_man && cp $dist_man ${out}-t \ |
1613 |
15 Feb 23 |
peter |
&& rm -f ${out} && mv ${out}-t $out && exit || : |
1613 |
15 Feb 23 |
peter |
47 |
|
1613 |
15 Feb 23 |
peter |
program=`echo $out | sed -e 's,.*/,,' -e 's,\.1$,,'` |
1613 |
15 Feb 23 |
peter |
PROGRAM=`echo $program | tr [a-z] [A-Z]` |
1613 |
15 Feb 23 |
peter |
bs='\' |
1613 |
15 Feb 23 |
peter |
51 |
|
1613 |
15 Feb 23 |
peter |
sed 's/^/WARNING: /' >&2 <<EOF |
1613 |
15 Feb 23 |
peter |
Did not generate or find a default $program man page. |
1613 |
15 Feb 23 |
peter |
Creating a stub man page instead. |
1613 |
15 Feb 23 |
peter |
You may want to install the GNU Help2man package: |
1613 |
15 Feb 23 |
peter |
<https://www.gnu.org/software/help2man/> |
1613 |
15 Feb 23 |
peter |
EOF |
1613 |
15 Feb 23 |
peter |
58 |
|
1613 |
15 Feb 23 |
peter |
cat > $out <<EOF |
1613 |
15 Feb 23 |
peter |
.TH $PROGRAM "1" "$RELEASE_YEAR" "$program $VERSION" "User Commands" |
1613 |
15 Feb 23 |
peter |
.SH NAME |
1613 |
15 Feb 23 |
peter |
$program $bs- manual page for $program $VERSION |
1613 |
15 Feb 23 |
peter |
.SH DESCRIPTION |
1613 |
15 Feb 23 |
peter |
.B OOPS! |
1613 |
15 Feb 23 |
peter |
We were unable to create a proper manual page for |
1613 |
15 Feb 23 |
peter |
.B $program. |
1613 |
15 Feb 23 |
peter |
For concise option descriptions, run |
1613 |
15 Feb 23 |
peter |
.IP |
1613 |
15 Feb 23 |
peter |
.B $program --help |
1613 |
15 Feb 23 |
peter |
EOF |