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:25:28 +03:00
|
|
|
mkdir -p ${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
|
2014-11-03 17:18:26 +03:00
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs --exclude conf/*.go --exclude i18n/*.go
|
2014-11-03 17:07:04 +03:00
|
|
|
rm -f wide
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=amd64
|
|
|
|
go build
|
2014-11-03 17:18:26 +03:00
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs --exclude conf/*.go --exclude i18n/*.go
|
2014-11-03 17:07:04 +03:00
|
|
|
rm -f wide
|
|
|
|
|
|
|
|
## linux
|
|
|
|
os=linux
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=386
|
|
|
|
go build
|
2014-11-03 17:18:26 +03:00
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs --exclude conf/*.go --exclude i18n/*.go
|
2014-11-03 17:07:04 +03:00
|
|
|
rm -f wide
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=amd64
|
|
|
|
go build
|
2014-11-03 17:18:26 +03:00
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs --exclude conf/*.go --exclude i18n/*.go
|
2014-11-03 17:07:04 +03:00
|
|
|
rm -f wide
|
|
|
|
|
|
|
|
## windows
|
|
|
|
os=windows
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=386
|
|
|
|
go build
|
2014-11-03 17:18:26 +03:00
|
|
|
zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} wide.exe --exclude=conf/*.go --exclude=i18n/*.go
|
2014-11-03 17:07:04 +03:00
|
|
|
rm -f wide.exe
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=amd64
|
|
|
|
go build
|
2014-11-03 17:18:26 +03:00
|
|
|
zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} wide.exe --exclude=conf/*.go --exclude=i18n/*.go
|
2014-11-03 17:07:04 +03:00
|
|
|
rm -f wide.exe
|