Introduce pretty_paths()
[pysize.git] / release.sh
blobbc61bfe2921ecc1261b677a5c95401a92f7ed29a
1 #!/bin/bash
3 set -x
4 set -e # Exit on error
6 PACKAGE=$(basename "$PWD")
7 mkdir dist
8 TEMPDIR="$(mktemp -d)"
9 VERSION=$(python -c 'from pysize.version import VERSION; print VERSION')
10 echo "$PACKAGE-$VERSION: $TEMPDIR"
11 hg archive "$TEMPDIR/$PACKAGE-$VERSION"
12 DIR="$PWD"
13 cd "$TEMPDIR"
14 rm "$PACKAGE-$VERSION/release.sh"
15 rm "$PACKAGE-$VERSION"/.hg*
16 tar czf "$DIR/dist/$PACKAGE-$VERSION.tar.gz" "$PACKAGE-$VERSION"
17 tar cjf "$DIR/dist/$PACKAGE-$VERSION.tar.bz2" "$PACKAGE-$VERSION"
18 cd "$PACKAGE-$VERSION"
19 ./setup.py bdist_rpm
20 mv "dist/$PACKAGE-$VERSION-1."{noarch,src}.rpm "$DIR/dist"
21 rm -fr "$TEMPDIR"