summaryrefslogtreecommitdiff
path: root/man/rst2man.sh
blob: 49a98fc52bbcc8e41f2852f802cf53444d954f64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

rst2man=$1
input=$2
output=$3

out_dir=$(dirname "${output}")
in_file=$(basename "${input}")

# rst2man doesn't handle multiple source directories well, and since defs.rst is
# generated we first need to move it all into the build dir
cp "$input" "$out_dir"

${rst2man} "$out_dir/$in_file" "${output%.gz}"

rm -f "${output}"
gzip "${output%.gz}"