[packages/golang] - use optflags for go build - arm support in spec (beside x86)

qboosh qboosh at pld-linux.org
Sat Mar 30 12:05:11 CET 2013


commit d5759e4c14e40d0d4170506be4282e0dff895d26
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Mar 30 12:04:59 2013 +0100

    - use optflags for go build
    - arm support in spec (beside x86)

 golang.spec | 36 ++++++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)
---
diff --git a/golang.spec b/golang.spec
index 47550d5..8fb8a16 100644
--- a/golang.spec
+++ b/golang.spec
@@ -23,6 +23,7 @@ BuildRequires:	rpm-pythonprov
 %if %{with tests}
 BuildRequires:	hostname
 %endif
+ExclusiveArch:	%{ix86} %{x8664} %{arm}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define _enable_debug_packages 0
@@ -93,6 +94,11 @@ GOBIN=$GOROOT/bin
 GOARCH=%{GOARCH}
 export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL
 export MAKE="%{__make}"
+export CC="%{__cc}"
+# 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
@@ -119,9 +125,13 @@ ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bi
 
 %ifarch %{ix86}
 tools="8a 8c 8g 8l"
-%else
+%endif
+%ifarch %{x8664}
 tools="6a 6c 6g 6l"
 %endif
+%ifarch %{arm}
+tools="5a 5c 5g 5l"
+%endif
 for tool in $tools; do
 	ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
 done
@@ -140,7 +150,29 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS CONTRIBUTORS LICENSE README doc/*
-%attr(755,root,root) %{_bindir}/*
+%ifarch %{arm}
+%attr(755,root,root) %{_bindir}/5a
+%attr(755,root,root) %{_bindir}/5c
+%attr(755,root,root) %{_bindir}/5g
+%attr(755,root,root) %{_bindir}/5l
+%endif
+%ifarch %{x8664}
+%attr(755,root,root) %{_bindir}/6a
+%attr(755,root,root) %{_bindir}/6c
+%attr(755,root,root) %{_bindir}/6g
+%attr(755,root,root) %{_bindir}/6l
+%endif
+%ifarch %{ix86}
+%attr(755,root,root) %{_bindir}/8a
+%attr(755,root,root) %{_bindir}/8c
+%attr(755,root,root) %{_bindir}/8g
+%attr(755,root,root) %{_bindir}/8l
+%endif
+%attr(755,root,root) %{_bindir}/cgo
+%attr(755,root,root) %{_bindir}/ebnflint
+%attr(755,root,root) %{_bindir}/go
+%attr(755,root,root) %{_bindir}/godoc
+%attr(755,root,root) %{_bindir}/gofmt
 %dir %{_libdir}/%{name}
 %dir %{_libdir}/%{name}/bin
 %attr(755,root,root) %{_libdir}/%{name}/bin/*
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/golang.git/commitdiff/d5759e4c14e40d0d4170506be4282e0dff895d26



More information about the pld-cvs-commit mailing list