xref: /aosp_15_r20/external/igt-gpu-tools/man/rst2man.sh (revision d83cc019efdc2edc6c4b16e9034a3ceb8d35d77c)
1*d83cc019SAndroid Build Coastguard Worker#!/bin/bash
2*d83cc019SAndroid Build Coastguard Worker
3*d83cc019SAndroid Build Coastguard Workerrst2man=$1
4*d83cc019SAndroid Build Coastguard Workerinput=$2
5*d83cc019SAndroid Build Coastguard Workeroutput=$3
6*d83cc019SAndroid Build Coastguard Worker
7*d83cc019SAndroid Build Coastguard Workerout_dir=$(dirname "${output}")
8*d83cc019SAndroid Build Coastguard Workerin_file=$(basename "${input}")
9*d83cc019SAndroid Build Coastguard Worker
10*d83cc019SAndroid Build Coastguard Worker# rst2man doesn't handle multiple source directories well, and since defs.rst is
11*d83cc019SAndroid Build Coastguard Worker# generated we first need to move it all into the build dir
12*d83cc019SAndroid Build Coastguard Workercp "$input" "$out_dir"
13*d83cc019SAndroid Build Coastguard Worker
14*d83cc019SAndroid Build Coastguard Worker${rst2man} "$out_dir/$in_file" "${output%.gz}"
15*d83cc019SAndroid Build Coastguard Worker
16*d83cc019SAndroid Build Coastguard Workerrm -f "${output}"
17*d83cc019SAndroid Build Coastguard Workergzip "${output%.gz}"
18