Remove link to GitHub sponsors
[openssl-web.git] / bin / mk-manpages3
1 #! /bin/bash -e
2
3 HERE=$(dirname $0)
4 checkoutdir=$1
5 series=$2
6 destdir=$3
7
8 rm -rf tmp
9 mkdir tmp
10
11 (cd tmp; $checkoutdir/Configure cc && make build_html_docs)
12
13 srcdir=tmp/doc/html
14 (cd $srcdir; find -type f) | while read F; do
15     Dn=$(dirname $F)
16     Fn=$(basename $F .html)
17     G=$Dn/$Fn.inc
18     $HERE/strip-man-html < $srcdir/$F > $destdir/$G
19
20     section=$(basename $Dn | sed -e 's|^man||')
21     description="$($HERE/all-html-man-names < $destdir/$G | sed 's|^.* - ||')"
22     names="$($HERE/all-html-man-names < $destdir/$G | sed -e 's| - .*||' -e 's|, *| |g' -e 's|/|-|g')"
23     for name in $names; do
24         G=$Dn/$name.html
25         cat $HERE/../inc/manpage-template.html5 \
26             | sed -E \
27                   -e "s|\\\$release\\\$|$series|g" \
28                   -e "s|\\\$sectnum\\\$|$section|g" \
29                   -e "s|\\\$description\\\$|$description|g" \
30                   -e "s|\\\$name\\\$|$name|g" \
31                   -e "s|\\\$origname\\\$|$Fn|g" \
32                   > $destdir/$G
33     done
34 done