diff options
author | Christian Wieninger <winni@debian.(none)> | 2007-11-11 15:40:28 +0100 |
---|---|---|
committer | Christian Wieninger <winni@debian.(none)> | 2007-11-11 15:40:28 +0100 |
commit | 8d4f8607dc1558ce73eb4c376bdbf78ddb65da83 (patch) | |
tree | d0c5dde81a36ab2e8a2edc7c1e6922556518b312 /docsrc2man.sh | |
download | vdr-plugin-epgsearch-8d4f8607dc1558ce73eb4c376bdbf78ddb65da83.tar.gz vdr-plugin-epgsearch-8d4f8607dc1558ce73eb4c376bdbf78ddb65da83.tar.bz2 |
Initial commit
Diffstat (limited to 'docsrc2man.sh')
-rwxr-xr-x | docsrc2man.sh | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/docsrc2man.sh b/docsrc2man.sh new file mode 100755 index 0000000..1232153 --- /dev/null +++ b/docsrc2man.sh @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Creates the man pages +# +# Needs: pod2man and nroff +# +# Mike Constabel +# +# Version 0.1 - 31.07.2006 +# + +DOCSRC="doc-src" + +if [ ! -s "epgsearch.c" ]; then + echo "Cannot find epgsearch.c. Call this script from epgsearch source directory." + exit +fi + +VERSION="$(awk -F\" '/VERSION/ {print $2; exit;}' epgsearch.c)" + +for LANGUAGE in $(ls "$DOCSRC"/); do + + [ ! -d ""$DOCSRC"/$LANGUAGE" ] && continue + mkdir -p man/$LANGUAGE + rm man/$LANGUAGE/* 2>/dev/null + + for i in "$DOCSRC"/$LANGUAGE/*.txt; do + echo -ne "create man page: ($LANGUAGE) $(basename "$i" ".txt")..." + pod2man -c "Epgsearch Version $VERSION" -n "$(echo "$(basename "$i")" | sed -e 's/\.[0-9]\..*$//')" --section=5 "$i" >"man/$LANGUAGE/$(basename "$i" ".txt")" + if [ $? -eq 0 ]; then + echo " done." + else + echo " failed." + fi + done + + rm "$DOCSRC"/$LANGUAGE/*~ 2>/dev/null + gzip -f man/$LANGUAGE/*.[0-9] + +done + +echo + +for LANGUAGE in $(ls "$DOCSRC"/); do + + [ ! -d "$DOCSRC/$LANGUAGE" ] && continue + mkdir -p doc/$LANGUAGE + rm doc/$LANGUAGE/* 2>/dev/null + + for i in man/$LANGUAGE/*.gz; do + echo -ne "create doc file from man page: ($LANGUAGE) $(basename "$i")..." + zcat "$i" | nroff -man - | col -xbp > "doc/$LANGUAGE/$(basename "$i" ".gz").txt" + echo " done" + done + +done + +echo + +#EOF |