ca998e9c4c
--HG-- extra : rebase_source : aa87c61d61b67afbd25224af8cce9cadd271df76
60 lines
1.5 KiB
Plaintext
60 lines
1.5 KiB
Plaintext
# Description: The GO programming language
|
|
# URL: http://golang.org/
|
|
# Maintainer: James Mills, prologic at shortcircuit dot net dot au
|
|
# Packager: Kristian Lehmann, email at zero-io dot net
|
|
#
|
|
# Depends on: mercurial
|
|
|
|
name=go
|
|
version=1.2
|
|
release=4
|
|
source=(
|
|
https://go.googlecode.com/files/$name$version.src.tar.gz
|
|
golang.sh
|
|
)
|
|
|
|
build() {
|
|
cd $SRC/$name/src
|
|
|
|
# build
|
|
export GOROOT_FINAL=/usr/lib/go
|
|
export GOROOT=/tmp/go/
|
|
|
|
# compile all
|
|
./all.bash
|
|
|
|
# install
|
|
install -d -m 755 $PKG/usr/lib
|
|
install -d -m 755 $PKG/usr
|
|
|
|
# package
|
|
mv $SRC/go $PKG/usr/lib/
|
|
mv $PKG/usr/lib/go/bin $PKG/usr/
|
|
install -D -m 644 $SRC/golang.sh $PKG/etc/profile.d/golang.sh
|
|
|
|
#
|
|
# package godoc and vet (XXX: Temporary)
|
|
#
|
|
|
|
export GOROOT=$PKG/usr/lib/go
|
|
export GOPATH=/tmp/go
|
|
|
|
$PKG/usr/bin/go get -u code.google.com/p/go.tools/cmd/godoc
|
|
$PKG/usr/bin/go install code.google.com/p/go.tools/cmd/godoc
|
|
|
|
$PKG/usr/bin/go get -u code.google.com/p/go.tools/cmd/vet
|
|
$PKG/usr/bin/go install code.google.com/p/go.tools/cmd/vet
|
|
|
|
cp -r $PKG/usr/lib/go/bin $PKG/usr/
|
|
|
|
# cleanup
|
|
rm -rf $PKG/usr/lib/go/bin
|
|
rm -rf $PKG/usr/lib/go/test
|
|
find "$PKG/usr/lib/go/" -type f -name "*.o" -delete
|
|
find "$PKG/usr/lib/go/" -type f -name "Makefile" -delete
|
|
rm $PKG/usr/lib/go/{AUTHORS,README,LICENSE,CONTRIBUTORS,PATENTS,robots.txt}
|
|
rm $PKG/usr/lib/go/src/{make.*,all.*,run.*,race.*,clean.*,Make.*,sudo.*}
|
|
|
|
chown -R root:root $PKG
|
|
}
|