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

set -e

PACKAGE=faad2
VERSION=2.8.0~
CVSDATE=2016-11-13
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 ..
