#!/bin/sh
# Script to check out the git repository and create an orig.tar.xz for the
# Debian package.

set -e

VERSION=0.7.0
REVISION=20180311

NAMEUPSTREAM=libfprint
REPO="git://anongit.freedesktop.org/libfprint/libfprint"
NAMETAR=${NAMEUPSTREAM}-${VERSION}-git${REVISION}-1
NAMEDEB=${NAMEUPSTREAM}_${VERSION}-git${REVISION}-1

git clone ${REPO}
cd ${NAMEUPSTREAM}
./autogen.sh
make distdir
mv ${NAMEUPSTREAM}-${VERSION} ${NAMETAR}
tar cvf - ${NAMETAR}/ --exclude ${NAMETAR}/.git"*" | xz --best > ../${NAMEDEB}.orig.tar.xz
cd ..
rm -rf ${NAMEUPSTREAM}/
