[packages/golang] create env.sh for debugging build issues, requires bash
glen
glen at pld-linux.org
Wed Aug 21 22:29:18 CEST 2013
commit 811d7a987f717f6f7d867515d49ea132de76b63e
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Wed Aug 21 23:28:55 2013 +0300
create env.sh for debugging build issues, requires bash
golang.spec | 36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)
---
diff --git a/golang.spec b/golang.spec
index 7c6be23..05be715 100644
--- a/golang.spec
+++ b/golang.spec
@@ -21,6 +21,7 @@ Source0: https://go.googlecode.com/files/go%{version}.src.tar.gz
# Source0-md5: 705feb2246c8ddaf820d7e171f1430c5
Patch0: ca-certs.patch
URL: http://golang.org/
+BuildRequires: bash
BuildRequires: bison
BuildRequires: ed
BuildRequires: mercurial
@@ -114,27 +115,34 @@ mv go/* .
# broken tests
%{__rm} src/pkg/net/multicast_test.go
-%build
-GOSRC=$(pwd)
-GOROOT=$(pwd)
-GOROOT_FINAL=%{_libdir}/%{name}
-
-GOOS=linux
-GOBIN=$GOROOT/bin
-GOARCH=%{GOARCH}
-export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL
+cat > env.sh <<'EOF'
+export GOROOT=$(pwd)
+export GOROOT_FINAL=%{_libdir}/%{name}
+
+export GOOS=linux
+export GOBIN=$GOROOT/bin
+export GOARCH=%{GOARCH}
+export GOROOT_FINAL
export MAKE="%{__make}"
-export CC="%{__cc}"
-CC=${CC#ccache }
+CC="%{__cc}"
+export CC="${CC#ccache }"
+
+export PATH="$PATH:$GOBIN"
+EOF
+
+install -d bin
+
# optflags for go tools build
nflags="\"$(echo '%{rpmcflags}' | sed -e 's/^[ ]*//;s/[ ]*$//;s/[ ]\+/ /g' -e 's/ /\",\"/g')\""
%{__sed} -i -e "s/\"-O2\"/$nflags/" src/cmd/dist/build.c
# NOTE: optflags used in gcc calls from go compiler are in src/cmd/go/build.go
-install -d "$GOBIN"
-cd src
-LC_ALL=C PATH="$PATH:$GOBIN" ./all.bash
+%build
+. ./env.sh
+
+cd src
+./all.bash
%install
rm -rf $RPM_BUILD_ROOT
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/golang.git/commitdiff/811d7a987f717f6f7d867515d49ea132de76b63e
More information about the pld-cvs-commit
mailing list