Commits

Jakub Wilk  committed 526e2e7

tools/build-source-tarball: import.

  • Participants
  • Parent commits 98e3112

Comments (0)

Files changed (1)

File tools/build-source-tarball

+#!/bin/sh
+name=nonogram
+url=http://bitbucket.org/jwilk/nonogram
+if [ $# -ne 1 ]
+then
+  printf "%s <version>\n" "$0" >&2
+  exit 1
+fi
+set -e -x
+pwd="$PWD"
+version="$1"
+sourceroot=$(mktemp -d -t "$name-source-XXXXXX")
+export TAR_OPTIONS="--owner root --group root --mode a+rX"
+export GZIP="-9 -n"
+mkdir -p "$sourceroot/$name-$version"
+if [ -d .hg ]
+then
+  hg archive -r "$version" "$sourceroot/$name-$version"
+else
+  hg clone -r "$version" "$url" "$sourceroot/$name-$version"
+fi
+cd "$sourceroot"
+rm -Rf */.hg*
+tar -czf "$pwd/$name-$version.tar.gz" */
+rm -Rf "$sourceroot"
+
+# vim:ts=2 sw=2 et