2015-12-03 05:35:17 +08:00
|
|
|
#!/bin/bash
|
2014-03-16 01:40:35 +08:00
|
|
|
|
2014-04-25 01:11:08 +08:00
|
|
|
set -e
|
|
|
|
|
2014-03-16 01:40:35 +08:00
|
|
|
# This uses gox from https://github.com/mitchellh/gox
|
2015-08-28 16:40:46 +08:00
|
|
|
# Make sure you've run gox -build-toolchain - not required for go >= 1.5
|
2014-03-16 01:40:35 +08:00
|
|
|
|
2014-04-25 01:11:08 +08:00
|
|
|
if [ "$1" == "" ]; then
|
|
|
|
echo "Syntax: $0 Version"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
VERSION="$1"
|
2014-03-16 01:40:35 +08:00
|
|
|
|
2014-04-25 01:11:08 +08:00
|
|
|
rm -rf build
|
2014-03-16 01:40:35 +08:00
|
|
|
|
2015-08-28 16:40:46 +08:00
|
|
|
gox -output "build/{{.Dir}}-${VERSION}-{{.OS}}-{{.Arch}}/{{.Dir}}" -os "darwin linux freebsd openbsd windows freebsd netbsd plan9 solaris"
|
|
|
|
# Not implemented yet: nacl dragonfly android
|
|
|
|
# gox -osarch-list for definitive list
|
2014-03-16 01:40:35 +08:00
|
|
|
|
2014-04-25 01:11:08 +08:00
|
|
|
mv build/rclone-${VERSION}-darwin-amd64 build/rclone-${VERSION}-osx-amd64
|
|
|
|
mv build/rclone-${VERSION}-darwin-386 build/rclone-${VERSION}-osx-386
|
2014-03-16 01:40:35 +08:00
|
|
|
|
2014-04-25 01:11:08 +08:00
|
|
|
cd build
|
2014-03-16 01:40:35 +08:00
|
|
|
|
2014-04-25 01:11:08 +08:00
|
|
|
for d in `ls`; do
|
2015-06-06 17:05:21 +08:00
|
|
|
cp -a ../MANUAL.txt $d/README.txt
|
|
|
|
cp -a ../MANUAL.html $d/README.html
|
2014-04-25 01:11:08 +08:00
|
|
|
cp -a ../rclone.1 $d/
|
|
|
|
zip -r9 $d.zip $d
|
2015-08-28 03:11:11 +08:00
|
|
|
d_current=${d/-${VERSION}/-current}
|
|
|
|
ln $d.zip $d_current.zip
|
2014-04-25 01:11:08 +08:00
|
|
|
rm -rf $d
|
|
|
|
done
|
2014-03-16 01:40:35 +08:00
|
|
|
|
2014-04-25 01:11:08 +08:00
|
|
|
cd ..
|