Merge branch 'f22' into el6

This commit is contained in:
Vincent Batts 2015-09-01 13:43:23 -04:00
commit 0d7b61e3f5
12 changed files with 1396 additions and 625 deletions

6
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.rpm
/go1.1.1.src.tar.gz
/go1.1.2.src.tar.gz
/go1.2.1.src.tar.gz
@ -16,4 +17,9 @@
/go1.4beta1.src.tar.gz
/go1.4rc1.src.tar.gz
/go1.4rc2.src.tar.gz
/go1.5beta1.src.tar.gz
/golang-19087:a15f344a9efa-xattrs.tar
/go1.5beta2.src.tar.gz
/go1.5beta3.src.tar.gz
/go1.5rc1.src.tar.gz
/go1.5.src.tar.gz

View File

@ -0,0 +1,21 @@
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
index ed9502d..c2569e7 100644
--- a/src/time/zoneinfo_unix.go
+++ b/src/time/zoneinfo_unix.go
@@ -32,14 +32,14 @@ var zoneDirs = []string{
"/usr/share/zoneinfo/",
"/usr/share/lib/zoneinfo/",
"/usr/lib/locale/TZ/",
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
}
var origZoneDirs = zoneDirs
func forceZipFileForTesting(zipOnly bool) {
- zoneDirs = make([]string, len(origZoneDirs))
+ zoneDirs = make([]string, len(origZoneDirs)+1)
copy(zoneDirs, origZoneDirs)
+ zoneDirs = append(zoneDirs, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
if zipOnly {
for i := 0; i < len(zoneDirs)-1; i++ {
zoneDirs[i] = "/XXXNOEXIST"

View File

@ -0,0 +1,13 @@
diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go
index f4014b2..2c09441 100644
--- a/src/runtime/runtime-gdb_test.go
+++ b/src/runtime/runtime-gdb_test.go
@@ -38,7 +38,7 @@ func main() {
}
`
-func TestGdbPython(t *testing.T) {
+func testGdbPython(t *testing.T) {
if runtime.GOOS == "darwin" {
t.Skip("gdb does not work on darwin")
}

View File

@ -0,0 +1,13 @@
diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go
index 60d2734..b16540f 100644
--- a/src/syscall/exec_linux_test.go
+++ b/src/syscall/exec_linux_test.go
@@ -89,7 +89,7 @@ func kernelVersion(t *testing.T) (int, int) {
return major, minor
}
-func TestCloneNEWUSERAndRemapNoRootDisableSetgroups(t *testing.T) {
+func testCloneNEWUSERAndRemapNoRootDisableSetgroups(t *testing.T) {
if os.Getuid() == 0 {
t.Skip("skipping unprivileged user only test")
}

View File

@ -1,19 +0,0 @@
Index: go/include/u.h
===================================================================
--- go.orig/include/u.h
+++ go/include/u.h
@@ -38,10 +38,13 @@ extern "C" {
# define __MAKECONTEXT_V2_SOURCE 1
# endif
#endif
+#if defined __linux__ || defined __GNU__ || defined __GLIBC__
+#define _DEFAULT_SOURCE 1
+#else
#define _BSD_SOURCE 1
#define _NETBSD_SOURCE 1 /* NetBSD */
-#define _DEFAULT_SOURCE 1 /* glibc > 2.19 */
#define _SVID_SOURCE 1
+#endif
#if !defined(__APPLE__) && !defined(__OpenBSD__)
# define _XOPEN_SOURCE 1000
# define _XOPEN_SOURCE_EXTENDED 1

File diff suppressed because it is too large Load Diff

View File

@ -2,18 +2,18 @@ Index: go/src/make.bash
===================================================================
--- go.orig/src/make.bash
+++ go/src/make.bash
@@ -161,12 +161,12 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
@@ -153,12 +153,12 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
# 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

View File

@ -0,0 +1,53 @@
diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go
index be54ac4..6744fbdc 100644
--- a/src/cmd/dist/buildtool.go
+++ b/src/cmd/dist/buildtool.go
@@ -108,12 +108,20 @@ func bootstrapBuildTools() {
os.Setenv("GOBIN", "")
os.Setenv("GOOS", "")
- os.Setenv("GOHOSTOS", "")
os.Setenv("GOARCH", "")
+
+ hostos := os.Getenv("GOHOSTOS")
+ hostarch := os.Getenv("GOHOSTARCH")
+ os.Setenv("GOHOSTOS", "")
os.Setenv("GOHOSTARCH", "")
+ bingopath := pathf("%s/bin/%s_%s/go", goroot_bootstrap, hostos, hostarch)
+ if _, err := os.Stat(bingopath); os.IsNotExist(err) {
+ bingopath = pathf("%s/bin/go", goroot_bootstrap)
+ }
+
// Run Go 1.4 to build binaries.
- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-v", "bootstrap/...")
+ run(workspace, ShowOutput|CheckExit, bingopath, "install", "-v", "bootstrap/...")
// Copy binaries into tool binary directory.
for _, name := range bootstrapDirs {
diff --git a/src/make.bash b/src/make.bash
index f17648a..77f463c 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -113,12 +113,17 @@ 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/${GOHOSTOS}_${GOHOSTARCH}/go" ]; then
+ rm -f cmd/dist/dist
+ GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go" build -o cmd/dist/dist ./cmd/dist
+elif [ -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
+ rm -f cmd/dist/dist
+ GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
+else
+ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go." >&2
+ echo "ERROR: or $GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go." >&2
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
fi
-rm -f cmd/dist/dist
-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" 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)

View File

@ -1,11 +0,0 @@
--- src/os/os_test.go.orig 2014-02-20 13:14:45.543644182 -0600
+++ src/os/os_test.go 2014-02-20 13:14:55.934813622 -0600
@@ -854,7 +854,7 @@
t.Fatal(err)
}
defer r.Close()
- p, err := StartProcess("/bin/hostname", []string{"hostname"}, &ProcAttr{Files: []*File{nil, w, Stderr}})
+ p, err := StartProcess("/usr/bin/hostname", []string{"hostname"}, &ProcAttr{Files: []*File{nil, w, Stderr}})
if err != nil {
t.Fatal(err)
}

View File

@ -1 +1 @@
add-auto-load-safe-path /usr/lib/golang/src/pkg/runtime/runtime-gdb.py
add-auto-load-safe-path /usr/lib/golang/src/runtime/runtime-gdb.py

View File

@ -28,7 +28,7 @@
# let this match the macros in macros.golang
%global goroot /usr/lib/%{name}
%global gopath %{_datadir}/gocode
%global go_arches %{ix86} x86_64 %{arm}
%global go_arches %{ix86} x86_64 %{arm} aarch64
%ifarch x86_64
%global gohostarch amd64
%endif
@ -38,43 +38,53 @@
%ifarch %{arm}
%global gohostarch arm
%endif
%ifarch aarch64
%global gohostarch arm64
%endif
%global go_api 1.4
%global go_api 1.5
%global go_version 1.5
Name: golang
Version: 1.4.2
Release: 3%{?dist}
Version: 1.5
Release: 6%{?dist}
Summary: The Go Programming Language
License: BSD
URL: http://golang.org/
Source0: https://storage.googleapis.com/golang/go%{version}.src.tar.gz
Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz
# this command moved places
%if 0%{?fedora} >= 21
BuildRequires: /usr/bin/hostname
Patch210: golang-f21-hostname.patch
# Patch211 - F21+ has glibc 2.19.90 (2.20 devel)+ which deprecates
# _BSD_SOURCE and _SVID_SOURCE
Patch211: golang-1.2-BSD-SVID-SOURCE.patch
# go1.5 bootstrapping. The compiler is written in golang.
BuildRequires: golang > 1.4
BuildRequires: pcre-devel
%if 0%{?rhel} > 6 || 0%{?fedora} > 0
BuildRequires: hostname
%else
BuildRequires: /bin/hostname
BuildRequires: net-tools
%endif
# use the arch dependent path in the bootstrap
Patch212: golang-1.5-bootstrap-binary-path.patch
Provides: go = %{version}-%{release}
Requires: golang-bin
Requires: golang-src = %{version}-%{release}
Requires: %{name}-bin
Requires: %{name}-src = %{version}-%{release}
Patch0: golang-1.2-verbose-build.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1038683
Patch1: golang-1.2-remove-ECC-p224.patch
# TODO this should be removed with go1.4.3
# https://bugzilla.redhat.com/show_bug.cgi?id=1250352
Patch100: 300d9a21583e7cf0149a778a0611e76ff7c6680f.patch
Patch101: 117ddcb83d7f42d6aa72241240af99ded81118e9.patch
Patch102: 143822585e32449860e624cace9d2e521deee62e.patch
# disable TestGdbPython
# https://github.com/golang/go/issues/11214
Patch213: go1.5beta1-disable-TestGdbPython.patch
# disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups
# this is not possible in the limitied build chroot
Patch214: go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch
# we had been just removing the zoneinfo.zip, but that caused tests to fail for users that
# later run `go test -a std`. This makes it only use the zoneinfo.zip where needed in tests.
Patch215: ./go1.5-zoneinfo_testing_only.patch
# Having documentation separate was broken
Obsoletes: %{name}-docs < 1.1-4
@ -96,216 +106,74 @@ Source102: macros.golang
%description
%{summary}.
%package docs
Summary: Golang compiler docs
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
Obsoletes: %{name}-docs < 1.1-4
# Restore this package if RPM gets fixed (bug #975909)
#%package data
#Summary: Required architecture-independent files for Go
#Requires: %{name} = %{version}-%{release}
#BuildArch: noarch
#Obsoletes: %{name}-docs < 1.1-4
#
#%description data
#%{summary}.
%description docs
%{summary}.
%package misc
Summary: Golang compiler miscellaneous sources
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description misc
%{summary}.
%package tests
Summary: Golang compiler tests for stdlib
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description tests
%{summary}.
##
# the source tree
%package src
Summary: Golang compiler source tree
BuildArch: noarch
%description src
%{summary}
##
# This is the only architecture specific binary
%ifarch %{ix86}
%package pkg-bin-linux-386
Summary: Golang compiler tool for linux 386
%package bin
Summary: Golang core compiler tools
Requires: go = %{version}-%{release}
Requires: golang-pkg-linux-386 = %{version}-%{release}
Requires(post): golang-pkg-linux-386 = %{version}-%{release}
Provides: golang-bin = 386
Provides: go(API)(go) = %{go_api}
# Pre-go1.5, all arches had to be bootstrapped individually, before usable, and
# env variables to compile for the target os-arch.
# Now the host compiler needs only the GOOS and GOARCH environment variables
# set to compile for the target os-arch.
Obsoletes: %{name}-pkg-bin-linux-386 < 1.4.99
Obsoletes: %{name}-pkg-bin-linux-amd64 < 1.4.99
Obsoletes: %{name}-pkg-bin-linux-arm < 1.4.99
Obsoletes: %{name}-pkg-linux-386 < 1.4.99
Obsoletes: %{name}-pkg-linux-amd64 < 1.4.99
Obsoletes: %{name}-pkg-linux-arm < 1.4.99
Obsoletes: %{name}-pkg-darwin-386 < 1.4.99
Obsoletes: %{name}-pkg-darwin-amd64 < 1.4.99
Obsoletes: %{name}-pkg-windows-386 < 1.4.99
Obsoletes: %{name}-pkg-windows-amd64 < 1.4.99
Obsoletes: %{name}-pkg-plan9-386 < 1.4.99
Obsoletes: %{name}-pkg-plan9-amd64 < 1.4.99
Obsoletes: %{name}-pkg-freebsd-386 < 1.4.99
Obsoletes: %{name}-pkg-freebsd-amd64 < 1.4.99
Obsoletes: %{name}-pkg-freebsd-arm < 1.4.99
Obsoletes: %{name}-pkg-netbsd-386 < 1.4.99
Obsoletes: %{name}-pkg-netbsd-amd64 < 1.4.99
Obsoletes: %{name}-pkg-netbsd-arm < 1.4.99
Obsoletes: %{name}-pkg-openbsd-386 < 1.4.99
Obsoletes: %{name}-pkg-openbsd-amd64 < 1.4.99
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
# We strip the meta dependency, but go does require glibc.
# This is an odd issue, still looking for a better fix.
Requires: glibc
Requires: gcc
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
%description pkg-bin-linux-386
%description bin
%{summary}
%endif
%ifarch x86_64
%package pkg-bin-linux-amd64
Summary: Golang compiler tool for linux amd64
Requires: go = %{version}-%{release}
Requires: golang-pkg-linux-amd64 = %{version}-%{release}
Requires(post): golang-pkg-linux-amd64 = %{version}-%{release}
Provides: golang-bin = amd64
Provides: go(API)(go) = %{go_api}
# We strip the meta dependency, but go does require glibc.
# This is an odd issue, still looking for a better fix.
Requires: glibc
Requires: gcc
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
%description pkg-bin-linux-amd64
%{summary}
%endif
%ifarch %{arm}
%package pkg-bin-linux-arm
Summary: Golang compiler tool for linux arm
Requires: go = %{version}-%{release}
Requires: golang-pkg-linux-arm = %{version}-%{release}
Requires(post): golang-pkg-linux-arm = %{version}-%{release}
Provides: golang-bin = arm
Provides: go(API)(go) = %{go_api}
# We strip the meta dependency, but go does require glibc.
# This is an odd issue, still looking for a better fix.
Requires: glibc
Requires: gcc
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
%description pkg-bin-linux-arm
%{summary}
%endif
##
# architecture independent go tooling, that allows for cross
# compiling on golang supported architectures
# http://golang.org/doc/install/source#environment
%package pkg-linux-386
Summary: Golang compiler toolchain to compile for linux 386
Requires: go = %{version}-%{release}
Provides: go(API)(cgo) = %{go_api}
BuildArch: noarch
%description pkg-linux-386
%{summary}
%package pkg-linux-amd64
Summary: Golang compiler toolchain to compile for linux amd64
Requires: go = %{version}-%{release}
Provides: go(API)(cgo) = %{go_api}
BuildArch: noarch
%description pkg-linux-amd64
%{summary}
%package pkg-linux-arm
Summary: Golang compiler toolchain to compile for linux arm
Requires: go = %{version}-%{release}
Provides: go(API)(cgo) = %{go_api}
BuildArch: noarch
%description pkg-linux-arm
%{summary}
%package pkg-darwin-386
Summary: Golang compiler toolchain to compile for darwin 386
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-darwin-386
%{summary}
%package pkg-darwin-amd64
Summary: Golang compiler toolchain to compile for darwin amd64
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-darwin-amd64
%{summary}
%package pkg-windows-386
Summary: Golang compiler toolchain to compile for windows 386
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-windows-386
%{summary}
%package pkg-windows-amd64
Summary: Golang compiler toolchain to compile for windows amd64
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-windows-amd64
%{summary}
%package pkg-plan9-386
Summary: Golang compiler toolchain to compile for plan9 386
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-plan9-386
%{summary}
%package pkg-plan9-amd64
Summary: Golang compiler toolchain to compile for plan9 amd64
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-plan9-amd64
%{summary}
%package pkg-freebsd-386
Summary: Golang compiler toolchain to compile for freebsd 386
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-freebsd-386
%{summary}
%package pkg-freebsd-amd64
Summary: Golang compiler toolchain to compile for freebsd amd64
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-freebsd-amd64
%{summary}
%package pkg-freebsd-arm
Summary: Golang compiler toolchain to compile for freebsd arm
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-freebsd-arm
%{summary}
%package pkg-netbsd-386
Summary: Golang compiler toolchain to compile for netbsd 386
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-netbsd-386
%{summary}
%package pkg-netbsd-amd64
Summary: Golang compiler toolchain to compile for netbsd amd64
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-netbsd-amd64
%{summary}
%package pkg-netbsd-arm
Summary: Golang compiler toolchain to compile for netbsd arm
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-netbsd-arm
%{summary}
%package pkg-openbsd-386
Summary: Golang compiler toolchain to compile for openbsd 386
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-openbsd-386
%{summary}
%package pkg-openbsd-amd64
Summary: Golang compiler toolchain to compile for openbsd amd64
Requires: go = %{version}-%{release}
BuildArch: noarch
%description pkg-openbsd-amd64
%{summary}
## missing ./go/src/runtime/defs_openbsd_arm.h
## we'll skip this bundle for now
#%package pkg-openbsd-arm
#Summary: Golang compiler toolchain to compile for openbsd arm
#Requires: go = %{version}-%{release}
#BuildArch: noarch
#%description pkg-openbsd-arm
#%{summary}
# Workaround old RPM bug of symlink-replaced-with-dir failure
%pretrans -p <lua>
@ -317,27 +185,36 @@ for _,d in pairs({"api", "doc", "include", "lib", "src"}) do
end
end
%ifarch x86_64
%package shared
Summary: Golang shared object libraries
%description shared
%{summary}.
%endif
%prep
%setup -q -n go
%if 0%{?fedora} >= 21
%patch210 -p0
%patch211 -p1
%endif
# increase verbosity of build
%patch0 -p1
# remove the P224 curve
%patch1 -p1
# bz1250352
%patch100 -p1
%patch101 -p1
%patch102 -p1
# use the arch dependent path in the bootstrap
%patch212 -p1
# disable TestGdbPython
%patch213 -p1
# disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups
%patch214 -p1
%build
# go1.5 bootstrapping. The compiler is written in golang.
export GOROOT_BOOTSTRAP=%{goroot}
# set up final install location
export GOROOT_FINAL=%{goroot}
@ -348,25 +225,23 @@ export GOROOT_FINAL=%{goroot}
export GOHOSTOS=linux
export GOHOSTARCH=%{gohostarch}
# build for all (see http://golang.org/doc/install/source#environment)
pushd src
for goos in darwin freebsd linux netbsd openbsd plan9 windows ; do
for goarch in 386 amd64 arm ; do
if [ "${goarch}" = "arm" ] ; then
if [ "${goos}" = "darwin" -o "${goos}" = "windows" -o "${goos}" = "plan9" -o "${goos}" = "openbsd" ] ;then
continue
fi
fi
# use our gcc options for this build, but store gcc as default for compiler
CC="gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS" \
CC_FOR_TARGET="gcc" \
GOOS=${goos} \
GOARCH=${goarch} \
./make.bash --no-clean
done
done
# use our gcc options for this build, but store gcc as default for compiler
CFLAGS="$RPM_OPT_FLAGS" \
LDFLAGS="$RPM_LD_FLAGS" \
CC="gcc" \
CC_FOR_TARGET="gcc" \
GOOS=linux \
GOARCH=%{gohostarch} \
./make.bash --no-clean
popd
%ifarch x86_64
# TODO get linux/386 support for shared objects.
# golang shared objects for stdlib
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std
%endif
%install
rm -rf $RPM_BUILD_ROOT
@ -376,7 +251,7 @@ mkdir -p $RPM_BUILD_ROOT%{goroot}
# install everything into libdir (until symlink problems are fixed)
# https://code.google.com/p/go/issues/detail?id=5830
cp -apv api bin doc favicon.ico include lib pkg robots.txt src misc VERSION \
cp -apv api bin doc favicon.ico lib pkg robots.txt src misc test VERSION \
$RPM_BUILD_ROOT%{goroot}
# bz1099206
@ -387,59 +262,54 @@ find $RPM_BUILD_ROOT%{goroot}/pkg -exec touch -r $RPM_BUILD_ROOT%{goroot}/pkg "{
# generate the spec file ownership of this source tree and packages
cwd=$(pwd)
src_list=$cwd/go-src.list
rm -f $src_list
touch $src_list
pkg_list=$cwd/go-pkg.list
shared_list=$cwd/go-shared.list
misc_list=$cwd/go-misc.list
docs_list=$cwd/go-docs.list
tests_list=$cwd/go-tests.list
rm -f $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list
touch $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list
pushd $RPM_BUILD_ROOT%{goroot}
find src/ -type d -printf '%%%dir %{goroot}/%p\n' >> $src_list
find src/ ! -type d -printf '%{goroot}/%p\n' >> $src_list
find src/ -type d -a \( ! -name testdata -a ! -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $src_list
find src/ ! -type d -a \( ! -ipath '*/testdata/*' -a ! -name '*_test*.go' \) -printf '%{goroot}/%p\n' >> $src_list
find bin/ pkg/ -type d -a ! -path '*_dynlink/*' -printf '%%%dir %{goroot}/%p\n' >> $pkg_list
find bin/ pkg/ ! -type d -a ! -path '*_dynlink/*' -printf '%{goroot}/%p\n' >> $pkg_list
for goos in darwin freebsd linux netbsd openbsd plan9 windows ; do
for goarch in 386 amd64 arm ; do
if [ "${goarch}" = "arm" ] ; then
if [ "${goos}" = "darwin" -o "${goos}" = "windows" -o "${goos}" = "plan9" -o "${goos}" = "openbsd" ] ;then
continue
fi
fi
file_list=${cwd}/pkg-${goos}-${goarch}.list
rm -f $file_list
touch $file_list
find pkg/${goos}_${goarch}/ -type d -printf '%%%dir %{goroot}/%p\n' >> $file_list
find pkg/${goos}_${goarch}/ ! -type d -printf '%{goroot}/%p\n' >> $file_list
done
done
find doc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $docs_list
find doc/ ! -type d -printf '%{goroot}/%p\n' >> $docs_list
find misc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $misc_list
find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list
%ifarch x86_64
find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list
find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list
%endif
find test/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list
find test/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list
find src/ -type d -a \( -name testdata -o -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $tests_list
find src/ ! -type d -a \( -ipath '*/testdata/*' -o -name '*_test*.go' \) -printf '%{goroot}/%p\n' >> $tests_list
# this is only the zoneinfo.zip
find lib/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list
find lib/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list
popd
# remove the unnecessary zoneinfo file (Go will always use the system one first)
rm -rfv $RPM_BUILD_ROOT%{goroot}/lib/time
# remove the doc Makefile
rm -rfv $RPM_BUILD_ROOT%{goroot}/doc/Makefile
# put binaries to bindir, linked to the arch we're building,
# leave the arch independent pieces in %{goroot}
mkdir -p $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}
mv $RPM_BUILD_ROOT%{goroot}/bin/go $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/go
mv $RPM_BUILD_ROOT%{goroot}/bin/gofmt $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/gofmt
ln -sf %{goroot}/bin/go $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/go
ln -sf %{goroot}/bin/gofmt $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/gofmt
# ensure these exist and are owned
mkdir -p $RPM_BUILD_ROOT%{gopath}/src/github.com/
mkdir -p $RPM_BUILD_ROOT%{gopath}/src/bitbucket.org/
mkdir -p $RPM_BUILD_ROOT%{gopath}/src/code.google.com/
mkdir -p $RPM_BUILD_ROOT%{gopath}/src/code.google.com/p/
# remove the go and gofmt for other platforms (not used in the compile)
pushd $RPM_BUILD_ROOT%{goroot}/bin/
rm -rf darwin_* windows_* freebsd_* netbsd_* openbsd_* plan9_*
case "%{gohostarch}" in
amd64)
rm -rf linux_386 linux_arm ;;
386)
rm -rf linux_arm linux_amd64 ;;
arm)
rm -rf linux_386 linux_amd64 ;;
esac
popd
mkdir -p $RPM_BUILD_ROOT%{gopath}/src/github.com
mkdir -p $RPM_BUILD_ROOT%{gopath}/src/bitbucket.org
mkdir -p $RPM_BUILD_ROOT%{gopath}/src/code.google.com/p
mkdir -p $RPM_BUILD_ROOT%{gopath}/src/golang.org/x
# make sure these files exist and point to alternatives
rm -f $RPM_BUILD_ROOT%{_bindir}/go
@ -468,7 +338,7 @@ cp -av %{SOURCE102} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.golang
%check
export GOROOT=$(pwd -P)
export PATH="$PATH":"$GOROOT"/bin
export PATH="$GOROOT"/bin:"$PATH"
cd src
# skip using CGO for test. causes a SIGABRT on fc21 (bz1086900)
# until this test/issue is fixed
@ -478,74 +348,43 @@ cd src
# not using our 'gcc' since the CFLAGS fails crash_cgo_test.go due to unused variables
# https://code.google.com/p/go/issues/detail?id=6883
CGO_ENABLED=0 ./run.bash --no-rebuild
# XXX reenable. likely go1.5beta2 https://github.com/golang/go/commit/9adf684686bad7c6319080d0b1da8308a77b08c9
#CGO_ENABLED=0 ./run.bash --no-rebuild
CC="gcc" \
CFLAGS="$RPM_OPT_FLAGS" \
LDFLAGS="$RPM_LD_FLAGS" \
./run.bash --no-rebuild -v -k
cd ..
if [ $(go list -json std | grep Stale | wc -l) -gt 2 ] ; then
# cmd/go and cmd/gofmt show like they are stale. we can ignore
exit 1
fi
%ifarch %{ix86}
%post pkg-bin-linux-386
# since the cgo.a packaged in this rpm will be older than the other archives likely built on the ARM builder,
touch -r %{goroot}/pkg/linux_386/runtime.a %{goroot}/pkg/linux_386/runtime/cgo.a
%post bin
%{_sbindir}/update-alternatives --install %{_bindir}/go \
go %{goroot}/bin/linux_386/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_386/gofmt
go %{goroot}/bin/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/gofmt
%preun pkg-bin-linux-386
%preun bin
if [ $1 = 0 ]; then
%{_sbindir}/update-alternatives --remove go %{goroot}/bin/linux_386/go
%{_sbindir}/update-alternatives --remove go %{goroot}/bin/go
fi
%endif
%ifarch x86_64
%post pkg-bin-linux-amd64
# since the cgo.a packaged in this rpm will be older than the other archives likely built on the ARM builder,
touch -r %{goroot}/pkg/linux_amd64/runtime.a %{goroot}/pkg/linux_amd64/runtime/cgo.a
%{_sbindir}/update-alternatives --install %{_bindir}/go \
go %{goroot}/bin/linux_amd64/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_amd64/gofmt
%preun pkg-bin-linux-amd64
if [ $1 = 0 ]; then
%{_sbindir}/update-alternatives --remove go %{goroot}/bin/linux_amd64/go
fi
%endif
%ifarch %{arm}
%post pkg-bin-linux-arm
# since the cgo.a packaged in this rpm will be older than the other archives likely built on the ARM builder,
touch -r %{goroot}/pkg/linux_arm/runtime.a %{goroot}/pkg/linux_arm/runtime/cgo.a
%{_sbindir}/update-alternatives --install %{_bindir}/go \
go %{goroot}/bin/linux_arm/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_arm/gofmt
%preun pkg-bin-linux-arm
if [ $1 = 0 ]; then
%{_sbindir}/update-alternatives --remove go %{goroot}/bin/linux_arm/go
fi
%endif
%files
%doc AUTHORS CONTRIBUTORS LICENSE PATENTS
# VERSION has to be present in the GOROOT, for `go install std` to work
%doc %{goroot}/VERSION
%dir %{goroot}/doc
%doc %{goroot}/doc/*
# go files
%dir %{goroot}
%{goroot}/*
%exclude %{goroot}/VERSION
%exclude %{goroot}/bin/
%exclude %{goroot}/pkg/
%exclude %{goroot}/src/
%exclude %{goroot}/doc/
%exclude %{goroot}/misc/
%{goroot}/*
# ensure directory ownership, so they are cleaned up if empty
%dir %{gopath}
@ -554,6 +393,8 @@ fi
%dir %{gopath}/src/bitbucket.org/
%dir %{gopath}/src/code.google.com/
%dir %{gopath}/src/code.google.com/p/
%dir %{gopath}/src/golang.org
%dir %{gopath}/src/golang.org/x
# gdbinit (for gdb debugging)
@ -571,187 +412,44 @@ fi
%files -f go-src.list src
%files -f go-docs.list docs
%ifarch %{ix86}
%files pkg-bin-linux-386
%{goroot}/bin/linux_386/
# binary executables
%files -f go-misc.list misc
%files -f go-tests.list tests
%files -f go-pkg.list bin
%{_bindir}/go
%{_bindir}/gofmt
%dir %{goroot}/pkg/obj/linux_386
%{goroot}/pkg/obj/linux_386/*
%{goroot}/pkg/linux_386/runtime/cgo.a
%dir %{goroot}/pkg/tool/linux_386
%{goroot}/pkg/tool/linux_386/5a
%{goroot}/pkg/tool/linux_386/5c
%{goroot}/pkg/tool/linux_386/5g
%{goroot}/pkg/tool/linux_386/5l
%{goroot}/pkg/tool/linux_386/6a
%{goroot}/pkg/tool/linux_386/6c
%{goroot}/pkg/tool/linux_386/6g
%{goroot}/pkg/tool/linux_386/6l
%{goroot}/pkg/tool/linux_386/8a
%{goroot}/pkg/tool/linux_386/8c
%{goroot}/pkg/tool/linux_386/8g
%{goroot}/pkg/tool/linux_386/8l
%{goroot}/pkg/tool/linux_386/addr2line
%{goroot}/pkg/tool/linux_386/dist
%{goroot}/pkg/tool/linux_386/nm
%{goroot}/pkg/tool/linux_386/objdump
%{goroot}/pkg/tool/linux_386/pack
%{goroot}/pkg/tool/linux_386/pprof
%endif
%ifarch x86_64
%files pkg-bin-linux-amd64
%{goroot}/bin/linux_amd64/
# binary executables
%{_bindir}/go
%{_bindir}/gofmt
%dir %{goroot}/pkg/obj/linux_amd64
%{goroot}/pkg/obj/linux_amd64/*
%{goroot}/pkg/linux_amd64/runtime/cgo.a
%dir %{goroot}/pkg/tool/linux_amd64
%{goroot}/pkg/tool/linux_amd64/5a
%{goroot}/pkg/tool/linux_amd64/5c
%{goroot}/pkg/tool/linux_amd64/5g
%{goroot}/pkg/tool/linux_amd64/5l
%{goroot}/pkg/tool/linux_amd64/6a
%{goroot}/pkg/tool/linux_amd64/6c
%{goroot}/pkg/tool/linux_amd64/6g
%{goroot}/pkg/tool/linux_amd64/6l
%{goroot}/pkg/tool/linux_amd64/8a
%{goroot}/pkg/tool/linux_amd64/8c
%{goroot}/pkg/tool/linux_amd64/8g
%{goroot}/pkg/tool/linux_amd64/8l
%{goroot}/pkg/tool/linux_amd64/addr2line
%{goroot}/pkg/tool/linux_amd64/dist
%{goroot}/pkg/tool/linux_amd64/nm
%{goroot}/pkg/tool/linux_amd64/objdump
%{goroot}/pkg/tool/linux_amd64/pack
%{goroot}/pkg/tool/linux_amd64/pprof
%files -f go-shared.list shared
%endif
%ifarch %{arm}
%files pkg-bin-linux-arm
%{goroot}/bin/linux_arm/
# binary executables
%{_bindir}/go
%{_bindir}/gofmt
%dir %{goroot}/pkg/obj/linux_arm
%{goroot}/pkg/obj/linux_arm/*
%{goroot}/pkg/linux_arm/runtime/cgo.a
%dir %{goroot}/pkg/tool/linux_arm
%{goroot}/pkg/tool/linux_arm/5a
%{goroot}/pkg/tool/linux_arm/5c
%{goroot}/pkg/tool/linux_arm/5g
%{goroot}/pkg/tool/linux_arm/5l
%{goroot}/pkg/tool/linux_arm/6a
%{goroot}/pkg/tool/linux_arm/6c
%{goroot}/pkg/tool/linux_arm/6g
%{goroot}/pkg/tool/linux_arm/6l
%{goroot}/pkg/tool/linux_arm/8a
%{goroot}/pkg/tool/linux_arm/8c
%{goroot}/pkg/tool/linux_arm/8g
%{goroot}/pkg/tool/linux_arm/8l
%{goroot}/pkg/tool/linux_arm/addr2line
%{goroot}/pkg/tool/linux_arm/dist
%{goroot}/pkg/tool/linux_arm/nm
%{goroot}/pkg/tool/linux_arm/objdump
%{goroot}/pkg/tool/linux_arm/pack
%{goroot}/pkg/tool/linux_arm/pprof
%endif
%files pkg-linux-386 -f pkg-linux-386.list
%{goroot}/pkg/linux_386/
%ifarch %{ix86}
%exclude %{goroot}/pkg/linux_386/runtime/cgo.a
%endif
%{goroot}/pkg/tool/linux_386/cgo
%{goroot}/pkg/tool/linux_386/fix
%{goroot}/pkg/tool/linux_386/yacc
%files pkg-linux-amd64 -f pkg-linux-amd64.list
%{goroot}/pkg/linux_amd64/
%ifarch x86_64
%exclude %{goroot}/pkg/linux_amd64/runtime/cgo.a
%endif
%{goroot}/pkg/tool/linux_amd64/cgo
%{goroot}/pkg/tool/linux_amd64/fix
%{goroot}/pkg/tool/linux_amd64/yacc
%files pkg-linux-arm -f pkg-linux-arm.list
%{goroot}/pkg/linux_arm/
%ifarch %{arm}
%exclude %{goroot}/pkg/linux_arm/runtime/cgo.a
%endif
%{goroot}/pkg/tool/linux_arm/cgo
%{goroot}/pkg/tool/linux_arm/fix
%{goroot}/pkg/tool/linux_arm/yacc
%files pkg-darwin-386 -f pkg-darwin-386.list
%{goroot}/pkg/darwin_386/
%{goroot}/pkg/tool/darwin_386/
%files pkg-darwin-amd64 -f pkg-darwin-amd64.list
%{goroot}/pkg/darwin_amd64/
%{goroot}/pkg/tool/darwin_amd64/
%files pkg-windows-386 -f pkg-windows-386.list
%{goroot}/pkg/windows_386/
%{goroot}/pkg/tool/windows_386/
%files pkg-windows-amd64 -f pkg-windows-amd64.list
%{goroot}/pkg/windows_amd64/
%{goroot}/pkg/tool/windows_amd64/
%files pkg-plan9-386 -f pkg-plan9-386.list
%{goroot}/pkg/plan9_386/
%{goroot}/pkg/tool/plan9_386/
%files pkg-plan9-amd64 -f pkg-plan9-amd64.list
%{goroot}/pkg/plan9_amd64/
%{goroot}/pkg/tool/plan9_amd64/
%files pkg-freebsd-386 -f pkg-freebsd-386.list
%{goroot}/pkg/freebsd_386/
%{goroot}/pkg/tool/freebsd_386/
%files pkg-freebsd-amd64 -f pkg-freebsd-amd64.list
%{goroot}/pkg/freebsd_amd64/
%{goroot}/pkg/tool/freebsd_amd64/
%files pkg-freebsd-arm -f pkg-freebsd-arm.list
%{goroot}/pkg/freebsd_arm/
%{goroot}/pkg/tool/freebsd_arm/
%files pkg-netbsd-386 -f pkg-netbsd-386.list
%{goroot}/pkg/netbsd_386/
%{goroot}/pkg/tool/netbsd_386/
%files pkg-netbsd-amd64 -f pkg-netbsd-amd64.list
%{goroot}/pkg/netbsd_amd64/
%{goroot}/pkg/tool/netbsd_amd64/
%files pkg-netbsd-arm -f pkg-netbsd-arm.list
%{goroot}/pkg/netbsd_arm/
%{goroot}/pkg/tool/netbsd_arm/
%files pkg-openbsd-386 -f pkg-openbsd-386.list
%{goroot}/pkg/openbsd_386/
%{goroot}/pkg/tool/openbsd_386/
%files pkg-openbsd-amd64 -f pkg-openbsd-amd64.list
%{goroot}/pkg/openbsd_amd64/
%{goroot}/pkg/tool/openbsd_amd64/
## skipping for now
#%files pkg-openbsd-arm
#%{goroot}/pkg/openbsd_arm/
#%{goroot}/pkg/tool/openbsd_arm/
%changelog
* Thu Aug 27 2015 Vincent Batts <vbatts@fedoraproject.org> - 1.5-6
- starting a shared object subpackage. This will be x86_64 only until upstream supports more arches shared objects.
* Thu Aug 27 2015 Vincent Batts <vbatts@fedoraproject.org> - 1.5-5
- bz991759 gdb path fix
* Wed Aug 26 2015 Vincent Batts <vbatts@fedoraproject.org> - 1.5-4
- disable shared object until linux/386 is ironned out
- including the test/ directory for tests
* Tue Aug 25 2015 Vincent Batts <vbatts@fedoraproject.org> - 1.5-3
- bz1256910 only allow the golang zoneinfo.zip to be used in tests
- bz1166611 add golang.org/x directory
- bz1256525 include stdlib shared object. This will let other libraries and binaries
build with `go build -buildmode=shared -linkshared ...` or similar.
* Sun Aug 23 2015 Peter Robinson <pbrobinson@fedoraproject.org> 1.5-2
- Enable aarch64
- Minor cleanups
* Thu Aug 20 2015 Vincent Batts <vbatts@fedoraproject.org> - 1.5-1
- updating to go1.5
* Wed Aug 05 2015 Vincent Batts <vbatts@fedoraproject.org> - 1.4.2-3
- bz1250352

View File

@ -1,2 +1 @@
d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar
907f85c8fa765d31f7f955836fec4049 go1.4.2.src.tar.gz
3f072baece07fa42d18376419afad323 go1.5.src.tar.gz