2013-12-03 02:48:26 +04:00
|
|
|
#!/bin/bash
|
2013-11-18 07:24:49 +04:00
|
|
|
|
2013-12-24 10:31:53 +04:00
|
|
|
CROSS="$DEST/../cross"
|
2013-11-18 07:24:49 +04:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2013-12-24 10:31:53 +04:00
|
|
|
if [ ! -d "$CROSS/linux/amd64" ]; then
|
|
|
|
echo >&2 'error: binary and cross must be run before tgz'
|
2013-11-18 07:24:49 +04:00
|
|
|
false
|
|
|
|
fi
|
|
|
|
|
2013-12-24 10:31:53 +04:00
|
|
|
for d in "$CROSS/"*/*; do
|
|
|
|
GOARCH="$(basename "$d")"
|
|
|
|
GOOS="$(basename "$(dirname "$d")")"
|
2014-12-16 13:05:12 +03:00
|
|
|
BINARY_NAME="docker-$VERSION"
|
2015-01-13 05:07:16 +03:00
|
|
|
BINARY_EXTENSION="$(export GOOS && binary_extension)"
|
2014-12-16 13:05:12 +03:00
|
|
|
BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION"
|
2013-12-24 10:31:53 +04:00
|
|
|
mkdir -p "$DEST/$GOOS/$GOARCH"
|
2014-12-16 13:05:12 +03:00
|
|
|
TGZ="$DEST/$GOOS/$GOARCH/$BINARY_NAME.tgz"
|
2015-03-25 20:38:17 +03:00
|
|
|
|
2013-12-24 10:31:53 +04:00
|
|
|
mkdir -p "$DEST/build"
|
2015-03-25 20:38:17 +03:00
|
|
|
|
2013-12-24 10:31:53 +04:00
|
|
|
mkdir -p "$DEST/build/usr/local/bin"
|
2014-12-17 06:55:20 +03:00
|
|
|
cp -L "$d/$BINARY_FULLNAME" "$DEST/build/usr/local/bin/docker$BINARY_EXTENSION"
|
2015-03-25 20:38:17 +03:00
|
|
|
|
2013-12-24 10:31:53 +04:00
|
|
|
tar --numeric-owner --owner 0 -C "$DEST/build" -czf "$TGZ" usr
|
2015-03-25 20:38:17 +03:00
|
|
|
|
2014-03-20 05:58:39 +04:00
|
|
|
hash_files "$TGZ"
|
2015-03-25 20:38:17 +03:00
|
|
|
|
2013-12-24 10:31:53 +04:00
|
|
|
rm -rf "$DEST/build"
|
2015-03-25 20:38:17 +03:00
|
|
|
|
2013-12-24 10:31:53 +04:00
|
|
|
echo "Created tgz: $TGZ"
|
|
|
|
done
|