#!/bin/sh
#
# 'tgz2zip Foo' converts Foo.tar.gz into Foo.zip converting Unix end-of-line
# to DOS in the process.

TARBALL=$1
BASENAME=${TARBALL%.tar.gz}

tar xfz ${TARBALL}
find ${BASENAME} -name '*.[hc]pp' -o -name '*.[hc]' \
     -o -name '*.xhtml' -o -name '*.html' -o -name '*.htm' -o -name '*.css' \
     -o -name '*.docs' -o -name '*.doxy' -o -name '*.qbk' \
     -o -name '*.el' -o -name '*.cmake' \
     -o -name '*.ipp' -o -name '*.jam' -o -name '*.tpp' \
     -o -iname '*.txt' -o -name '*.tex' -o -name '*.dtd' \
     -o -name '*.xml' -o -name 'stub.*' -o -name '*.rst' \
     -o -name '*.i' -o -name '*.py' -o -name '*.rb' -o -name '*.R' \
     -o -iname '*.pl' -o -name '*.scm' -o -name '*.ss' \
     -o -name '*.cs' -o -name '*.java' -o -name '*.nsi' \
     -o -name '*.tpp' -o -name '*.Makefile' -o -name '*.README' \
     -o -name '*.configure' \
 | xargs todos -o -p
zip -q -9 -r ${BASENAME}.zip ${BASENAME}
rm -rf ${BASENAME}

