1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#!/bin/sh -e
COMPRESS=xz
NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
MVERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed -e 's/+dfsg//' -e 's/^\([0-9\.]\+\)[+~][-0-9]\+$/\1/'`
CURDIR=$(pwd)
mkdir -p ../tarballs
cd ../tarballs
# need to clean up the tarballs dir first because upstream tarball might
# contain a directory with unpredictable name
rm -rf *
git clone --quiet https://github.com/etd-framework/datatables-extensions
cd $NAME
VERSION=${MVERSION}+`date -d @$(git show --format="%at" | head -n1) +%Y%m%d`+dfsg
# for esthetical reasons set file timestamps (if git-restore-mtime is installed)
git restore-mtime || true
cd ..
TARDIR=${NAME}-${VERSION}
mv ${NAME} ${TARDIR}
rm -rf ${TARDIR}/.git
for excl in `grep "^Files-Excluded:" ${CURDIR}/debian/copyright | sed 's/^Files-Excluded: *//'` ; do find ${TARDIR} -path $excl -delete ; done
find ${TARDIR} -type d -empty | xargs rmdir
GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
rm -rf ${TARDIR}
|