2014-11-03 09:24:49 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Wide package tool.
|
|
|
|
#
|
2014-11-03 17:07:04 +03:00
|
|
|
# Command:
|
|
|
|
# ./pkg.bash ${version} ${target}
|
|
|
|
# Example:
|
|
|
|
# ./pkg.bash 1.0.1 /home/daniel/1.0.1/
|
2014-11-03 09:24:49 +03:00
|
|
|
|
|
|
|
ver=$1
|
2014-11-03 17:07:04 +03:00
|
|
|
target=$2
|
|
|
|
list="conf data doc i18n static views README.md LICENSE"
|
2014-11-03 09:24:49 +03:00
|
|
|
|
2014-11-03 17:07:04 +03:00
|
|
|
mkdir ${target}
|
2014-11-03 09:24:49 +03:00
|
|
|
|
2014-11-03 17:07:04 +03:00
|
|
|
echo version=${ver}
|
|
|
|
echo target=${target}
|
|
|
|
echo
|
2014-11-03 09:24:49 +03:00
|
|
|
|
2014-11-03 17:07:04 +03:00
|
|
|
## darwin
|
|
|
|
os=darwin
|
2014-11-03 09:24:49 +03:00
|
|
|
|
2014-11-03 17:07:04 +03:00
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=386
|
|
|
|
go build
|
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs
|
|
|
|
rm -f wide
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=amd64
|
|
|
|
go build
|
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs
|
|
|
|
rm -f wide
|
|
|
|
|
|
|
|
## linux
|
|
|
|
os=linux
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=386
|
|
|
|
go build
|
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs
|
|
|
|
rm -f wide
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=amd64
|
|
|
|
go build
|
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs
|
|
|
|
rm -f wide
|
|
|
|
|
|
|
|
## windows
|
|
|
|
os=windows
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=386
|
|
|
|
go build
|
|
|
|
zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} wide.exe
|
|
|
|
rm -f wide.exe
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=amd64
|
|
|
|
go build
|
|
|
|
zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} wide.exe
|
|
|
|
rm -f wide.exe
|