#!/bin/sh
. SlackBuild.inc

PARCH=noarch
PNAME=w3c-validator # Do not change!
PREFIX=/opt/$PNAME # Do not change!
APATCH=httpd
INITPKG $PNAME 0.8.1

EXTRACT validator.tar.gz -C "$SRCDIR" --strip-components=1
EXTRACT sgml-lib.tar.gz -C "$SRCDIR" --strip-components=1
SLACKPATCH

mkdir -p $PKGDIR/$PREFIX
mkdir -p $PKGDIR/etc/$APATCH

cp -r $SRCDIR/htdocs $PKGDIR/$PREFIX/ || exit 1
cp -r $SRCDIR/misc $PKGDIR/$PREFIX/ || exit 1
cp -r $SRCDIR/share $PKGDIR/$PREFIX/ || exit 1
cp -r $SRCDIR/httpd/cgi-bin $PKGDIR/$PREFIX/ || exit 1
cp $CWD/*.png $PKGDIR/$PREFIX/htdocs/images || exit 1
cat $SRCDIR/httpd/conf/httpd.conf > $PKGDIR/etc/$APATCH/$PNAME.conf-dist || exit 1

( cd $PKGDIR/$PREFIX/htdocs/config || exit 1
for f in *; do
	mv $f $f-dist
done
)

MAKEDOCDIR
ln -sf $PREFIX/htdocs/docs $DOCDIR/html
MAKEPKG
