Overview
Request 393533 accepted
update go to 1.6 to be consistent with the version that we will
have in SUSE:SLE-12:Update and in Package Hub
old: openSUSE:Leap:42.1:Update/go
new: openSUSE:Factory/go rev 64
Index: allow-binary-only-packages.patch
===================================================================
--- allow-binary-only-packages.patch (revision 2)
+++ allow-binary-only-packages.patch (revision 64)
@@ -1,13 +1,13 @@
-Index: go/src/cmd/go/pkg.go
-===================================================================
---- go.orig/src/cmd/go/pkg.go
-+++ go/src/cmd/go/pkg.go
-@@ -264,7 +264,7 @@ func loadImport(path string, srcDir stri
- //
- // TODO: After Go 1, decide when to pass build.AllowBinary here.
- // See issue 3268 for mistakes to avoid.
-- bp, err := buildContext.Import(path, srcDir, build.ImportComment)
-+ bp, err := buildContext.Import(path, srcDir, build.AllowBinary | build.ImportComment)
+diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go
+index 0c0cf07..4c0e450 100644
+--- a/src/cmd/go/pkg.go
++++ b/src/cmd/go/pkg.go
+@@ -365,7 +365,7 @@ func loadImport(path, srcDir string, parent *Package, stk *importStack, importPo
+ // Not vendoring, or we already found the vendored path.
+ buildMode |= build.IgnoreVendor
+ }
+- bp, err := buildContext.Import(path, srcDir, buildMode)
++ bp, err := buildContext.Import(path, srcDir, build.AllowBinary|buildMode)
bp.ImportPath = importPath
if gobin != "" {
bp.BinDir = gobin
Index: armv6l.patch
===================================================================
--- armv6l.patch (revision 2)
+++ armv6l.patch (revision 64)
@@ -1,11 +1,11 @@
---- a/src/pkg/runtime/os_linux.h 2014-08-13 05:49:43.000000000 +0200
-+++ b/src/pkg/runtime/os_linux.h 2014-10-17 04:02:55.791948419 +0200
-@@ -16,7 +16,7 @@
- void runtime·setitimer(int32, Itimerval*, Itimerval*);
+--- a/src/runtime/os2_linux_generic.go
++++ b/src/runtime/os2_linux_generic.go
+@@ -6,7 +6,7 @@
-
--#define NSIG 65
-+#define NSIG 64
- #define SI_USER 0
-
- // It's hard to tease out exactly how big a Sigset is, but
+ const (
+ _SS_DISABLE = 2
+- _NSIG = 65
++ _NSIG = 64
+ _SI_USER = 0
+ _SIG_BLOCK = 0
+ _SIG_UNBLOCK = 1
Index: fix_certificates_lookup.patch
===================================================================
--- fix_certificates_lookup.patch (revision 2)
+++ fix_certificates_lookup.patch (revision 64)
@@ -1,8 +1,8 @@
-Index: go/src/crypto/x509/root_unix.go
-===================================================================
---- go.orig/src/crypto/x509/root_unix.go
-+++ go/src/crypto/x509/root_unix.go
-@@ -6,24 +6,20 @@
+diff --git a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go
+index 9f06f9d..b3b2bb8 100644
+--- a/src/crypto/x509/root_unix.go
++++ b/src/crypto/x509/root_unix.go
+@@ -6,13 +6,15 @@
package x509
@@ -12,32 +12,21 @@
+ "os"
+)
- // Possible certificate files; stop after finding one.
- var certFiles = []string{
-- "/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc.
-- "/etc/pki/tls/certs/ca-bundle.crt", // Fedora/RHEL
-- "/etc/ssl/ca-bundle.pem", // OpenSUSE
-- "/etc/ssl/cert.pem", // OpenBSD
-- "/usr/local/share/certs/ca-root-nss.crt", // FreeBSD/DragonFly
-- "/etc/pki/tls/cacert.pem", // OpenELEC
-- "/etc/certs/ca-certificates.crt", // Solaris 11.2+
-+ "/etc/ssl/ca-bundle.pem", // openSUSE and SLE12+
- }
-
// Possible directories with certificate files; stop after successfully
// reading at least one file from a directory.
var certDirectories = []string{
+- "/etc/ssl/certs", // SLES10/SLES11, https://golang.org/issue/12139
- "/system/etc/security/cacerts", // Android
--
-+ "/etc/ssl/certs", // SLE11
++ "/etc/ssl/certs", // SLES10/SLES11, https://golang.org/issue/12139
}
func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) {
-@@ -41,22 +37,24 @@ func initSystemRoots() {
+@@ -30,22 +32,26 @@ func initSystemRoots() {
}
}
+ rootsAdded := false
++
for _, directory := range certDirectories {
fis, err := ioutil.ReadDir(directory)
if err != nil {
@@ -58,6 +47,7 @@
- return
- }
+ }
++
+ if rootsAdded {
+ systemRoots = roots
}
Index: go.changes
===================================================================
--- go.changes (revision 2)
+++ go.changes (revision 64)
@@ -1,4 +1,111 @@
-------------------------------------------------------------------
+Wed Apr 13 18:00:49 UTC 2016 - jmassaguerpla@suse.com
+
+- fix bsc#974232: CVE-2016-3959: go: Infinite loop in several big
+ integer routines
+
+-------------------------------------------------------------------
+Fri Feb 19 09:27:32 UTC 2016 - jmassaguerpla@suse.com
+
+- Update to version 1.6
+
+ * On Linux on little-endian 64-bit PowerPC (linux/ppc64le), Go 1.6 now supports cgo with external linking and is roughly feature complete.
+ * Vendoring support
+ * HTTP2 transparent support
+ * fix gc and gccgo incompatibility regarding embedded unexported struct types containing exported fields
+ * Linux on 64-bit MIPS and Android on 32-bit x86
+ * enforced rules for sharing Go pointers with C
+ * new mechanism for template reuse
+ * performance improvements
+ ... and more!
+
+ see more in https://tip.golang.org/doc/go1.6
+
+-------------------------------------------------------------------
+Wed Feb 10 21:46:59 UTC 2016 - fcastelli@suse.com
+
+- Update to version 1.5.3:
+ * CVE-2015-8618: go: Carry propagation in Int.Exp Montgomery code in
+ math/big library (bnc#960151)
+
+-------------------------------------------------------------------
+Sun Jan 10 17:01:28 UTC 2016 - i@marguerite.su
+
+- macro.go and golang-macros.rb moved to golang-packaging
+
+-------------------------------------------------------------------
+Wed Dec 30 15:41:02 UTC 2015 - i@marguerite.su
+
+- macro.go:
+ * added golang-macros.rb to deal with complicated macros
+ that are hard to be written in shell script
+ * support "--with-buildid" which is the former ugly
+ "WITH_FAKE_BUILDID" environment variable hack
+ * support "--shared" which is "-buildmode=shared -linkshared"
+ in case anyone need it
+ * add go_api_ver macro which is currently 1.5
+- install shared stdlib on x86_64
+- drop go-wiki-gadget.xml: it hasn't been used from the beginning
+- add go.gdbinit for debug friendly
+
+-------------------------------------------------------------------
+Thu Dec 10 19:25:18 UTC 2015 - matwey.kornilov@gmail.com
+
+- Updated to 1.5.2:
+ This release includes bug fixes to the compiler,
+ linker, and the mime/multipart, net, and runtime packages.
+ https://golang.org/doc/devel/release.html#go1.5.minor
+
+-------------------------------------------------------------------
+Sun Oct 25 08:24:29 UTC 2015 - guoli_l@126.com
+
+- Updated to 1.5.1
+ This release includes bug fixes to the go command,
+ the compiler, assembler, and the fmt, net/textproto,
+ net/http, and runtime packages.
+ https://golang.org/doc/devel/release.html#go1.5.minor
+
+-------------------------------------------------------------------
+Wed Oct 7 12:16:45 UTC 2015 - mlin@suse.com
+
+- Adapt to Leap
+ * use gcc5-go than go1.4 is the proper requirement for Leap
+
+-------------------------------------------------------------------
+Tue Sep 15 12:56:49 UTC 2015 - dmueller@suse.com
+
+- go.sh, macros.go, go.spec: add missing bits for aarch64
+
+-------------------------------------------------------------------
+Fri Sep 11 08:43:53 UTC 2015 - dmueller@suse.com
+
+- enable build for aarch64
+- rediff armv6l.patch
+
+-------------------------------------------------------------------
+Sat Aug 22 17:44:55 UTC 2015 - i@marguerite.su
+
+- enable ppc64 and ppc64le
+
+-------------------------------------------------------------------
+Thu Aug 20 15:26:42 UTC 2015 - i@marguerite.su
+
+- update to version 1.5
+ * see https://golang.org/doc/go1.5
+- add: go-1.5-build-dont-reinstall-stdlibs.patch
+ drop: go-build-dont-reinstall-stdlibs.patch
+ * refresh patch
+- add: go-1.5-install-dont-reinstall-stdlibs.patch
+ drop: go-install-dont-reinstall-stdlibs.patch
+ * refresh patch
+- drop: go-1.4.2-rel.plt-alignment.patch
+ * fix by upstream
+- add gcc5-go.patch
+ * find /usr/bin/go-5 when bootstrapping with gcc5-go
+- use update-alternatives for /usr/bin/go and profiles.d
+ so it can be co-installed with go1.4
+
+-------------------------------------------------------------------
Tue Aug 11 16:06:28 UTC 2015 - jmassaguerpla@suse.com
- fix update from 1.3.3
Index: go.sh
===================================================================
--- go.sh (revision 2)
+++ go.sh (revision 64)
@@ -1,16 +1,30 @@
# go toolchain env paths
-libdir=lib
-arch=386
-if [ -x /usr/lib64/go ] ; then
- libdir=lib64
- arch=amd64
-fi
-
export GOOS="linux"
case "$(uname -m)" in
*86)
- export GOARCH=$arch
- ;;
+ export GOARCH=386
+ libdir=lib
+ ;;
+ aarch64)
+ export GOARCH=arm64
+ libdir=lib64
+ ;;
+ x86_64)
+ export GOARCH=amd64
+ libdir=lib64
+ ;;
+ ppc64)
+ export GOARCH=ppc64
+ libdir=lib64
+ ;;
+ ppc64le)
+ export GOARCH=ppc64le
+ libdir=lib64
+ ;;
+ arm*)
+ export GOARCH=arm
+ libdir=lib
+ ;;
esac
export GOROOT=/usr/$libdir/go
export GOBIN=/usr/bin
Index: go.spec
===================================================================
--- go.spec (revision 2)
+++ go.spec (revision 64)
@@ -1,8 +1,7 @@
#
# spec file for package go
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
-# Copyright (c) 2011, Sascha Peilicke <saschpe@gmx.de>
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,8 +16,19 @@
#
+%if 0%{?suse_version} > 1320
+%define with_gccgo 1
+%else
+%if 0%{?suse_version} == 1315 && 0%{?is_opensuse}
+%define with_gccgo 1
+%else
+%define with_gccgo 0
+%endif
+%endif
+
+%define go_api 1.6
Name: go
-Version: 1.4.2
+Version: 1.6.1
Release: 0
Summary: A compiled, garbage-collected, concurrent programming language
License: BSD-3-Clause
@@ -27,18 +37,17 @@
Source0: http://golang.org/dl/go%{version}.src.tar.gz
Source1: go-rpmlintrc
Source2: go.sh
-Source3: macros.go
-Source4: go-wiki-gadget.xml
-Source5: README-openSUSE
+Source4: README.SUSE
+Source6: go.gdbinit
# PATCH-FIX-OPENSUSE add -s flag to 'go install' (don't rebuild/install std libs)
-Patch1: go-build-dont-reinstall-stdlibs.patch
+Patch1: go-1.5-build-dont-reinstall-stdlibs.patch
# PATCH-FIX-OPENSUSE re-enable build binary only packages (we are binary distro)
# see http://code.google.com/p/go/issues/detail?id=2775 & also issue 3268
Patch2: allow-binary-only-packages.patch
#PATCH-FIX-OPENSUSE use -x verbose build output for qemu-arm builders
Patch3: verbose-build.patch
# PATCH-FIX-OPENSUSE BNC#776058
-Patch4: go-install-dont-reinstall-stdlibs.patch
+Patch4: go-1.5-install-dont-reinstall-stdlibs.patch
# PATCH-FIX-OPENSUSE enable writing tools outside $GOROOT/pkg/tool for packaging
Patch5: tools-packaging.patch
# armv6l needs this patch for our build system
@@ -47,9 +56,15 @@
# PATCH-FIX-OPENSUSE fix_certificates_lookup.patch fcastelli@suse.com -- this patch forces Go to look for certificates only in the openSUSE/SLE locations. It also fixes certificate loading on SLE11, see https://github.com/golang/go/issues/6391
# PATCH-FIX-SUSE fix_certificates_lookup.patch fcastelli@suse.com -- this patch forces Go to look for certificates only in the openSUSE/SLE locations. It also fixes certificate loading on SLE11, see https://github.com/golang/go/issues/6391
Patch7: fix_certificates_lookup.patch
-Patch8: go-1.4.2-rel.plt-alignment.patch
+# PATCH-FIX-UPSTREAM marguerite@opensuse.org - find /usr/bin/go-5 when bootstrapping with gcc5-go
+Patch8: gcc5-go.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: rpm
+# boostrap
+%if %{with_gccgo}
+BuildRequires: gcc5-go
+%else
+BuildRequires: go1.4
+%endif
%if 0%{?suse_version} >= 1210
BuildRequires: mercurial
BuildRequires: systemd
@@ -62,15 +77,21 @@
BuildRequires: rpm >= 4.11.1
%endif
%endif
+# for go.gdbinit, directory ownership
+BuildRequires: gdb
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
Requires: gcc
+# for golang-macros.rb
+Requires: ruby
Provides: go-devel = %{name}%{version}
Provides: go-devel-static = %{name}%{version}
-Provides: golang(API) = 1.4
+Provides: golang(API) = %{go_api}
Obsoletes: go-devel < %{name}%{version}
# go-vim/emacs were separate projects starting from 1.4
Obsoletes: go-emacs <= 1.3.3
Obsoletes: go-vim <= 1.3.3
-ExclusiveArch: %ix86 x86_64 %arm
+ExclusiveArch: %ix86 x86_64 aarch64 ppc64 ppc64le
%description
Go is an expressive, concurrent, garbage collected systems programming language
@@ -98,25 +119,37 @@
%patch6 -p1
%endif
%patch7 -p1
+%if %{with_gccgo}
%patch8 -p1
-cp %{SOURCE5} .
+%endif
+cp %{SOURCE4} .
# setup go_arch (BSD-like scheme)
-cp %{SOURCE3} go.macros
%ifarch %ix86
-sed -i 's|GOARCH|386|' go.macros
%define go_arch 386
%endif
%ifarch x86_64
-sed -i 's|GOARCH|amd64|' go.macros
%define go_arch amd64
%endif
+%ifarch aarch64
+%define go_arch arm64
+%endif
%ifarch %arm
-sed -i 's|GOARCH|arm|' go.macros
%define go_arch arm
%endif
+%ifarch ppc64
+%define go_arch ppc64
+%endif
+%ifarch ppc64le
+%define go_arch ppc64le
+%endif
%build
+%if %{with_gccgo}
+export GOROOT_BOOTSTRAP=%{_prefix}
+%else
+export GOROOT_BOOTSTRAP=%{_libdir}/go1.4
+%endif
export GOROOT="`pwd`"
export GOROOT_FINAL=%{_libdir}/go
export GOBIN="$GOROOT/bin"
@@ -124,17 +157,16 @@
cd src
HOST_EXTRA_CFLAGS="%{optflags} -Wno-error" ./make.bash
+cd ../
%ifarch x86_64
# Install race detection version of std libraries (amd64 only)
-cd ../
bin/go install -race std
+bin/go install -buildmode=shared std
%endif
%install
export GOROOT="%{buildroot}%{_libdir}/%{name}"
-# bash completion seems broken
-#install -Dm644 misc/bash/go %%{buildroot}%%{_sysconfdir}/bash_completion.d/go.sh
-install -Dm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/go.sh
+install -Dm644 %{SOURCE2} $GOROOT/bin/profile.d/go.sh
# locations for third party libraries, see README-openSUSE for info about locations.
install -d %{buildroot}%{_datadir}/go/contrib
@@ -142,8 +174,8 @@
ln -s %{_libdir}/%{name}/contrib/pkg/ %{buildroot}%{_datadir}/go/contrib/pkg
install -d %{buildroot}%{_datadir}/go/contrib/cmd
install -d %{buildroot}%{_datadir}/go/contrib/src
-install -Dm644 README-openSUSE $GOROOT/contrib/
-ln -s %{_libdir}/go/contrib/README-openSUSE %{buildroot}%{_datadir}/go/contrib/README-openSUSE
+install -Dm644 README.SUSE $GOROOT/contrib/
+ln -s %{_libdir}/go/contrib/README.SUSE %{buildroot}%{_datadir}/go/contrib/README.SUSE
# source files for go install, godoc, etc
install -d %{buildroot}%{_datadir}/go
@@ -156,58 +188,85 @@
done
# copy document templates, packages, obj libs and command utilities
-mkdir -p %{buildroot}%{_bindir}
+mkdir -p $GOROOT/bin
mkdir -p $GOROOT/lib
+# remove bootstrap
+rm -rf pkg/bootstrap
mv pkg $GOROOT
-mv bin/* %{buildroot}%{_bindir}
+mv bin/* $GOROOT/bin
rm -f %{buildroot}%{_bindir}/{hgpatch,quietgcc}
+# update-alternatives
+mkdir -p %{buildroot}%{_sysconfdir}/alternatives
+mkdir -p %{buildroot}%{_bindir}
+mkdir -p %{buildroot}%{_sysconfdir}/profile.d
+touch %{buildroot}%{_sysconfdir}/alternatives/{go,gofmt,go.sh}
+ln -sf %{_sysconfdir}/alternatives/go %{buildroot}%{_bindir}/go
+ln -sf %{_sysconfdir}/alternatives/gofmt %{buildroot}%{_bindir}/gofmt
+ln -sf %{_sysconfdir}/alternatives/go.sh %{buildroot}%{_sysconfdir}/profile.d/go.sh
+
# documentation and examples
# fix documetation permissions (rpmlint warning)
find doc/ misc/ -type f -exec chmod 0644 '{}' \;
# remove unwanted arch-dependant binaries (rpmlint warning)
rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8}
-rm -f misc/dashboard/builder/{gobuilder,*6,*.8}
-rm -f misc/goplay/{goplay,*.6,*.8}
-rm -rf misc/windows
-rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8}
-# remove kate syntax file, it is shipped with libktexteditor already
-rm -f misc/kate/go.xml
-
-# install RPM macros ($GOARCH prepared in %%prep section)
-install -Dm644 go.macros %{buildroot}%{_sysconfdir}/rpm/macros.go
-
-# break hard links
-rm %{buildroot}%{_libdir}/go/pkg/linux_%{go_arch}/{textflag,funcdata,cgocall,runtime}.h
-ln -s %{_datadir}/go/src/cmd/ld/textflag.h %{buildroot}%{_libdir}/go/pkg/linux_%{go_arch}
-ln -s %{_datadir}/go/src/runtime/{runtime,cgocall,funcdata}.h %{buildroot}%{_libdir}/go/pkg/linux_%{go_arch}
+# prepare go-doc
+mkdir -p %{buildroot}%{_docdir}/%{name}
+cp -r AUTHORS CONTRIBUTORS CONTRIBUTING.md LICENSE PATENTS README.md README.SUSE %{buildroot}%{_docdir}/%{name}
+cp -r doc/* %{buildroot}%{_docdir}/%{name}
+
+# gdbinit
+mkdir -p %{buildroot}%{_sysconfdir}/gdbinit.d
+install -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/gdbinit.d/go.gdb
+%if "%{_lib}" == "lib64"
+sed -i "s/lib/lib64/" %{buildroot}%{_sysconfdir}/gdbinit.d/go.gdb
+%endif
%if 0%{?suse_version} >= 1100
-%fdupes %{buildroot}%{_prefix}
+%fdupes -s %{buildroot}%{_prefix}
%endif
+%post
+update-alternatives \
+ --install %{_bindir}/go go %{_libdir}/%{name}/bin/go 30 \
+ --slave %{_bindir}/gofmt gofmt %{_libdir}/%{name}/bin/gofmt \
+ --slave %{_sysconfdir}/profile.d/go.sh go.sh %{_libdir}/%{name}/bin/profile.d/go.sh
+
+%postun
+if [ $1 -eq 0 ] ; then
+ update-alternatives --remove go %{_libdir}/%{name}/bin/go
+fi
+
%files
%defattr(-,root,root,-)
-%doc AUTHORS CONTRIBUTORS LICENSE PATENTS README README-openSUSE
-%ifarch %ix86
-%{_libdir}/go/pkg/tool/linux_%{go_arch}/8*
-%endif
-%ifarch x86_64
-%{_libdir}/go/pkg/tool/linux_%{go_arch}/6*
-%endif
-%ifarch %arm
-%{_libdir}/go/pkg/tool/linux_%{go_arch}/5*
-%endif
-%{_datadir}/go/
-%{_bindir}/go*
+%{_bindir}/go
+%{_bindir}/gofmt
%{_libdir}/go/
-# bash completion seems broken
-#%%config %%{_sysconfdir}/bash_completion.d/go.sh
+%{_datadir}/go/
+%ghost %{_sysconfdir}/alternatives/go
+%ghost %{_sysconfdir}/alternatives/gofmt
+%ghost %{_sysconfdir}/alternatives/go.sh
%config %{_sysconfdir}/profile.d/go.sh
-%config %{_sysconfdir}/rpm/macros.go
+%config %{_sysconfdir}/gdbinit.d/go.gdb
+%dir %{_docdir}/%{name}/
+%doc %{_docdir}/%{name}/AUTHORS
+%doc %{_docdir}/%{name}/CONTRIBUTORS
+%doc %{_docdir}/%{name}/CONTRIBUTING.md
+%doc %{_docdir}/%{name}/LICENSE
+%doc %{_docdir}/%{name}/PATENTS
+%doc %{_docdir}/%{name}/README.md
+%doc %{_docdir}/%{name}/README.SUSE
%files doc
%defattr(-,root,root,-)
-%doc doc
+%doc %{_docdir}/%{name}/codewalk
+%doc %{_docdir}/%{name}/articles
+%doc %{_docdir}/%{name}/progs
+%doc %{_docdir}/%{name}/play
+%doc %{_docdir}/%{name}/gopher
+%doc %{_docdir}/%{name}/devel
+%doc %{_docdir}/%{name}/*.html
+%doc %{_docdir}/%{name}/*.css
+%doc %{_docdir}/%{name}/*.png
%changelog
Index: tools-packaging.patch
===================================================================
--- tools-packaging.patch (revision 2)
+++ tools-packaging.patch (revision 64)
@@ -2,7 +2,7 @@
===================================================================
--- go.orig/src/cmd/go/pkg.go
+++ go/src/cmd/go/pkg.go
-@@ -492,7 +492,13 @@ func (p *Package) load(stk *importStack,
+@@ -781,7 +781,13 @@ func (p *Package) load(stk *importStack,
if goTools[p.ImportPath] == toTool {
// This is for 'go tool'.
// Override all the usual logic and force it into the tool directory.
Index: verbose-build.patch
===================================================================
--- verbose-build.patch (revision 2)
+++ verbose-build.patch (revision 64)
@@ -2,18 +2,18 @@
===================================================================
--- go.orig/src/make.bash
+++ go/src/make.bash
-@@ -166,12 +166,12 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
+@@ -153,12 +153,12 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
# use the host compiler, CC, from `cmd/dist/dist env` instead.
CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
-- "$GOTOOLDIR"/go_bootstrap install -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
-+ "$GOTOOLDIR"/go_bootstrap install -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std
+- "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
++ "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std cmd
echo
fi
- echo "# Building packages and commands for $GOOS/$GOARCH."
--CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
-+CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std
+ echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
++CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std cmd
echo
rm -f "$GOTOOLDIR"/go_bootstrap
Index: README.SUSE
===================================================================
--- README.SUSE (added)
+++ README.SUSE (revision 64)
@@ -0,0 +1,120 @@
+Updated: 05.05.2012
+Authors: Graham Anderson, <graham@andtech.eu>
+
+
+PROJECT DETAILS
+---------------
+
+OBS: https://build.opensuse.org/project/show?project=devel:languages:go
+
+Maintainers: Sascha Peilicke (saschpe),
+ Graham Anderson (andtecheu)
+
+Wiki: http://en.opensuse.org/Go
+ http://en.opensuse.org/openSUSE:Packaging_Go
+
+
+GENERAL NOTES
+-------------
+
+Go toolchain environmental variables are configured via go.sh, which is
+installed to /etc/profile.d/go.sh
+
+Packaging guidelines and an RPM spec file recipe for packaging third party Go
+libraries can be found on the openSUSE wiki:
+
+ http://en.opensuse.org/openSUSE:Packaging_Go
+
+The openSUSE go package uses the standard Go distribution toolchain, with a
+a small patchset to modify a few of the toolchain commands to suit our
+environment and packaging needs.
+
+This means that many of the standard go toolchain commands are not inside a
+users PATH, but rather are invoked and used via the "go" command. Should you
+wish to script or manually use the commands, the install location on a 64 bit
+system is /usr/lib64/go/pkg/tool/linux_amd64
+
+The "go" tool, the "godoc" document server are inside a users PATH.
+
+We currently don't support the gccgo implementation, this is not for
+any other reason than contributer and maintainer time constraints.
+
+
+GO DOCUMENTATION
+----------------
+
+As of yet, there are no man pages for the standard Go distribution toolchain,
+please see the documentation provided by the "godoc" command. Man pages are
+slated to be included in the release in future.
+
+One of the diffs from the maintained patchset adds the distro specific doc and
+source file locations of the *-doc RPM packages to the virtual filesystem of
+the "godoc" documentation server. That is to say, as long as packages follow
+the Go packaging guidelines, API and other documentation should always be
+available via the godoc server if the packages "doc" RPM is installed.
+
+
+PACKAGE INSTALL LOCATIONS
+-------------------------
+
+Go standard library packages are installed to a location in $GOROOT, which is
+defined as /usr/lib64/go on 64bit systems.
+
+Third party package binaries are installed to the default system wide
+$GOPATH entry. On 64bit systems the location /usr/lib64/go/contrib is used.
+This is specified in the macros.go RPM macro definition file that is part of
+the main Go package and is used for packaging most third party Go libraries.
+
+The reasons binary packages are installed to a GOPATH entry instead of GOROOT
+are mainly to do with how the Go toolchain prioritises and behaves with
+packages installed to the same location as the Go std library.
+
+By installing third party packages to a system-wide GOPATH entry location,
+we can ensure that no packages clobber the standard library namespace or file
+tree. Additionally we can support binary only packages, which as of Go 1.1
+will only be supported outside of the $GOROOT.
+
+There are additional benefits to this location; such as allowing users and
+developers to prioritise linking from their own user defined GOPATH, which
+defaults to $HOME/go configured via /etc/profile.d/go.sh config. This has
+particular benefit for development workflows.
+
+For Go 1.1 and beyond, building and linking with binary only pacakges will
+only be supported with the following caveat. Package source code must not
+exist in the same GOPATH segment as the binary package .a archive file.
+
+If both the binary archive (.a) and the package source are installed to the
+same GOPATH segment, then the "go build" or "go install" command will
+prioritise building the software using package sources before using package
+binary archives. A side effect of this is that is actually possible to have
+source code only third party packages.
+
+To summarise the priority of binary package linking and building:
+
+ 1. Any source files or binary packages in $GOROOT are considered first. Any
+ binary packages in $GOROOT that are considered "stale" by the build tools
+ are ignored in favour of the package source.
+
+ 2. $GOPATH is considered next for import statements. GOPATH is a colon
+ delimited list of paths. GOPATH segments are examined by the build tools
+ in a FIFO manner, left to right.
+
+ Both a system wide and a user GOPATH segment are configured by default,
+ the user GOPATH segment takes priority over the system segment to allow
+ flexibility for development workflows.
+
+ The default user GOPATH is:
+
+ GOPATH=$HOME/go:$GOROOT/contrib
+
+ The default root user GOPATH is:
+
+ GOPATH=$GOROOT/contrib
+
+ 3. For Go < 1.1, If both the source and binary archive is available for a
+ package import in the same GOPATH segment, the binary archive will take
+ precedence and will be linked during compilation.
+
+ For Go >= 1.1 If the package source is avaiable in the GOPATH segment, it
+ will always be used in preference to the binary
+
Index: gcc5-go.patch
===================================================================
--- gcc5-go.patch (added)
+++ gcc5-go.patch (revision 64)
@@ -0,0 +1,58 @@
+diff --git a/src/make.bash b/src/make.bash
+index 2531ca4..12f1aa1 100755
+--- a/src/make.bash
++++ b/src/make.bash
+@@ -112,8 +112,8 @@ echo '##### Building Go bootstrap tool.'
+ echo cmd/dist
+ export GOROOT="$(cd .. && pwd)"
+ GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
+-if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
+- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
++if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-5" ]; then
++ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-5." >&2
+ echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
+ exit 1
+ fi
+@@ -123,7 +123,7 @@ if [ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]; then
+ exit 1
+ fi
+ rm -f cmd/dist/dist
+-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
++GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go-5" build -o cmd/dist/dist ./cmd/dist
+
+ # -e doesn't propagate out of eval, so check success by hand.
+ eval $(./cmd/dist/dist env -p || echo FAIL=true)
+diff --git a/src/make.rc b/src/make.rc
+index 6016204..2223092 100755
+--- a/src/make.rc
++++ b/src/make.rc
+@@ -46,13 +46,13 @@ echo cmd/dist
+ GOROOT = `{cd .. && pwd}
+ if(! ~ $#GOROOT_BOOTSTRAP 1)
+ GOROOT_BOOTSTRAP = $home/go1.4
+-if(! test -x $GOROOT_BOOTSTRAP/bin/go){
+- echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2]
++if(! test -x $GOROOT_BOOTSTRAP/bin/go-5){
++ echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go-5.' >[1=2]
+ echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2]
+ exit bootstrap
+ }
+ rm -f cmd/dist/dist
+-GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist
++GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go-5 build -o cmd/dist/dist ./cmd/dist
+
+ eval `{./cmd/dist/dist env -9}
+ echo
+diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go
+index 20d9535..26cfb20 100644
+--- a/src/cmd/dist/buildtool.go
++++ b/src/cmd/dist/buildtool.go
+@@ -111,7 +111,7 @@ func bootstrapBuildTools() {
+ os.Setenv("GOHOSTARCH", "")
+
+ // Run Go 1.4 to build binaries.
+- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-v", "bootstrap/...")
++ run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go-5", goroot_bootstrap), "install", "-v", "bootstrap/...")
+
+ // Copy binaries into tool binary directory.
+ for _, name := range bootstrapDirs {
Index: go-1.5-build-dont-reinstall-stdlibs.patch
===================================================================
--- go-1.5-build-dont-reinstall-stdlibs.patch (added)
+++ go-1.5-build-dont-reinstall-stdlibs.patch (revision 64)
@@ -0,0 +1,33 @@
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -153,6 +153,7 @@ func init() {
+ }
+
+ // Flags set by multiple commands.
++var buildS bool // OPENSUSE -s (for packaging only)
+ var buildA bool // -a flag
+ var buildN bool // -n flag
+ var buildP = runtime.NumCPU() // -p flag
+@@ -209,6 +210,8 @@ func init() {
+ // addBuildFlags adds the flags common to the build, clean, get,
+ // install, list, run, and test commands.
+ func addBuildFlags(cmd *Command) {
++ // OPENSUSE
++ cmd.Flag.BoolVar(&buildS, "s", false, "")
+ cmd.Flag.BoolVar(&buildA, "a", false, "")
+ cmd.Flag.BoolVar(&buildN, "n", false, "")
+ cmd.Flag.IntVar(&buildP, "p", buildP, "")
+@@ -1502,6 +1505,11 @@ func (b *builder) linkShared(a *action)
+
+ // install is the action for installing a single package or executable.
+ func (b *builder) install(a *action) (err error) {
++ // OPENSUSE
++ if buildS && (a.p.Standard || a.p.ImportPath == "cmd/cgo") {
++ return nil
++ }
++
+ defer func() {
+ if err != nil && err != errPrintedOutput {
+ err = fmt.Errorf("go install %s: %v", a.p.ImportPath, err)
Index: go-1.5-install-dont-reinstall-stdlibs.patch
===================================================================
--- go-1.5-install-dont-reinstall-stdlibs.patch (added)
+++ go-1.5-install-dont-reinstall-stdlibs.patch (revision 64)
@@ -0,0 +1,18 @@
+Index: go/src/cmd/go/pkg.go
+===================================================================
+--- go.orig/src/cmd/go/pkg.go
++++ go/src/cmd/go/pkg.go
+@@ -1374,6 +1374,13 @@ func isStale(p *Package) bool {
+ return false
+ }
+
++ // openSUSE bnc#776058
++ // Only root user can reinstall a std library from a dependancy, all other
++ // users should *never* have to do this.
++ if os.Getuid() != 0 && p.Standard {
++ return false
++ }
++
+ // Time-based staleness.
+
+ built := fi.ModTime()
Index: go.gdbinit
===================================================================
--- go.gdbinit (added)
+++ go.gdbinit (revision 64)
@@ -0,0 +1 @@
+add-auto-load-safe-path /usr/lib/go/src/runtime/runtime-gdb.py
Index: go1.6.1.src.tar.gz
===================================================================
Binary files go1.6.1.src.tar.gz (revision 64) added
Index: README-openSUSE
===================================================================
--- README-openSUSE (revision 2)
+++ README-openSUSE (deleted)
@@ -1,120 +0,0 @@
-Updated: 05.05.2012
-Authors: Graham Anderson, <graham@andtech.eu>
-
-
-PROJECT DETAILS
----------------
-
-OBS: https://build.opensuse.org/project/show?project=devel:languages:go
-
-Maintainers: Sascha Peilicke (saschpe),
- Graham Anderson (andtecheu)
-
-Wiki: http://en.opensuse.org/Go
- http://en.opensuse.org/openSUSE:Packaging_Go
-
-
-GENERAL NOTES
--------------
-
-Go toolchain environmental variables are configured via go.sh, which is
-installed to /etc/profile.d/go.sh
-
-Packaging guidelines and an RPM spec file recipe for packaging third party Go
-libraries can be found on the openSUSE wiki:
-
- http://en.opensuse.org/openSUSE:Packaging_Go
-
-The openSUSE go package uses the standard Go distribution toolchain, with a
-a small patchset to modify a few of the toolchain commands to suit our
-environment and packaging needs.
-
-This means that many of the standard go toolchain commands are not inside a
-users PATH, but rather are invoked and used via the "go" command. Should you
-wish to script or manually use the commands, the install location on a 64 bit
-system is /usr/lib64/go/pkg/tool/linux_amd64
-
-The "go" tool, the "godoc" document server are inside a users PATH.
-
-We currently don't support the gccgo implementation, this is not for
-any other reason than contributer and maintainer time constraints.
-
-
-GO DOCUMENTATION
-----------------
-
-As of yet, there are no man pages for the standard Go distribution toolchain,
-please see the documentation provided by the "godoc" command. Man pages are
-slated to be included in the release in future.
-
-One of the diffs from the maintained patchset adds the distro specific doc and
-source file locations of the *-doc RPM packages to the virtual filesystem of
-the "godoc" documentation server. That is to say, as long as packages follow
-the Go packaging guidelines, API and other documentation should always be
-available via the godoc server if the packages "doc" RPM is installed.
-
-
-PACKAGE INSTALL LOCATIONS
--------------------------
-
-Go standard library packages are installed to a location in $GOROOT, which is
-defined as /usr/lib64/go on 64bit systems.
-
-Third party package binaries are installed to the default system wide
-$GOPATH entry. On 64bit systems the location /usr/lib64/go/contrib is used.
-This is specified in the macros.go RPM macro definition file that is part of
-the main Go package and is used for packaging most third party Go libraries.
-
-The reasons binary packages are installed to a GOPATH entry instead of GOROOT
-are mainly to do with how the Go toolchain prioritises and behaves with
-packages installed to the same location as the Go std library.
-
-By installing third party packages to a system-wide GOPATH entry location,
-we can ensure that no packages clobber the standard library namespace or file
-tree. Additionally we can support binary only packages, which as of Go 1.1
-will only be supported outside of the $GOROOT.
-
-There are additional benefits to this location; such as allowing users and
-developers to prioritise linking from their own user defined GOPATH, which
-defaults to $HOME/go configured via /etc/profile.d/go.sh config. This has
-particular benefit for development workflows.
-
-For Go 1.1 and beyond, building and linking with binary only pacakges will
-only be supported with the following caveat. Package source code must not
-exist in the same GOPATH segment as the binary package .a archive file.
-
-If both the binary archive (.a) and the package source are installed to the
-same GOPATH segment, then the "go build" or "go install" command will
-prioritise building the software using package sources before using package
-binary archives. A side effect of this is that is actually possible to have
-source code only third party packages.
-
-To summarise the priority of binary package linking and building:
-
- 1. Any source files or binary packages in $GOROOT are considered first. Any
- binary packages in $GOROOT that are considered "stale" by the build tools
- are ignored in favour of the package source.
-
- 2. $GOPATH is considered next for import statements. GOPATH is a colon
- delimited list of paths. GOPATH segments are examined by the build tools
- in a FIFO manner, left to right.
-
- Both a system wide and a user GOPATH segment are configured by default,
- the user GOPATH segment takes priority over the system segment to allow
- flexibility for development workflows.
-
- The default user GOPATH is:
-
- GOPATH=$HOME/go:$GOROOT/contrib
-
- The default root user GOPATH is:
-
- GOPATH=$GOROOT/contrib
-
- 3. For Go < 1.1, If both the source and binary archive is available for a
- package import in the same GOPATH segment, the binary archive will take
- precedence and will be linked during compilation.
-
- For Go >= 1.1 If the package source is avaiable in the GOPATH segment, it
- will always be used in preference to the binary
-
Index: go-1.4.2-rel.plt-alignment.patch
===================================================================
--- go-1.4.2-rel.plt-alignment.patch (revision 2)
+++ go-1.4.2-rel.plt-alignment.patch (deleted)
@@ -1,12 +0,0 @@
-Index: go/src/cmd/ld/elf.c
-===================================================================
---- go.orig/src/cmd/ld/elf.c
-+++ go/src/cmd/ld/elf.c
-@@ -1323,6 +1323,7 @@ asmbelf(vlong symo)
- sh->type = SHT_REL;
- sh->flags = SHF_ALLOC;
- sh->entsize = ELF32RELSIZE;
-+ sh->addralign = 4;
- sh->link = elfshname(".dynsym")->shnum;
- shsym(sh, linklookup(ctxt, ".rel.plt", 0));
-
Index: go-build-dont-reinstall-stdlibs.patch
===================================================================
--- go-build-dont-reinstall-stdlibs.patch (revision 2)
+++ go-build-dont-reinstall-stdlibs.patch (deleted)
@@ -1,35 +0,0 @@
-Index: go/src/cmd/go/build.go
-===================================================================
---- go.orig/src/cmd/go/build.go
-+++ go/src/cmd/go/build.go
-@@ -118,6 +118,7 @@ func init() {
- }
-
- // Flags set by multiple commands.
-+var buildS bool // OPENSUSE -s (for packaging only)
- var buildA bool // -a flag
- var buildN bool // -n flag
- var buildP = runtime.NumCPU() // -p flag
-@@ -170,6 +171,10 @@ func init() {
- // install, list, run, and test commands.
- func addBuildFlags(cmd *Command) {
- // NOTE: If you add flags here, also add them to testflag.go.
-+
-+ // OPENSUSE
-+ cmd.Flag.BoolVar(&buildS, "s", false, "")
-+
- cmd.Flag.BoolVar(&buildA, "a", false, "")
- cmd.Flag.BoolVar(&buildN, "n", false, "")
- cmd.Flag.IntVar(&buildP, "p", buildP, "")
-@@ -1070,6 +1075,11 @@ func (b *builder) getPkgConfigFlags(p *P
-
- // install is the action for installing a single package or executable.
- func (b *builder) install(a *action) (err error) {
-+ // OPENSUSE
-+ if buildS && (a.p.Standard || a.p.ImportPath == "cmd/cgo") {
-+ return nil
-+ }
-+
- defer func() {
- if err != nil && err != errPrintedOutput {
- err = fmt.Errorf("go install %s: %v", a.p.ImportPath, err)
Index: go-install-dont-reinstall-stdlibs.patch
===================================================================
--- go-install-dont-reinstall-stdlibs.patch (revision 2)
+++ go-install-dont-reinstall-stdlibs.patch (deleted)
@@ -1,18 +0,0 @@
-Index: go/src/cmd/go/pkg.go
-===================================================================
---- go.orig/src/cmd/go/pkg.go
-+++ go/src/cmd/go/pkg.go
-@@ -748,6 +748,13 @@ func isStale(p *Package, topRoot map[str
- return true
- }
-
-+ // openSUSE bnc#776058
-+ // Only root user can reinstall a std library from a dependancy, all other
-+ // users should *never* have to do this.
-+ if os.Getuid() != 0 && p.Standard {
-+ return false
-+ }
-+
- olderThan := func(file string) bool {
- fi, err := os.Stat(file)
- return err != nil || fi.ModTime().After(built)
Index: go-wiki-gadget.xml
===================================================================
--- go-wiki-gadget.xml (revision 2)
+++ go-wiki-gadget.xml (deleted)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!-- embedding gadget for the go-wiki -->
-<Module>
- <ModulePrefs title="openSUSE Build Service" />
- <Content type="url" href="http://software.opensuse.org/download/iframe?project=devel:languages:go&package=go" />
-</Module>
Index: go1.4.2.src.tar.gz
===================================================================
Binary files go1.4.2.src.tar.gz (revision 2) deleted
Index: macros.go
===================================================================
--- macros.go (revision 2)
+++ macros.go (deleted)
@@ -1,211 +0,0 @@
-# Macros for Go module building.
-#
-# Copyright: (c) 2011 Sascha Peilicke <saschpe@gmx.de>
-# Copyright: (c) 2012 Graham Anderson <graham@andtech.eu>
-# Copyright: (c) 2015 SUSE Linux GmbH
-#
-
-
-%go_ver %(LC_ALL=C rpm -q --qf '%%{epoch}:%%{version}\\n' go | sed -e 's/(none)://' -e 's/ 0:/ /' | grep -v "is not")
-%go_arch GOARCH
-%go_build_ver %(go version | sed 's/^go version //' | sed 's:\/::g' | tr -d ' ' | cut -c 1-7 )
-
-%go_dir %{_libdir}/go
-%go_sitedir %{_libdir}/go/pkg
-%go_sitearch %{_libdir}/go/pkg/linux_%{go_arch}
-%go_contribdir %{_libdir}/go/contrib/pkg/linux_%{go_arch}
-%go_contribsrcdir %{_datadir}/go/contrib/src/
-%go_tooldir %{_datadir}/go/pkg/tool/linux_%{go_arch}
-
-%go_exclusivearch \
-ExclusiveArch: %ix86 x86_64 %arm
-
-%go_provides \
-%go_exclusivearch \
-Provides: %{name}-devel = %{version} \
-Provides: %{name}-devel-static = %{version}
-
-# Prepare the expected Go package build environement.
-# We need a $GOPATH: go help gopath
-# We need a valid importpath: go help packages
-%goprep() \
-export GOPATH=%{_builddir}/go \
-if [ %# -eq 0 ]; then \
- echo "goprep: please specify a valid importpath, see: go help packages" \
- exit 1 \
-else \
- export IMPORTPATH=%1 \
-fi \
-# create the importpath and move the package there \
-pkg_dir=$(basename $PWD) \
-cd %{_builddir} \
-mkdir -p $GOPATH/src/$IMPORTPATH \
-(shopt -s dotglob; mv -- ${pkg_dir}/* $GOPATH/src/$IMPORTPATH) \
-# now link the old location to the new (for compatibility) \
-rmdir ${pkg_dir} \
-ln -s $GOPATH/src/$IMPORTPATH ${pkg_dir} \
-cd ${pkg_dir} \
-# we'll be installing packages/binaries/tools, make the targ dirs \
-install -d %{buildroot}%{go_contribdir} \
-install -d %{buildroot}%{go_tooldir} \
-install -d %{buildroot}%{_bindir} \
-%{nil}
-
-# %%gobuild macro actually performs the command "go install", but the go
-# toolchain will install to the $GOPATH which allows us then customise the final
-# install for the distro default locations.
-#
-# gobuild accepts zero or more arguments. Each argument corresponds to
-# a modifier of the importpath. If no arguments are passed, this is equivalent
-# to the following go install statement:
-#
-# go install [importpath]
-#
-# Only the first or last arguement may be ONLY the wildcard argument "..."
-# if the wildcard argument is passed then the importpath expands to all packages
-# and binaries underneath it. If the argument contains only the wildcard no further
-# arguments are considered.
-#
-# If no wildcard argument is passed, go install will be invoked on each $arg
-# subdirectory under the importpath.
-#
-# Valid importpath modifier examples:
-#
-# example: %gobuild ...
-# command: go install importpath...
-#
-# example: %gobuild /...
-# command: go install importpath/... (All subdirs NOT including importpath)
-#
-# example: %gobuild foo...
-# command: go install importpath/foo... (All subdirs INCLUDING foo)
-#
-# example: %gobuild foo ... (same as foo...)
-# command: go install importpath/foo... (All subdirs INCLUDING foo)
-#
-# example: %gobuild foo/...
-# commands: go install importpath/foo/... (All subdirs NOT including foo)
-#
-# example: %gobuild foo bar
-# commands: go install importpath/foo
-# go install importpath/bar
-#
-# example: %gobuild foo ... bar
-# commands: go install importpath/foo... (bar is ignored)
-#
-# example: %gobuild foo bar... baz
-# commands: go install importpath/foo
-# go install importpath/bar...
-# go install importpath/baz
-#
-# See: go help install, go help packages
-%gobuild() \
-export BUILDFLAGS="-s -v -p 4 -x" \
-export GOPATH=%{_builddir}/go:%{_libdir}/go/contrib \
-export GOBIN=%{_builddir}/go/bin \
-MOD="" \
-if [ %# -gt 0 ]; then \
- for mod in %*; do \
- if [ $mod == "..." ]; then \
- MOD=$MOD... \
- if [ "$WITH_FAKE_BUILDID" = "true" ] ; then \
- go install $BUILDFLAGS -ldflags "-B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" $IMPORTPATH$MOD \
- else \
- go install $BUILDFLAGS $IMPORTPATH$MOD \
- fi \
- break \
- else \
- MOD=/$mod \
- if [ "$WITH_FAKE_BUILDID" = "true" ] ; then \
- go install $BUILDFLAGS -ldflags "-B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" $IMPORTPATH$MOD \
- else \
- go install $BUILDFLAGS $IMPORTPATH$MOD \
- fi \
- fi \
- done \
-else \
- if [ "$WITH_FAKE_BUILDID" = "true" ] ; then \
- go install $BUILDFLAGS -ldflags "-B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" $IMPORTPATH \
- else \
- go install $BUILDFLAGS $IMPORTPATH \
- fi \
-fi \
-%{nil}
-
-# Install all compiled packages and binaries to the buildroot
-%goinstall() \
-export GOPATH=%{_builddir}/go \
-install -d %{buildroot}%{go_contribdir} \
-TMPPKG=%{_builddir}/go/pkg \
-if [ "$(ls -A $TMPPKG)" ]; then \
- cp -ar %{_builddir}/go/pkg/linux_%{go_arch}/* %{buildroot}%{go_contribdir} \
-fi \
-TMPBIN=%{_builddir}/go/bin \
-if [ "$(ls -A $TMPBIN)" ]; then \
- install -m755 $TMPBIN/* %{buildroot}%{_bindir} \
-fi \
-%{nil}
-
-%gofix() \
-export GOPATH=%{_builddir}/go \
-if [ %# -eq 0 ]; then \
- echo "gofix: please specify a valid importpath, see: go help fix" \
- exit 1 \
-else \
- go fix %1... \
-fi \
-%{nil}
-
-%gotest() \
-export GOPATH=%{_builddir}/go:%{_libdir}/go/contrib \
-if [ %# -eq 0 ]; then \
- echo "gotest: please specify a valid importpath, see: go help test" \
- exit 1 \
-else \
- go test -x %1... \
-fi \
-%{nil}
-
-%gosrc() \
-install -d %{buildroot}%{go_contribsrcdir} \
-cd %{_builddir}/go/src \
-find . -name "*.go" -exec install -Dm644 \{\} %{buildroot}%{go_contribsrcdir}/\{\} \\; \
-%{nil}
-
-# Template for source sub-package
-%gosrc_package(n:r:) \
-%package %{-n:-n %{-n*}-}source \
-Summary: Source codes for package %{name} \
-Group: Development/Sources \
-Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \
-%{-r:Requires: %{-r*}} \
-Provides: %{-n:%{-n*}}%{!-n:%{name}}-doc = %{version}-%{release} \
-Obsoletes: %{-n:%{-n*}}%{!-n:%{name}}-doc < %{version}-%{release} \
-%description %{-n:-n %{-n*}-}source \
-This package provides source codes for package %{name}.\
-%{nil}
-
-# backward compatibility
-%go_requires \
-%(if [ ! -f /usr/lib/rpm/golang.attr ] ; then \
-echo "Requires: go >= %go_build_ver" \
-fi) \
-%{nil}
-
-%go_recommends %{nil}
-
-%godoc \
-%gosrc \
-%{nil}
-
-# Template for doc sub-package
-%godoc_package(n:r:) \
-%package %{-n:-n %{-n*}-}doc \
-Summary: API documention for package %{name} \
-Group: Documentation/Other \
-Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \
-%{-r:Requires: %{-r*}} \
-%description %{-n:-n %{-n*}-}doc \
-This package provides API, examples and documentation \
-for package %{name}.\
-%{nil}
- Created by jordimassaguerpla
- In state accepted
Request History
jordimassaguerpla created request
update go to 1.6 to be consistent with the version that we will
have in SUSE:SLE-12:Update and in Package Hub
old: openSUSE:Leap:42.1:Update/go
new: openSUSE:Factory/go rev 64
Index: allow-binary-only-packages.patch
===================================================================
--- allow-binary-only-packages.patch (revision 2)
+++ allow-binary-only-packages.patch (revision 64)
@@ -1,13 +1,13 @@
-Index: go/src/cmd/go/pkg.go
-===================================================================
---- go.orig/src/cmd/go/pkg.go
-+++ go/src/cmd/go/pkg.go
-@@ -264,7 +264,7 @@ func loadImport(path string, srcDir stri
- //
- // TODO: After Go 1, decide when to pass build.AllowBinary here.
- // See issue 3268 for mistakes to avoid.
-- bp, err := buildContext.Import(path, srcDir, build.ImportComment)
-+ bp, err := buildContext.Import(path, srcDir, build.AllowBinary | build.ImportComment)
+diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go
+index 0c0cf07..4c0e450 100644
+--- a/src/cmd/go/pkg.go
++++ b/src/cmd/go/pkg.go
+@@ -365,7 +365,7 @@ func loadImport(path, srcDir string, parent *Package, stk *importStack, importPo
+ // Not vendoring, or we already found the vendored path.
+ buildMode |= build.IgnoreVendor
+ }
+- bp, err := buildContext.Import(path, srcDir, buildMode)
++ bp, err := buildContext.Import(path, srcDir, build.AllowBinary|buildMode)
bp.ImportPath = importPath
if gobin != "" {
bp.BinDir = gobin
Index: armv6l.patch
===================================================================
--- armv6l.patch (revision 2)
+++ armv6l.patch (revision 64)
@@ -1,11 +1,11 @@
---- a/src/pkg/runtime/os_linux.h 2014-08-13 05:49:43.000000000 +0200
-+++ b/src/pkg/runtime/os_linux.h 2014-10-17 04:02:55.791948419 +0200
-@@ -16,7 +16,7 @@
- void runtime·setitimer(int32, Itimerval*, Itimerval*);
+--- a/src/runtime/os2_linux_generic.go
++++ b/src/runtime/os2_linux_generic.go
+@@ -6,7 +6,7 @@
-
--#define NSIG 65
-+#define NSIG 64
- #define SI_USER 0
-
- // It's hard to tease out exactly how big a Sigset is, but
+ const (
+ _SS_DISABLE = 2
+- _NSIG = 65
++ _NSIG = 64
+ _SI_USER = 0
+ _SIG_BLOCK = 0
+ _SIG_UNBLOCK = 1
Index: fix_certificates_lookup.patch
===================================================================
--- fix_certificates_lookup.patch (revision 2)
+++ fix_certificates_lookup.patch (revision 64)
@@ -1,8 +1,8 @@
-Index: go/src/crypto/x509/root_unix.go
-===================================================================
---- go.orig/src/crypto/x509/root_unix.go
-+++ go/src/crypto/x509/root_unix.go
-@@ -6,24 +6,20 @@
+diff --git a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go
+index 9f06f9d..b3b2bb8 100644
+--- a/src/crypto/x509/root_unix.go
++++ b/src/crypto/x509/root_unix.go
+@@ -6,13 +6,15 @@
package x509
@@ -12,32 +12,21 @@
+ "os"
+)
- // Possible certificate files; stop after finding one.
- var certFiles = []string{
-- "/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc.
-- "/etc/pki/tls/certs/ca-bundle.crt", // Fedora/RHEL
-- "/etc/ssl/ca-bundle.pem", // OpenSUSE
-- "/etc/ssl/cert.pem", // OpenBSD
-- "/usr/local/share/certs/ca-root-nss.crt", // FreeBSD/DragonFly
-- "/etc/pki/tls/cacert.pem", // OpenELEC
-- "/etc/certs/ca-certificates.crt", // Solaris 11.2+
-+ "/etc/ssl/ca-bundle.pem", // openSUSE and SLE12+
- }
-
// Possible directories with certificate files; stop after successfully
// reading at least one file from a directory.
var certDirectories = []string{
+- "/etc/ssl/certs", // SLES10/SLES11, https://golang.org/issue/12139
- "/system/etc/security/cacerts", // Android
--
-+ "/etc/ssl/certs", // SLE11
++ "/etc/ssl/certs", // SLES10/SLES11, https://golang.org/issue/12139
}
func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) {
-@@ -41,22 +37,24 @@ func initSystemRoots() {
+@@ -30,22 +32,26 @@ func initSystemRoots() {
}
}
+ rootsAdded := false
++
for _, directory := range certDirectories {
fis, err := ioutil.ReadDir(directory)
if err != nil {
@@ -58,6 +47,7 @@
- return
- }
+ }
++
+ if rootsAdded {
+ systemRoots = roots
}
Index: go.changes
===================================================================
--- go.changes (revision 2)
+++ go.changes (revision 64)
@@ -1,4 +1,111 @@
-------------------------------------------------------------------
+Wed Apr 13 18:00:49 UTC 2016 - jmassaguerpla@suse.com
+
+- fix bsc#974232: CVE-2016-3959: go: Infinite loop in several big
+ integer routines
+
+-------------------------------------------------------------------
+Fri Feb 19 09:27:32 UTC 2016 - jmassaguerpla@suse.com
+
+- Update to version 1.6
+
+ * On Linux on little-endian 64-bit PowerPC (linux/ppc64le), Go 1.6 now supports cgo with external linking and is roughly feature complete.
+ * Vendoring support
+ * HTTP2 transparent support
+ * fix gc and gccgo incompatibility regarding embedded unexported struct types containing exported fields
+ * Linux on 64-bit MIPS and Android on 32-bit x86
+ * enforced rules for sharing Go pointers with C
+ * new mechanism for template reuse
+ * performance improvements
+ ... and more!
+
+ see more in https://tip.golang.org/doc/go1.6
+
+-------------------------------------------------------------------
+Wed Feb 10 21:46:59 UTC 2016 - fcastelli@suse.com
+
+- Update to version 1.5.3:
+ * CVE-2015-8618: go: Carry propagation in Int.Exp Montgomery code in
+ math/big library (bnc#960151)
+
+-------------------------------------------------------------------
+Sun Jan 10 17:01:28 UTC 2016 - i@marguerite.su
+
+- macro.go and golang-macros.rb moved to golang-packaging
+
+-------------------------------------------------------------------
+Wed Dec 30 15:41:02 UTC 2015 - i@marguerite.su
+
+- macro.go:
+ * added golang-macros.rb to deal with complicated macros
+ that are hard to be written in shell script
+ * support "--with-buildid" which is the former ugly
+ "WITH_FAKE_BUILDID" environment variable hack
+ * support "--shared" which is "-buildmode=shared -linkshared"
+ in case anyone need it
+ * add go_api_ver macro which is currently 1.5
+- install shared stdlib on x86_64
+- drop go-wiki-gadget.xml: it hasn't been used from the beginning
+- add go.gdbinit for debug friendly
+
+-------------------------------------------------------------------
+Thu Dec 10 19:25:18 UTC 2015 - matwey.kornilov@gmail.com
+
+- Updated to 1.5.2:
+ This release includes bug fixes to the compiler,
+ linker, and the mime/multipart, net, and runtime packages.
+ https://golang.org/doc/devel/release.html#go1.5.minor
+
+-------------------------------------------------------------------
+Sun Oct 25 08:24:29 UTC 2015 - guoli_l@126.com
+
+- Updated to 1.5.1
+ This release includes bug fixes to the go command,
+ the compiler, assembler, and the fmt, net/textproto,
+ net/http, and runtime packages.
+ https://golang.org/doc/devel/release.html#go1.5.minor
+
+-------------------------------------------------------------------
+Wed Oct 7 12:16:45 UTC 2015 - mlin@suse.com
+
+- Adapt to Leap
+ * use gcc5-go than go1.4 is the proper requirement for Leap
+
+-------------------------------------------------------------------
+Tue Sep 15 12:56:49 UTC 2015 - dmueller@suse.com
+
+- go.sh, macros.go, go.spec: add missing bits for aarch64
+
+-------------------------------------------------------------------
+Fri Sep 11 08:43:53 UTC 2015 - dmueller@suse.com
+
+- enable build for aarch64
+- rediff armv6l.patch
+
+-------------------------------------------------------------------
+Sat Aug 22 17:44:55 UTC 2015 - i@marguerite.su
+
+- enable ppc64 and ppc64le
+
+-------------------------------------------------------------------
+Thu Aug 20 15:26:42 UTC 2015 - i@marguerite.su
+
+- update to version 1.5
+ * see https://golang.org/doc/go1.5
+- add: go-1.5-build-dont-reinstall-stdlibs.patch
+ drop: go-build-dont-reinstall-stdlibs.patch
+ * refresh patch
+- add: go-1.5-install-dont-reinstall-stdlibs.patch
+ drop: go-install-dont-reinstall-stdlibs.patch
+ * refresh patch
+- drop: go-1.4.2-rel.plt-alignment.patch
+ * fix by upstream
+- add gcc5-go.patch
+ * find /usr/bin/go-5 when bootstrapping with gcc5-go
+- use update-alternatives for /usr/bin/go and profiles.d
+ so it can be co-installed with go1.4
+
+-------------------------------------------------------------------
Tue Aug 11 16:06:28 UTC 2015 - jmassaguerpla@suse.com
- fix update from 1.3.3
Index: go.sh
===================================================================
--- go.sh (revision 2)
+++ go.sh (revision 64)
@@ -1,16 +1,30 @@
# go toolchain env paths
-libdir=lib
-arch=386
-if [ -x /usr/lib64/go ] ; then
- libdir=lib64
- arch=amd64
-fi
-
export GOOS="linux"
case "$(uname -m)" in
*86)
- export GOARCH=$arch
- ;;
+ export GOARCH=386
+ libdir=lib
+ ;;
+ aarch64)
+ export GOARCH=arm64
+ libdir=lib64
+ ;;
+ x86_64)
+ export GOARCH=amd64
+ libdir=lib64
+ ;;
+ ppc64)
+ export GOARCH=ppc64
+ libdir=lib64
+ ;;
+ ppc64le)
+ export GOARCH=ppc64le
+ libdir=lib64
+ ;;
+ arm*)
+ export GOARCH=arm
+ libdir=lib
+ ;;
esac
export GOROOT=/usr/$libdir/go
export GOBIN=/usr/bin
Index: go.spec
===================================================================
--- go.spec (revision 2)
+++ go.spec (revision 64)
@@ -1,8 +1,7 @@
#
# spec file for package go
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
-# Copyright (c) 2011, Sascha Peilicke <saschpe@gmx.de>
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,8 +16,19 @@
#
+%if 0%{?suse_version} > 1320
+%define with_gccgo 1
+%else
+%if 0%{?suse_version} == 1315 && 0%{?is_opensuse}
+%define with_gccgo 1
+%else
+%define with_gccgo 0
+%endif
+%endif
+
+%define go_api 1.6
Name: go
-Version: 1.4.2
+Version: 1.6.1
Release: 0
Summary: A compiled, garbage-collected, concurrent programming language
License: BSD-3-Clause
@@ -27,18 +37,17 @@
Source0: http://golang.org/dl/go%{version}.src.tar.gz
Source1: go-rpmlintrc
Source2: go.sh
-Source3: macros.go
-Source4: go-wiki-gadget.xml
-Source5: README-openSUSE
+Source4: README.SUSE
+Source6: go.gdbinit
# PATCH-FIX-OPENSUSE add -s flag to 'go install' (don't rebuild/install std libs)
-Patch1: go-build-dont-reinstall-stdlibs.patch
+Patch1: go-1.5-build-dont-reinstall-stdlibs.patch
# PATCH-FIX-OPENSUSE re-enable build binary only packages (we are binary distro)
# see http://code.google.com/p/go/issues/detail?id=2775 & also issue 3268
Patch2: allow-binary-only-packages.patch
#PATCH-FIX-OPENSUSE use -x verbose build output for qemu-arm builders
Patch3: verbose-build.patch
# PATCH-FIX-OPENSUSE BNC#776058
-Patch4: go-install-dont-reinstall-stdlibs.patch
+Patch4: go-1.5-install-dont-reinstall-stdlibs.patch
# PATCH-FIX-OPENSUSE enable writing tools outside $GOROOT/pkg/tool for packaging
Patch5: tools-packaging.patch
# armv6l needs this patch for our build system
@@ -47,9 +56,15 @@
# PATCH-FIX-OPENSUSE fix_certificates_lookup.patch fcastelli@suse.com -- this patch forces Go to look for certificates only in the openSUSE/SLE locations. It also fixes certificate loading on SLE11, see https://github.com/golang/go/issues/6391
# PATCH-FIX-SUSE fix_certificates_lookup.patch fcastelli@suse.com -- this patch forces Go to look for certificates only in the openSUSE/SLE locations. It also fixes certificate loading on SLE11, see https://github.com/golang/go/issues/6391
Patch7: fix_certificates_lookup.patch
-Patch8: go-1.4.2-rel.plt-alignment.patch
+# PATCH-FIX-UPSTREAM marguerite@opensuse.org - find /usr/bin/go-5 when bootstrapping with gcc5-go
+Patch8: gcc5-go.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: rpm
+# boostrap
+%if %{with_gccgo}
+BuildRequires: gcc5-go
+%else
+BuildRequires: go1.4
+%endif
%if 0%{?suse_version} >= 1210
BuildRequires: mercurial
BuildRequires: systemd
@@ -62,15 +77,21 @@
BuildRequires: rpm >= 4.11.1
%endif
%endif
+# for go.gdbinit, directory ownership
+BuildRequires: gdb
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
Requires: gcc
+# for golang-macros.rb
+Requires: ruby
Provides: go-devel = %{name}%{version}
Provides: go-devel-static = %{name}%{version}
-Provides: golang(API) = 1.4
+Provides: golang(API) = %{go_api}
Obsoletes: go-devel < %{name}%{version}
# go-vim/emacs were separate projects starting from 1.4
Obsoletes: go-emacs <= 1.3.3
Obsoletes: go-vim <= 1.3.3
-ExclusiveArch: %ix86 x86_64 %arm
+ExclusiveArch: %ix86 x86_64 aarch64 ppc64 ppc64le
%description
Go is an expressive, concurrent, garbage collected systems programming language
@@ -98,25 +119,37 @@
%patch6 -p1
%endif
%patch7 -p1
+%if %{with_gccgo}
%patch8 -p1
-cp %{SOURCE5} .
+%endif
+cp %{SOURCE4} .
# setup go_arch (BSD-like scheme)
-cp %{SOURCE3} go.macros
%ifarch %ix86
-sed -i 's|GOARCH|386|' go.macros
%define go_arch 386
%endif
%ifarch x86_64
-sed -i 's|GOARCH|amd64|' go.macros
%define go_arch amd64
%endif
+%ifarch aarch64
+%define go_arch arm64
+%endif
%ifarch %arm
-sed -i 's|GOARCH|arm|' go.macros
%define go_arch arm
%endif
+%ifarch ppc64
+%define go_arch ppc64
+%endif
+%ifarch ppc64le
+%define go_arch ppc64le
+%endif
%build
+%if %{with_gccgo}
+export GOROOT_BOOTSTRAP=%{_prefix}
+%else
+export GOROOT_BOOTSTRAP=%{_libdir}/go1.4
+%endif
export GOROOT="`pwd`"
export GOROOT_FINAL=%{_libdir}/go
export GOBIN="$GOROOT/bin"
@@ -124,17 +157,16 @@
cd src
HOST_EXTRA_CFLAGS="%{optflags} -Wno-error" ./make.bash
+cd ../
%ifarch x86_64
# Install race detection version of std libraries (amd64 only)
-cd ../
bin/go install -race std
+bin/go install -buildmode=shared std
%endif
%install
export GOROOT="%{buildroot}%{_libdir}/%{name}"
-# bash completion seems broken
-#install -Dm644 misc/bash/go %%{buildroot}%%{_sysconfdir}/bash_completion.d/go.sh
-install -Dm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/go.sh
+install -Dm644 %{SOURCE2} $GOROOT/bin/profile.d/go.sh
# locations for third party libraries, see README-openSUSE for info about locations.
install -d %{buildroot}%{_datadir}/go/contrib
@@ -142,8 +174,8 @@
ln -s %{_libdir}/%{name}/contrib/pkg/ %{buildroot}%{_datadir}/go/contrib/pkg
install -d %{buildroot}%{_datadir}/go/contrib/cmd
install -d %{buildroot}%{_datadir}/go/contrib/src
-install -Dm644 README-openSUSE $GOROOT/contrib/
-ln -s %{_libdir}/go/contrib/README-openSUSE %{buildroot}%{_datadir}/go/contrib/README-openSUSE
+install -Dm644 README.SUSE $GOROOT/contrib/
+ln -s %{_libdir}/go/contrib/README.SUSE %{buildroot}%{_datadir}/go/contrib/README.SUSE
# source files for go install, godoc, etc
install -d %{buildroot}%{_datadir}/go
@@ -156,58 +188,85 @@
done
# copy document templates, packages, obj libs and command utilities
-mkdir -p %{buildroot}%{_bindir}
+mkdir -p $GOROOT/bin
mkdir -p $GOROOT/lib
+# remove bootstrap
+rm -rf pkg/bootstrap
mv pkg $GOROOT
-mv bin/* %{buildroot}%{_bindir}
+mv bin/* $GOROOT/bin
rm -f %{buildroot}%{_bindir}/{hgpatch,quietgcc}
+# update-alternatives
+mkdir -p %{buildroot}%{_sysconfdir}/alternatives
+mkdir -p %{buildroot}%{_bindir}
+mkdir -p %{buildroot}%{_sysconfdir}/profile.d
+touch %{buildroot}%{_sysconfdir}/alternatives/{go,gofmt,go.sh}
+ln -sf %{_sysconfdir}/alternatives/go %{buildroot}%{_bindir}/go
+ln -sf %{_sysconfdir}/alternatives/gofmt %{buildroot}%{_bindir}/gofmt
+ln -sf %{_sysconfdir}/alternatives/go.sh %{buildroot}%{_sysconfdir}/profile.d/go.sh
+
# documentation and examples
# fix documetation permissions (rpmlint warning)
find doc/ misc/ -type f -exec chmod 0644 '{}' \;
# remove unwanted arch-dependant binaries (rpmlint warning)
rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8}
-rm -f misc/dashboard/builder/{gobuilder,*6,*.8}
-rm -f misc/goplay/{goplay,*.6,*.8}
-rm -rf misc/windows
-rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8}
-# remove kate syntax file, it is shipped with libktexteditor already
-rm -f misc/kate/go.xml
-
-# install RPM macros ($GOARCH prepared in %%prep section)
-install -Dm644 go.macros %{buildroot}%{_sysconfdir}/rpm/macros.go
-
-# break hard links
-rm %{buildroot}%{_libdir}/go/pkg/linux_%{go_arch}/{textflag,funcdata,cgocall,runtime}.h
-ln -s %{_datadir}/go/src/cmd/ld/textflag.h %{buildroot}%{_libdir}/go/pkg/linux_%{go_arch}
-ln -s %{_datadir}/go/src/runtime/{runtime,cgocall,funcdata}.h %{buildroot}%{_libdir}/go/pkg/linux_%{go_arch}
+# prepare go-doc
+mkdir -p %{buildroot}%{_docdir}/%{name}
+cp -r AUTHORS CONTRIBUTORS CONTRIBUTING.md LICENSE PATENTS README.md README.SUSE %{buildroot}%{_docdir}/%{name}
+cp -r doc/* %{buildroot}%{_docdir}/%{name}
+
+# gdbinit
+mkdir -p %{buildroot}%{_sysconfdir}/gdbinit.d
+install -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/gdbinit.d/go.gdb
+%if "%{_lib}" == "lib64"
+sed -i "s/lib/lib64/" %{buildroot}%{_sysconfdir}/gdbinit.d/go.gdb
+%endif
%if 0%{?suse_version} >= 1100
-%fdupes %{buildroot}%{_prefix}
+%fdupes -s %{buildroot}%{_prefix}
%endif
+%post
+update-alternatives \
+ --install %{_bindir}/go go %{_libdir}/%{name}/bin/go 30 \
+ --slave %{_bindir}/gofmt gofmt %{_libdir}/%{name}/bin/gofmt \
+ --slave %{_sysconfdir}/profile.d/go.sh go.sh %{_libdir}/%{name}/bin/profile.d/go.sh
+
+%postun
+if [ $1 -eq 0 ] ; then
+ update-alternatives --remove go %{_libdir}/%{name}/bin/go
+fi
+
%files
%defattr(-,root,root,-)
-%doc AUTHORS CONTRIBUTORS LICENSE PATENTS README README-openSUSE
-%ifarch %ix86
-%{_libdir}/go/pkg/tool/linux_%{go_arch}/8*
-%endif
-%ifarch x86_64
-%{_libdir}/go/pkg/tool/linux_%{go_arch}/6*
-%endif
-%ifarch %arm
-%{_libdir}/go/pkg/tool/linux_%{go_arch}/5*
-%endif
-%{_datadir}/go/
-%{_bindir}/go*
+%{_bindir}/go
+%{_bindir}/gofmt
%{_libdir}/go/
-# bash completion seems broken
-#%%config %%{_sysconfdir}/bash_completion.d/go.sh
+%{_datadir}/go/
+%ghost %{_sysconfdir}/alternatives/go
+%ghost %{_sysconfdir}/alternatives/gofmt
+%ghost %{_sysconfdir}/alternatives/go.sh
%config %{_sysconfdir}/profile.d/go.sh
-%config %{_sysconfdir}/rpm/macros.go
+%config %{_sysconfdir}/gdbinit.d/go.gdb
+%dir %{_docdir}/%{name}/
+%doc %{_docdir}/%{name}/AUTHORS
+%doc %{_docdir}/%{name}/CONTRIBUTORS
+%doc %{_docdir}/%{name}/CONTRIBUTING.md
+%doc %{_docdir}/%{name}/LICENSE
+%doc %{_docdir}/%{name}/PATENTS
+%doc %{_docdir}/%{name}/README.md
+%doc %{_docdir}/%{name}/README.SUSE
%files doc
%defattr(-,root,root,-)
-%doc doc
+%doc %{_docdir}/%{name}/codewalk
+%doc %{_docdir}/%{name}/articles
+%doc %{_docdir}/%{name}/progs
+%doc %{_docdir}/%{name}/play
+%doc %{_docdir}/%{name}/gopher
+%doc %{_docdir}/%{name}/devel
+%doc %{_docdir}/%{name}/*.html
+%doc %{_docdir}/%{name}/*.css
+%doc %{_docdir}/%{name}/*.png
%changelog
Index: tools-packaging.patch
===================================================================
--- tools-packaging.patch (revision 2)
+++ tools-packaging.patch (revision 64)
@@ -2,7 +2,7 @@
===================================================================
--- go.orig/src/cmd/go/pkg.go
+++ go/src/cmd/go/pkg.go
-@@ -492,7 +492,13 @@ func (p *Package) load(stk *importStack,
+@@ -781,7 +781,13 @@ func (p *Package) load(stk *importStack,
if goTools[p.ImportPath] == toTool {
// This is for 'go tool'.
// Override all the usual logic and force it into the tool directory.
Index: verbose-build.patch
===================================================================
--- verbose-build.patch (revision 2)
+++ verbose-build.patch (revision 64)
@@ -2,18 +2,18 @@
===================================================================
--- go.orig/src/make.bash
+++ go/src/make.bash
-@@ -166,12 +166,12 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
+@@ -153,12 +153,12 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
# use the host compiler, CC, from `cmd/dist/dist env` instead.
CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
-- "$GOTOOLDIR"/go_bootstrap install -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
-+ "$GOTOOLDIR"/go_bootstrap install -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std
+- "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
++ "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std cmd
echo
fi
- echo "# Building packages and commands for $GOOS/$GOARCH."
--CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
-+CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std
+ echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
++CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std cmd
echo
rm -f "$GOTOOLDIR"/go_bootstrap
Index: README.SUSE
===================================================================
--- README.SUSE (added)
+++ README.SUSE (revision 64)
@@ -0,0 +1,120 @@
+Updated: 05.05.2012
+Authors: Graham Anderson, <graham@andtech.eu>
+
+
+PROJECT DETAILS
+---------------
+
+OBS: https://build.opensuse.org/project/show?project=devel:languages:go
+
+Maintainers: Sascha Peilicke (saschpe),
+ Graham Anderson (andtecheu)
+
+Wiki: http://en.opensuse.org/Go
+ http://en.opensuse.org/openSUSE:Packaging_Go
+
+
+GENERAL NOTES
+-------------
+
+Go toolchain environmental variables are configured via go.sh, which is
+installed to /etc/profile.d/go.sh
+
+Packaging guidelines and an RPM spec file recipe for packaging third party Go
+libraries can be found on the openSUSE wiki:
+
+ http://en.opensuse.org/openSUSE:Packaging_Go
+
+The openSUSE go package uses the standard Go distribution toolchain, with a
+a small patchset to modify a few of the toolchain commands to suit our
+environment and packaging needs.
+
+This means that many of the standard go toolchain commands are not inside a
+users PATH, but rather are invoked and used via the "go" command. Should you
+wish to script or manually use the commands, the install location on a 64 bit
+system is /usr/lib64/go/pkg/tool/linux_amd64
+
+The "go" tool, the "godoc" document server are inside a users PATH.
+
+We currently don't support the gccgo implementation, this is not for
+any other reason than contributer and maintainer time constraints.
+
+
+GO DOCUMENTATION
+----------------
+
+As of yet, there are no man pages for the standard Go distribution toolchain,
+please see the documentation provided by the "godoc" command. Man pages are
+slated to be included in the release in future.
+
+One of the diffs from the maintained patchset adds the distro specific doc and
+source file locations of the *-doc RPM packages to the virtual filesystem of
+the "godoc" documentation server. That is to say, as long as packages follow
+the Go packaging guidelines, API and other documentation should always be
+available via the godoc server if the packages "doc" RPM is installed.
+
+
+PACKAGE INSTALL LOCATIONS
+-------------------------
+
+Go standard library packages are installed to a location in $GOROOT, which is
+defined as /usr/lib64/go on 64bit systems.
+
+Third party package binaries are installed to the default system wide
+$GOPATH entry. On 64bit systems the location /usr/lib64/go/contrib is used.
+This is specified in the macros.go RPM macro definition file that is part of
+the main Go package and is used for packaging most third party Go libraries.
+
+The reasons binary packages are installed to a GOPATH entry instead of GOROOT
+are mainly to do with how the Go toolchain prioritises and behaves with
+packages installed to the same location as the Go std library.
+
+By installing third party packages to a system-wide GOPATH entry location,
+we can ensure that no packages clobber the standard library namespace or file
+tree. Additionally we can support binary only packages, which as of Go 1.1
+will only be supported outside of the $GOROOT.
+
+There are additional benefits to this location; such as allowing users and
+developers to prioritise linking from their own user defined GOPATH, which
+defaults to $HOME/go configured via /etc/profile.d/go.sh config. This has
+particular benefit for development workflows.
+
+For Go 1.1 and beyond, building and linking with binary only pacakges will
+only be supported with the following caveat. Package source code must not
+exist in the same GOPATH segment as the binary package .a archive file.
+
+If both the binary archive (.a) and the package source are installed to the
+same GOPATH segment, then the "go build" or "go install" command will
+prioritise building the software using package sources before using package
+binary archives. A side effect of this is that is actually possible to have
+source code only third party packages.
+
+To summarise the priority of binary package linking and building:
+
+ 1. Any source files or binary packages in $GOROOT are considered first. Any
+ binary packages in $GOROOT that are considered "stale" by the build tools
+ are ignored in favour of the package source.
+
+ 2. $GOPATH is considered next for import statements. GOPATH is a colon
+ delimited list of paths. GOPATH segments are examined by the build tools
+ in a FIFO manner, left to right.
+
+ Both a system wide and a user GOPATH segment are configured by default,
+ the user GOPATH segment takes priority over the system segment to allow
+ flexibility for development workflows.
+
+ The default user GOPATH is:
+
+ GOPATH=$HOME/go:$GOROOT/contrib
+
+ The default root user GOPATH is:
+
+ GOPATH=$GOROOT/contrib
+
+ 3. For Go < 1.1, If both the source and binary archive is available for a
+ package import in the same GOPATH segment, the binary archive will take
+ precedence and will be linked during compilation.
+
+ For Go >= 1.1 If the package source is avaiable in the GOPATH segment, it
+ will always be used in preference to the binary
+
Index: gcc5-go.patch
===================================================================
--- gcc5-go.patch (added)
+++ gcc5-go.patch (revision 64)
@@ -0,0 +1,58 @@
+diff --git a/src/make.bash b/src/make.bash
+index 2531ca4..12f1aa1 100755
+--- a/src/make.bash
++++ b/src/make.bash
+@@ -112,8 +112,8 @@ echo '##### Building Go bootstrap tool.'
+ echo cmd/dist
+ export GOROOT="$(cd .. && pwd)"
+ GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
+-if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
+- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
++if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-5" ]; then
++ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-5." >&2
+ echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
+ exit 1
+ fi
+@@ -123,7 +123,7 @@ if [ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]; then
+ exit 1
+ fi
+ rm -f cmd/dist/dist
+-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
++GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go-5" build -o cmd/dist/dist ./cmd/dist
+
+ # -e doesn't propagate out of eval, so check success by hand.
+ eval $(./cmd/dist/dist env -p || echo FAIL=true)
+diff --git a/src/make.rc b/src/make.rc
+index 6016204..2223092 100755
+--- a/src/make.rc
++++ b/src/make.rc
+@@ -46,13 +46,13 @@ echo cmd/dist
+ GOROOT = `{cd .. && pwd}
+ if(! ~ $#GOROOT_BOOTSTRAP 1)
+ GOROOT_BOOTSTRAP = $home/go1.4
+-if(! test -x $GOROOT_BOOTSTRAP/bin/go){
+- echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2]
++if(! test -x $GOROOT_BOOTSTRAP/bin/go-5){
++ echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go-5.' >[1=2]
+ echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2]
+ exit bootstrap
+ }
+ rm -f cmd/dist/dist
+-GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist
++GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go-5 build -o cmd/dist/dist ./cmd/dist
+
+ eval `{./cmd/dist/dist env -9}
+ echo
+diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go
+index 20d9535..26cfb20 100644
+--- a/src/cmd/dist/buildtool.go
++++ b/src/cmd/dist/buildtool.go
+@@ -111,7 +111,7 @@ func bootstrapBuildTools() {
+ os.Setenv("GOHOSTARCH", "")
+
+ // Run Go 1.4 to build binaries.
+- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-v", "bootstrap/...")
++ run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go-5", goroot_bootstrap), "install", "-v", "bootstrap/...")
+
+ // Copy binaries into tool binary directory.
+ for _, name := range bootstrapDirs {
Index: go-1.5-build-dont-reinstall-stdlibs.patch
===================================================================
--- go-1.5-build-dont-reinstall-stdlibs.patch (added)
+++ go-1.5-build-dont-reinstall-stdlibs.patch (revision 64)
@@ -0,0 +1,33 @@
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -153,6 +153,7 @@ func init() {
+ }
+
+ // Flags set by multiple commands.
++var buildS bool // OPENSUSE -s (for packaging only)
+ var buildA bool // -a flag
+ var buildN bool // -n flag
+ var buildP = runtime.NumCPU() // -p flag
+@@ -209,6 +210,8 @@ func init() {
+ // addBuildFlags adds the flags common to the build, clean, get,
+ // install, list, run, and test commands.
+ func addBuildFlags(cmd *Command) {
++ // OPENSUSE
++ cmd.Flag.BoolVar(&buildS, "s", false, "")
+ cmd.Flag.BoolVar(&buildA, "a", false, "")
+ cmd.Flag.BoolVar(&buildN, "n", false, "")
+ cmd.Flag.IntVar(&buildP, "p", buildP, "")
+@@ -1502,6 +1505,11 @@ func (b *builder) linkShared(a *action)
+
+ // install is the action for installing a single package or executable.
+ func (b *builder) install(a *action) (err error) {
++ // OPENSUSE
++ if buildS && (a.p.Standard || a.p.ImportPath == "cmd/cgo") {
++ return nil
++ }
++
+ defer func() {
+ if err != nil && err != errPrintedOutput {
+ err = fmt.Errorf("go install %s: %v", a.p.ImportPath, err)
Index: go-1.5-install-dont-reinstall-stdlibs.patch
===================================================================
--- go-1.5-install-dont-reinstall-stdlibs.patch (added)
+++ go-1.5-install-dont-reinstall-stdlibs.patch (revision 64)
@@ -0,0 +1,18 @@
+Index: go/src/cmd/go/pkg.go
+===================================================================
+--- go.orig/src/cmd/go/pkg.go
++++ go/src/cmd/go/pkg.go
+@@ -1374,6 +1374,13 @@ func isStale(p *Package) bool {
+ return false
+ }
+
++ // openSUSE bnc#776058
++ // Only root user can reinstall a std library from a dependancy, all other
++ // users should *never* have to do this.
++ if os.Getuid() != 0 && p.Standard {
++ return false
++ }
++
+ // Time-based staleness.
+
+ built := fi.ModTime()
Index: go.gdbinit
===================================================================
--- go.gdbinit (added)
+++ go.gdbinit (revision 64)
@@ -0,0 +1 @@
+add-auto-load-safe-path /usr/lib/go/src/runtime/runtime-gdb.py
Index: go1.6.1.src.tar.gz
===================================================================
Binary files go1.6.1.src.tar.gz (revision 64) added
Index: README-openSUSE
===================================================================
--- README-openSUSE (revision 2)
+++ README-openSUSE (deleted)
@@ -1,120 +0,0 @@
-Updated: 05.05.2012
-Authors: Graham Anderson, <graham@andtech.eu>
-
-
-PROJECT DETAILS
----------------
-
-OBS: https://build.opensuse.org/project/show?project=devel:languages:go
-
-Maintainers: Sascha Peilicke (saschpe),
- Graham Anderson (andtecheu)
-
-Wiki: http://en.opensuse.org/Go
- http://en.opensuse.org/openSUSE:Packaging_Go
-
-
-GENERAL NOTES
--------------
-
-Go toolchain environmental variables are configured via go.sh, which is
-installed to /etc/profile.d/go.sh
-
-Packaging guidelines and an RPM spec file recipe for packaging third party Go
-libraries can be found on the openSUSE wiki:
-
- http://en.opensuse.org/openSUSE:Packaging_Go
-
-The openSUSE go package uses the standard Go distribution toolchain, with a
-a small patchset to modify a few of the toolchain commands to suit our
-environment and packaging needs.
-
-This means that many of the standard go toolchain commands are not inside a
-users PATH, but rather are invoked and used via the "go" command. Should you
-wish to script or manually use the commands, the install location on a 64 bit
-system is /usr/lib64/go/pkg/tool/linux_amd64
-
-The "go" tool, the "godoc" document server are inside a users PATH.
-
-We currently don't support the gccgo implementation, this is not for
-any other reason than contributer and maintainer time constraints.
-
-
-GO DOCUMENTATION
-----------------
-
-As of yet, there are no man pages for the standard Go distribution toolchain,
-please see the documentation provided by the "godoc" command. Man pages are
-slated to be included in the release in future.
-
-One of the diffs from the maintained patchset adds the distro specific doc and
-source file locations of the *-doc RPM packages to the virtual filesystem of
-the "godoc" documentation server. That is to say, as long as packages follow
-the Go packaging guidelines, API and other documentation should always be
-available via the godoc server if the packages "doc" RPM is installed.
-
-
-PACKAGE INSTALL LOCATIONS
--------------------------
-
-Go standard library packages are installed to a location in $GOROOT, which is
-defined as /usr/lib64/go on 64bit systems.
-
-Third party package binaries are installed to the default system wide
-$GOPATH entry. On 64bit systems the location /usr/lib64/go/contrib is used.
-This is specified in the macros.go RPM macro definition file that is part of
-the main Go package and is used for packaging most third party Go libraries.
-
-The reasons binary packages are installed to a GOPATH entry instead of GOROOT
-are mainly to do with how the Go toolchain prioritises and behaves with
-packages installed to the same location as the Go std library.
-
-By installing third party packages to a system-wide GOPATH entry location,
-we can ensure that no packages clobber the standard library namespace or file
-tree. Additionally we can support binary only packages, which as of Go 1.1
-will only be supported outside of the $GOROOT.
-
-There are additional benefits to this location; such as allowing users and
-developers to prioritise linking from their own user defined GOPATH, which
-defaults to $HOME/go configured via /etc/profile.d/go.sh config. This has
-particular benefit for development workflows.
-
-For Go 1.1 and beyond, building and linking with binary only pacakges will
-only be supported with the following caveat. Package source code must not
-exist in the same GOPATH segment as the binary package .a archive file.
-
-If both the binary archive (.a) and the package source are installed to the
-same GOPATH segment, then the "go build" or "go install" command will
-prioritise building the software using package sources before using package
-binary archives. A side effect of this is that is actually possible to have
-source code only third party packages.
-
-To summarise the priority of binary package linking and building:
-
- 1. Any source files or binary packages in $GOROOT are considered first. Any
- binary packages in $GOROOT that are considered "stale" by the build tools
- are ignored in favour of the package source.
-
- 2. $GOPATH is considered next for import statements. GOPATH is a colon
- delimited list of paths. GOPATH segments are examined by the build tools
- in a FIFO manner, left to right.
-
- Both a system wide and a user GOPATH segment are configured by default,
- the user GOPATH segment takes priority over the system segment to allow
- flexibility for development workflows.
-
- The default user GOPATH is:
-
- GOPATH=$HOME/go:$GOROOT/contrib
-
- The default root user GOPATH is:
-
- GOPATH=$GOROOT/contrib
-
- 3. For Go < 1.1, If both the source and binary archive is available for a
- package import in the same GOPATH segment, the binary archive will take
- precedence and will be linked during compilation.
-
- For Go >= 1.1 If the package source is avaiable in the GOPATH segment, it
- will always be used in preference to the binary
-
Index: go-1.4.2-rel.plt-alignment.patch
===================================================================
--- go-1.4.2-rel.plt-alignment.patch (revision 2)
+++ go-1.4.2-rel.plt-alignment.patch (deleted)
@@ -1,12 +0,0 @@
-Index: go/src/cmd/ld/elf.c
-===================================================================
---- go.orig/src/cmd/ld/elf.c
-+++ go/src/cmd/ld/elf.c
-@@ -1323,6 +1323,7 @@ asmbelf(vlong symo)
- sh->type = SHT_REL;
- sh->flags = SHF_ALLOC;
- sh->entsize = ELF32RELSIZE;
-+ sh->addralign = 4;
- sh->link = elfshname(".dynsym")->shnum;
- shsym(sh, linklookup(ctxt, ".rel.plt", 0));
-
Index: go-build-dont-reinstall-stdlibs.patch
===================================================================
--- go-build-dont-reinstall-stdlibs.patch (revision 2)
+++ go-build-dont-reinstall-stdlibs.patch (deleted)
@@ -1,35 +0,0 @@
-Index: go/src/cmd/go/build.go
-===================================================================
---- go.orig/src/cmd/go/build.go
-+++ go/src/cmd/go/build.go
-@@ -118,6 +118,7 @@ func init() {
- }
-
- // Flags set by multiple commands.
-+var buildS bool // OPENSUSE -s (for packaging only)
- var buildA bool // -a flag
- var buildN bool // -n flag
- var buildP = runtime.NumCPU() // -p flag
-@@ -170,6 +171,10 @@ func init() {
- // install, list, run, and test commands.
- func addBuildFlags(cmd *Command) {
- // NOTE: If you add flags here, also add them to testflag.go.
-+
-+ // OPENSUSE
-+ cmd.Flag.BoolVar(&buildS, "s", false, "")
-+
- cmd.Flag.BoolVar(&buildA, "a", false, "")
- cmd.Flag.BoolVar(&buildN, "n", false, "")
- cmd.Flag.IntVar(&buildP, "p", buildP, "")
-@@ -1070,6 +1075,11 @@ func (b *builder) getPkgConfigFlags(p *P
-
- // install is the action for installing a single package or executable.
- func (b *builder) install(a *action) (err error) {
-+ // OPENSUSE
-+ if buildS && (a.p.Standard || a.p.ImportPath == "cmd/cgo") {
-+ return nil
-+ }
-+
- defer func() {
- if err != nil && err != errPrintedOutput {
- err = fmt.Errorf("go install %s: %v", a.p.ImportPath, err)
Index: go-install-dont-reinstall-stdlibs.patch
===================================================================
--- go-install-dont-reinstall-stdlibs.patch (revision 2)
+++ go-install-dont-reinstall-stdlibs.patch (deleted)
@@ -1,18 +0,0 @@
-Index: go/src/cmd/go/pkg.go
-===================================================================
---- go.orig/src/cmd/go/pkg.go
-+++ go/src/cmd/go/pkg.go
-@@ -748,6 +748,13 @@ func isStale(p *Package, topRoot map[str
- return true
- }
-
-+ // openSUSE bnc#776058
-+ // Only root user can reinstall a std library from a dependancy, all other
-+ // users should *never* have to do this.
-+ if os.Getuid() != 0 && p.Standard {
-+ return false
-+ }
-+
- olderThan := func(file string) bool {
- fi, err := os.Stat(file)
- return err != nil || fi.ModTime().After(built)
Index: go-wiki-gadget.xml
===================================================================
--- go-wiki-gadget.xml (revision 2)
+++ go-wiki-gadget.xml (deleted)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!-- embedding gadget for the go-wiki -->
-<Module>
- <ModulePrefs title="openSUSE Build Service" />
- <Content type="url" href="http://software.opensuse.org/download/iframe?project=devel:languages:go&package=go" />
-</Module>
Index: go1.4.2.src.tar.gz
===================================================================
Binary files go1.4.2.src.tar.gz (revision 2) deleted
Index: macros.go
===================================================================
--- macros.go (revision 2)
+++ macros.go (deleted)
@@ -1,211 +0,0 @@
-# Macros for Go module building.
-#
-# Copyright: (c) 2011 Sascha Peilicke <saschpe@gmx.de>
-# Copyright: (c) 2012 Graham Anderson <graham@andtech.eu>
-# Copyright: (c) 2015 SUSE Linux GmbH
-#
-
-
-%go_ver %(LC_ALL=C rpm -q --qf '%%{epoch}:%%{version}\\n' go | sed -e 's/(none)://' -e 's/ 0:/ /' | grep -v "is not")
-%go_arch GOARCH
-%go_build_ver %(go version | sed 's/^go version //' | sed 's:\/::g' | tr -d ' ' | cut -c 1-7 )
-
-%go_dir %{_libdir}/go
-%go_sitedir %{_libdir}/go/pkg
-%go_sitearch %{_libdir}/go/pkg/linux_%{go_arch}
-%go_contribdir %{_libdir}/go/contrib/pkg/linux_%{go_arch}
-%go_contribsrcdir %{_datadir}/go/contrib/src/
-%go_tooldir %{_datadir}/go/pkg/tool/linux_%{go_arch}
-
-%go_exclusivearch \
-ExclusiveArch: %ix86 x86_64 %arm
-
-%go_provides \
-%go_exclusivearch \
-Provides: %{name}-devel = %{version} \
-Provides: %{name}-devel-static = %{version}
-
-# Prepare the expected Go package build environement.
-# We need a $GOPATH: go help gopath
-# We need a valid importpath: go help packages
-%goprep() \
-export GOPATH=%{_builddir}/go \
-if [ %# -eq 0 ]; then \
- echo "goprep: please specify a valid importpath, see: go help packages" \
- exit 1 \
-else \
- export IMPORTPATH=%1 \
-fi \
-# create the importpath and move the package there \
-pkg_dir=$(basename $PWD) \
-cd %{_builddir} \
-mkdir -p $GOPATH/src/$IMPORTPATH \
-(shopt -s dotglob; mv -- ${pkg_dir}/* $GOPATH/src/$IMPORTPATH) \
-# now link the old location to the new (for compatibility) \
-rmdir ${pkg_dir} \
-ln -s $GOPATH/src/$IMPORTPATH ${pkg_dir} \
-cd ${pkg_dir} \
-# we'll be installing packages/binaries/tools, make the targ dirs \
-install -d %{buildroot}%{go_contribdir} \
-install -d %{buildroot}%{go_tooldir} \
-install -d %{buildroot}%{_bindir} \
-%{nil}
-
-# %%gobuild macro actually performs the command "go install", but the go
-# toolchain will install to the $GOPATH which allows us then customise the final
-# install for the distro default locations.
-#
-# gobuild accepts zero or more arguments. Each argument corresponds to
-# a modifier of the importpath. If no arguments are passed, this is equivalent
-# to the following go install statement:
-#
-# go install [importpath]
-#
-# Only the first or last arguement may be ONLY the wildcard argument "..."
-# if the wildcard argument is passed then the importpath expands to all packages
-# and binaries underneath it. If the argument contains only the wildcard no further
-# arguments are considered.
-#
-# If no wildcard argument is passed, go install will be invoked on each $arg
-# subdirectory under the importpath.
-#
-# Valid importpath modifier examples:
-#
-# example: %gobuild ...
-# command: go install importpath...
-#
-# example: %gobuild /...
-# command: go install importpath/... (All subdirs NOT including importpath)
-#
-# example: %gobuild foo...
-# command: go install importpath/foo... (All subdirs INCLUDING foo)
-#
-# example: %gobuild foo ... (same as foo...)
-# command: go install importpath/foo... (All subdirs INCLUDING foo)
-#
-# example: %gobuild foo/...
-# commands: go install importpath/foo/... (All subdirs NOT including foo)
-#
-# example: %gobuild foo bar
-# commands: go install importpath/foo
-# go install importpath/bar
-#
-# example: %gobuild foo ... bar
-# commands: go install importpath/foo... (bar is ignored)
-#
-# example: %gobuild foo bar... baz
-# commands: go install importpath/foo
-# go install importpath/bar...
-# go install importpath/baz
-#
-# See: go help install, go help packages
-%gobuild() \
-export BUILDFLAGS="-s -v -p 4 -x" \
-export GOPATH=%{_builddir}/go:%{_libdir}/go/contrib \
-export GOBIN=%{_builddir}/go/bin \
-MOD="" \
-if [ %# -gt 0 ]; then \
- for mod in %*; do \
- if [ $mod == "..." ]; then \
- MOD=$MOD... \
- if [ "$WITH_FAKE_BUILDID" = "true" ] ; then \
- go install $BUILDFLAGS -ldflags "-B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" $IMPORTPATH$MOD \
- else \
- go install $BUILDFLAGS $IMPORTPATH$MOD \
- fi \
- break \
- else \
- MOD=/$mod \
- if [ "$WITH_FAKE_BUILDID" = "true" ] ; then \
- go install $BUILDFLAGS -ldflags "-B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" $IMPORTPATH$MOD \
- else \
- go install $BUILDFLAGS $IMPORTPATH$MOD \
- fi \
- fi \
- done \
-else \
- if [ "$WITH_FAKE_BUILDID" = "true" ] ; then \
- go install $BUILDFLAGS -ldflags "-B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" $IMPORTPATH \
- else \
- go install $BUILDFLAGS $IMPORTPATH \
- fi \
-fi \
-%{nil}
-
-# Install all compiled packages and binaries to the buildroot
-%goinstall() \
-export GOPATH=%{_builddir}/go \
-install -d %{buildroot}%{go_contribdir} \
-TMPPKG=%{_builddir}/go/pkg \
-if [ "$(ls -A $TMPPKG)" ]; then \
- cp -ar %{_builddir}/go/pkg/linux_%{go_arch}/* %{buildroot}%{go_contribdir} \
-fi \
-TMPBIN=%{_builddir}/go/bin \
-if [ "$(ls -A $TMPBIN)" ]; then \
- install -m755 $TMPBIN/* %{buildroot}%{_bindir} \
-fi \
-%{nil}
-
-%gofix() \
-export GOPATH=%{_builddir}/go \
-if [ %# -eq 0 ]; then \
- echo "gofix: please specify a valid importpath, see: go help fix" \
- exit 1 \
-else \
- go fix %1... \
-fi \
-%{nil}
-
-%gotest() \
-export GOPATH=%{_builddir}/go:%{_libdir}/go/contrib \
-if [ %# -eq 0 ]; then \
- echo "gotest: please specify a valid importpath, see: go help test" \
- exit 1 \
-else \
- go test -x %1... \
-fi \
-%{nil}
-
-%gosrc() \
-install -d %{buildroot}%{go_contribsrcdir} \
-cd %{_builddir}/go/src \
-find . -name "*.go" -exec install -Dm644 \{\} %{buildroot}%{go_contribsrcdir}/\{\} \\; \
-%{nil}
-
-# Template for source sub-package
-%gosrc_package(n:r:) \
-%package %{-n:-n %{-n*}-}source \
-Summary: Source codes for package %{name} \
-Group: Development/Sources \
-Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \
-%{-r:Requires: %{-r*}} \
-Provides: %{-n:%{-n*}}%{!-n:%{name}}-doc = %{version}-%{release} \
-Obsoletes: %{-n:%{-n*}}%{!-n:%{name}}-doc < %{version}-%{release} \
-%description %{-n:-n %{-n*}-}source \
-This package provides source codes for package %{name}.\
-%{nil}
-
-# backward compatibility
-%go_requires \
-%(if [ ! -f /usr/lib/rpm/golang.attr ] ; then \
-echo "Requires: go >= %go_build_ver" \
-fi) \
-%{nil}
-
-%go_recommends %{nil}
-
-%godoc \
-%gosrc \
-%{nil}
-
-# Template for doc sub-package
-%godoc_package(n:r:) \
-%package %{-n:-n %{-n*}-}doc \
-Summary: API documention for package %{name} \
-Group: Documentation/Other \
-Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \
-%{-r:Requires: %{-r*}} \
-%description %{-n:-n %{-n*}-}doc \
-This package provides API, examples and documentation \
-for package %{name}.\
-%{nil}
maintbot added go as a reviewer
Submission by someone who is not maintainer in the devel project. Please review
maintbot accepted review
accepted
MargueriteSu accepted review
MargueriteSu approved review
abergmann moved maintenance target to openSUSE:Maintenance:5067
abergmann accepted request
ok