Skip to content

Commit b2b3f10

Browse files
CameronNemoericonr
authored andcommitted
build: make manpages optional
This avoids the pandoc dependency which is an obstacle to portability.
1 parent c2cc557 commit b2b3f10

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

res/build.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/sh
2-
# uses PREFIX from environment
2+
# uses PREFIX and BUILD_MANPAGES from environment
33
: "${PREFIX:=/usr/local}"
4+
: "${BUILD_MANPAGES:=1}"
45

56
set -e
67
PATH="$PWD/res:$PATH"
@@ -9,16 +10,19 @@ PATH="$PWD/res:$PATH"
910
echo "Building mdBook"
1011
mdbook build
1112

12-
# Build mandoc version
13-
echo "Building man pages"
14-
mkdir -p mandoc
15-
cd src
1613

17-
find . -type d -exec mkdir -p "../mandoc/{}" \;
18-
find . -type f -name "*.md" -exec sh -c \
19-
'file="{}"; filew="${file%.md}"; pandoc -V "title=${filew##*/}" -V section=7 -V "header=Void Docs" -s -o "../mandoc/${filew}.7" "$file"' \;
14+
if [ "$BUILD_MANPAGES" = "1" ]; then
15+
# Build mandoc version
16+
echo "Building man pages"
17+
mkdir -p mandoc
18+
cd src
2019

21-
cd -
20+
find . -type d -exec mkdir -p "../mandoc/{}" \;
21+
find . -type f -name "*.md" -exec sh -c \
22+
'file="{}"; filew="${file%.md}"; pandoc -V "title=${filew##*/}" -V section=7 -V "header=Void Docs" -s -o "../mandoc/${filew}.7" "$file"' \;
23+
24+
cd -
25+
fi
2226

2327
# Build script
2428
echo "Building void-docs script and man page"

0 commit comments

Comments
 (0)