1#!/bin/bash
2set -e
3set -x
4README="../../README"
5CONVERTER="rst2latex"
6
7# Create couple of temparaty files to store intermediate files
8CLEANEDREADME=`mktemp --tmpdir="./" tmp.XXXXXX`
9CONVERTEDTEX=`mktemp --tmpdir="./" tmp.XXXXXX`
10
11# cleanup unwanted text from the readme file
12./cleanREADME.awk ${README} > ${CLEANEDREADME}
13
14# Generate html from restructured text (assuming docutils are installed)
15${CONVERTER} ${CLEANEDREADME} ${CONVERTEDTEX}
16
17# Remove all the unwanted sections still remaining in readme.tex file.
18./cleanTex.awk ${CONVERTEDTEX} > readme.tex
19
20# remove the temp files created to store intermediate contents
21rm -f ${CONVERTEDTEX} ${CLEANEDREADME}
22
23