Add new bundlescript to build a tgz

This commit is contained in:
Tianon Gravi 2013-11-17 20:24:49 -07:00
Родитель a93e40a158
Коммит 3314e005f3
1 изменённых файлов: 23 добавлений и 0 удалений

23
hack/make/tgz Normal file
Просмотреть файл

@ -0,0 +1,23 @@
#!/bin/sh
DEST="$1"
BINARY="$DEST/../binary/docker-$VERSION"
TGZ="$DEST/docker-$VERSION.tgz"
set -e
if [ ! -x "$BINARY" ]; then
echo >&2 'error: binary must be run before tgz'
false
fi
mkdir -p "$DEST/build"
mkdir -p "$DEST/build/usr/local/bin"
cp -L "$BINARY" "$DEST/build/usr/local/bin/docker"
tar --numeric-owner --owner 0 -C "$DEST/build" -czf "$TGZ" usr
rm -rf "$DEST/build"
echo "Created tgz: $TGZ"