view make/mkxmlman.sh @ 73:7dae85574e82

Teach mkxmlman to use $WEBDIR instead of hardwired paths.
author Rob Landley <rob@landley.net>
date Tue, 16 Oct 2007 21:47:47 -0500
parents ecfa70db0bb3
children 598061b944e5
line wrap: on
line source

#!/bin/bash

MPTAR=man-pages-2.66.tar.gz
WEBDIR=~/www/kdocs

# Download the man-pages and doclifter source code.

mkdir -p $WEBDIR/temp/source
cd $WEBDIR/temp
[ -f source/$MPTAR ] ||
( cd source && wget http://kernel.org/pub/linux/docs/manpages/$MPTAR )
[ -f source/doclifter-* ] ||
  (cd source &&
   wget http://thyrsus.com/hg/doclifter/archive/tip.tar.gz &&
   mv tip.tar.gz doclifter-tip.tar.gz
  )

# Build man-pages into "mantemp"

rm -rf mantemp man-pages-* &&
tar xvzf source/man-pages-*.tar.gz &&
cd man-pages-* &&
make MANDIR=../mantemp allgz &&
cd .. &&
rm -rf man-pages-* &&

# Run doclifter on the man pages.

rm -rf doclifter-* &&
tar xvzf source/doclifter-*.tar.gz &&
cd doclifter-* &&
./manlifter -I ../mantemp `cd ../mantemp;ls . | sed -re 's/man([0-9]p?)/-s \1/g'` -h &&

# Fix up symlinks
$WEBDIR/make/fixlinks.py `find xmlman -type l` &&
# Remove inappropriate code page that displays garbage (workaround xmlto bug)
find xmlman -name "*.html" | xargs sed -i -e 's/.*ISO-8859-1.*//' &&

# Install result
rm -rf $WEBDIR/xmlman &&
mv xmlman $WEBDIR &&
exit 0

echo "It died."
exit 1