doc/Makedoc.sh: Simplify and reorganize doc creation script.

- Remove useless code about LinuxDocTools.pm modifications.
- Remove most replacements in linuxdoc.in. They were no longer
  needed.
- No need to look for groff, awk and friends. ldt_which will do
  that from linuxdoc.in provided a sane PATH is given.
parent 7383395c
......@@ -17,63 +17,28 @@ trap 'abort' 1 2 3 6 9 15
export PERL5LIB=${TMPDIR}:../perl5lib
PERL=`which perl`
TMPDATADIR=${TMPDIR}/linuxdoc-tools
cp -r ${PKGDATADIR} $TMPDIR
cp ../tex/*.sty ${TMPDATADIR}
mkdir $TMPDIR/Text
sed < ../entity-map/EntityMap.pm.in > $TMPDIR/Text/EntityMap.pm \
-e 's|\@localentitymapdir\@|'${PKGDATADIR}'/../entity-map|g' \
-e 's|\@entitymapdir\@|'${PKGDATADIR}'/../entity-map/0.1.0|g'
cp -r ${PKGDATADIR} $TMPDIR
NSGMLS=`which nsgmls`
SGMLSASP=`which sgmlsasp`
GROFF=`which groff`
GAWK=`which gawk mawk awk | head -1`
if [ -z "$GAWK" ]; then
echo "None of gawk mawk awk found. Aborting ..."
exit 1
fi
PERL=`which perl`
sed < ../bin/linuxdoc.in >$TMPDIR/linuxdoc \
-e 's!\@prefix\@!'${PREFIX}'!' \
-e 's!\@auxbindir\@!'${AUXBINDIR}'!' \
-e 's!\@pkgdatadir\@!'${TMPDIR}'/linuxdoc-tools!' \
-e 's!\@NSGMLS\@!'${NSGMLS}'!' \
-e 's!\@SGMLSASP\@!'${SGMLSASP}'!' \
-e 's!\@GROFF\@!'${GROFF}'!' \
-e 's!\@pkgdatadir\@!'${TMPDATADIR}'!' \
-e 's!\@GROFFMACRO\@!-ms!' \
-e 's!\@AWK\@!'${GAWK}'!' \
-e 's!\@PERL\@!'${PERL}'!' \
-e 's!\@PERLWARN\@!!' \
-e 's!^use lib \".*\/linuxdoc-tools\"!use lib \"'${TMPDIR}'\"!' \
-e '/^use lib \".*\/usr\/perl5\";/a \
use lib \"/usr/perl5\";
' \
-e 's/^use lib \".*\/usr\/perl5\";/use lib \"\/usr\/local\/perl5\";/' \
-e '/^use lib \".*\/lib\/perl5\";/a \
use lib \"/usr/lib/perl5\";
' \
-e 's/^use lib \".*\/lib\/perl5\";/use lib \"\/usr\/local\/lib\/perl5\";/' \
-e '/^use lib \".*\/share\/perl5\";/a \
use lib \"/usr/share/perl5\";
' \
-e 's/^use lib \".*\/share\/perl5\";/use lib \"\/usr\/local\/share\/perl5\";/'
-e 's!\@PERLWARN\@!!'
chmod u+x $TMPDIR/linuxdoc
sed -e '/global->{NsgmlsOpts} .= \"-D \/usr\/share\/sgml \"/a \
$global->{NsgmlsOpts} .= " -c TMPCONFIG"; \
$global->{NsgmlsOpts} .= " -D TMPLIBDIR1"; \
$global->{NsgmlsOpts} .= " -D TMPLIBDIR2";
' \
../perl5lib/LinuxDocTools.pm | sed \
-e "s,TMPCONFIG,"${DATADIR}"/linuxdoc-tools/dtd/catalog ," \
-e "s,TMPLIBDIR1,"${DATADIR}"/linuxdoc-tools ," \
-e "s,TMPLIBDIR2,/usr/share/sgml ," \
> $TMPDIR/linuxdoc-tools/LinuxDocTools.pm
if [ -n "`which groff`" ]; then
ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2txt
$TMPDIR/sgml2txt -b 1 ./guide
......@@ -81,7 +46,6 @@ fi
if [ -n "`which latex`" ]; then
ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
cp ../tex/*.sty ${TMPDIR}/linuxdoc-tools
$TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment