#!/bin/sh :<<'########################################################################' Usage: make_pdnsd-doc.sh This script downloads and constructs the documentation for the pdnsd extension. ------------------------------------------------------------------------ Change-log: 2011-10-09 First version. ------------------------------------------------------------------------ This script was written in 2011 by vitex from forum.tinycorelinux.net. To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. See http://creativecommons.org/publicdomain/zero/1.0/ for a copy of the CC0 Public Domain Dedication under which this work is distributed. ######################################################################## # Specify the name of the extension. EXTENSION=pdnsd-doc # Specify the base portion of the extension. EXTENSION0=pdnsd #----------------------------------------------------------------------- # Install the extensions needed to build this extension. tce-load -wi compiletc.tcz groff.tcz #----------------------------------------------------------------------- # Specify the temporary directory that will contain the build components. TMP=/tmp/tcz # Specify the directory in which the squashfs files will be assembled. SQUASHFS=$TMP/squashfs # Specify the directory in which the submission package will be assembled. PACKAGE=$TMP/package #----------------------------------------------------------------------- # Specify the location containing the software distribution. VERSION=1.2.8 DOWNLOAD=http://www.phys.uu.nl/~rombouts/pdnsd/releases/pdnsd-$VERSION-par.tar.gz #----------------------------------------------------------------------- # Download if necessary. tar tzf $TMP/$(basename $DOWNLOAD) 1>/dev/null 2>&1 || wget -O- $DOWNLOAD >$TMP/$(basename $DOWNLOAD) #----------------------------------------------------------------------- # Compute the name of the directory into which the software will be unpacked. DIRECTORY=$TMP/$EXTENSION0-$VERSION #----------------------------------------------------------------------- # Unpack the software. rm -fR $DIRECTORY tar xzf $TMP/$(basename $DOWNLOAD) -C $TMP #----------------------------------------------------------------------- export CFLAGS="-march=i486 -mtune=i686 -Os -pipe" export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" export LDFLAGS="-Wl,-O1" #----------------------------------------------------------------------- # Build the documents. { cd $DIRECTORY ; ./configure ; touch $TMP/TIMESTAMP ; } #----------------------------------------------------------------------- # Copy the documentation to $SQUASHFS/usr/local/share/$EXTENSION0/doc. man2txt () { groff -T ascii -man $1 | sed -e 's/'$(echo -ne '\033')'[^m]*m//g' } # Convert the man pages into simple text files in # /usr/local/share/$EXTENSION0/doc mkdir -p $SQUASHFS/usr/local/share/$EXTENSION0/doc for f in $(find $DIRECTORY/doc | egrep '[0-9]$') do man2txt $f >$SQUASHFS/usr/local/share/$EXTENSION0/doc/$(basename $f).txt done # Copy the txt and html directories as well. cp -R $DIRECTORY/doc/txt $SQUASHFS/usr/local/share/$EXTENSION0/doc cp -R $DIRECTORY/doc/html $SQUASHFS/usr/local/share/$EXTENSION0/doc #----------------------------------------------------------------------- # Create $EXTENSION.tcz.info. cat >$PACKAGE/$EXTENSION.tcz.info <