-
Notifications
You must be signed in to change notification settings - Fork 8
/
make_doc_tarball.sh
executable file
·98 lines (82 loc) · 1.89 KB
/
make_doc_tarball.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
#
# Use AFTER 'make install'
#
# Creates a tarball of the whole Tao documentation (Tao + modules).
# The layout is suitable for uploading to www.taodyne.com/docs.
#
# Tested on MacOSX only but should work on other platforms, too.
# List names of directories in $1
dirs() {
[ -d "$1" ] && ( cd "$1" ; for i in * ; do [ -d "$i" ] && echo "$i" ; done )
}
case `uname` in
Darwin)
INST="install/Tao3D.app/Contents/MacOS"
;;
MINGW*|Linux)
INST=install
;;
esac
TMPDIR=taodoc_$$
mkdir -p $TMPDIR || exit 1
VER=`app/updaterev.sh -n`
mkdir -p $TMPDIR/taodoc-$VER/help
DEST=$TMPDIR/taodoc-$VER
# Modules
printf "MODULES: "
for mod in `dirs "$INST/modules"` ; do
BS=""
printf "$mod ("
for lang in `dirs "$INST/modules/$mod/doc"` ; do
printf "$lang "
if [ -d "$INST/modules/$mod/doc/$lang/html" ] ; then
mkdir -p $DEST/modules/$mod/$lang
cp -R "$INST/modules/$mod/doc/$lang/html"/* $DEST/modules/$mod/$lang
fi
BS="\b"
done
printf "$BS) "
done
echo
# Disabled
## Tao (without modules)
#
#BS=""
#printf "TAO: ("
#for lang in `dirs "$INST/doc"` ; do
# printf "$lang "
# if [ -d "$INST/doc/$lang/html" ] ; then
# mkdir -p $DEST/help/$lang
# cp -R "$INST/doc/$lang/html"/* $DEST/help/$lang
# fi
# BS="\b"
#done
#printf "$BS) "
#echo
#
#fi
# Tao and modules in a self-contained HTML docset
BS=""
printf "TAO+MODULES: "
printf "building... "
(cd doc ; make webdoc 2>/dev/null >/dev/null || echo "make webdoc failed!")
printf "("
for lang in `dirs "doc/webhtml"` ; do
printf "$lang "
if [ -d "doc/webhtml/$lang/html" ] ; then
mkdir -p $DEST/help/$lang
cp -R "doc/webhtml/$lang/html"/* $DEST/help/$lang
fi
BS="\b"
done
printf "$BS) "
echo
# Archive
printf "Packing..."
TARBALL=taodoc-$VER.tar.xz
( cd $TMPDIR && tar cf - taodoc-$VER | xz - >../$TARBALL )
SZ=`ls -lh $TARBALL | awk '{ print $5}'`
echo " $TARBALL ($SZ)"
# Cleanup
rm -rf $TMPDIR