2010-10-05 11:09:41 +03:00
|
|
|
#!/bin/sh
|
|
|
|
# Build a tarball from the latest upstream version, with a nice
|
|
|
|
# version number.
|
2012-06-21 11:42:40 +03:00
|
|
|
#
|
|
|
|
# Requires git 1.6.6 or later, GNU date, and gzip.
|
2010-10-05 11:09:41 +03:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2012-06-21 11:42:40 +03:00
|
|
|
: ${REPO=$(git rev-parse --git-dir)}
|
|
|
|
: ${BRANCH=remotes/origin/master}
|
|
|
|
|
|
|
|
mkdir debian-orig-source
|
|
|
|
trap 'rm -fr debian-orig-source || exit 1' EXIT
|
2010-10-05 11:09:41 +03:00
|
|
|
|
2012-06-21 11:42:40 +03:00
|
|
|
git init -q debian-orig-source
|
|
|
|
GIT_DIR=$(pwd)/debian-orig-source/.git
|
|
|
|
export GIT_DIR
|
2010-10-12 19:33:31 +03:00
|
|
|
|
2012-06-21 11:42:40 +03:00
|
|
|
# Fetch latest upstream version.
|
|
|
|
git fetch -q "$REPO" "$BRANCH"
|
2010-10-12 19:33:31 +03:00
|
|
|
|
2012-06-21 11:42:40 +03:00
|
|
|
# Determine version number.
|
2012-07-13 05:02:36 +03:00
|
|
|
release=0.1
|
2012-06-21 11:42:40 +03:00
|
|
|
date=$(date --utc --date="$(git log -1 --pretty=format:%cD FETCH_HEAD)" "+%Y%m")
|
|
|
|
upstream_version="${release}+${date}"
|
2010-10-12 19:33:31 +03:00
|
|
|
|
2010-10-05 11:09:41 +03:00
|
|
|
# Generate tarball.
|
2012-06-21 11:42:40 +03:00
|
|
|
echo "packaging $(git rev-parse --short FETCH_HEAD)"
|
|
|
|
git archive FETCH_HEAD |
|
|
|
|
gzip -n -9 >"fped_$upstream_version.orig.tar.gz"
|