#!/bin/bash
# This is how the Debian source tarball was created:

set -e

PACKAGE=faac
VERSION=1.28+
CVSDATE=2015-05-10
PKGDATE=`echo $CVSDATE | tr -d '-'`

TMPDIR=`mktemp -d`

pushd ${TMPDIR}
cvs -d:pserver:anonymous@faac.cvs.sourceforge.net:/cvsroot/faac login
cvs -z3 -d:pserver:anonymous@faac.cvs.sourceforge.net:/cvsroot/faac export -D ${CVSDATE} ${PACKAGE}
mv ${PACKAGE} ${PACKAGE}-${VERSION}cvs${PKGDATE}
tar cJfv ${PACKAGE}_${VERSION}cvs${PKGDATE}.orig.tar.xz ${PACKAGE}-${VERSION}cvs${PKGDATE}
popd

cp ${TMPDIR}/${PACKAGE}_${VERSION}cvs${PKGDATE}.orig.tar.xz ..
