File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / arping / extra / mktarball
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Oct 18 13:16:10 2016 UTC (7 years, 8 months ago) by misho
Branches: arping, MAIN
CVS tags: v2_21, v2_15_cross, v2_15, HEAD
arping v2.15

#!/bin/sh

set -e

VERSION="$1"

if [ x"$VERSION" = x"" ]; then
    echo "Usage: $0 <version>"
    echo
    echo "  Example:   $0 arping-2.11"
    exit 1
fi

if [ x"$VERSION" = x"latest" ]; then
    VERSION="$(git tag | tail -1)"
fi

if [ x"$VERSION" = x"HEAD" ]; then
    VERSION="$(git describe)"
fi

OUTPUT="$VERSION.tar.gz"
echo "Writing $OUTPUT"

GITDIR="$(realpath .)"
TMPDIR="$(mktemp -d)"

(
    cd "$TMPDIR"
    mkdir "$VERSION"
    cd "$VERSION"
    git init
    git fetch "$GITDIR"
    git fetch --tags "$GITDIR"
    git checkout "$VERSION"
    rm -fr .git
    autoreconf -i
    rm -fr autom4te.cache
    cd ..
    tar cfz - "$VERSION" > "$GITDIR/$OUTPUT"
)
rm -fr -- "$TMPDIR"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>