#!/bin/sh -e

# This script builds the regular and upstream source packages,
# and minimally HTMLified versions of HISTORY and TODO.

mkdir -p packages

# Source package
mkdir tmp
cd tmp
svn checkout svn://mactv/free42/trunk free42
find . -type d -name .svn -prune -exec rm -rf {} \;
tar cvfz ../packages/free42.tgz free42
cd ..
rm -rf tmp

# "Upstream" source package, for Fedora or other Linux distros
# Has all non-Linux versions, and all skins containing the HP logo, removed
cd upstream
sh ./build-nologo
sh ./build-macports
cd ..

# Wrap it all up...
cd util
cc -o txt2html txt2html.c
cd ..
util/txt2html "Free42 HISTORY" <HISTORY >history.html
util/txt2html "Free42 TODO" <TODO >todo.html
mv history.html todo.html packages
