Merge branch 'f20' into el6

This commit is contained in:
Vincent Batts 2014-08-13 18:51:41 +00:00
commit 3c45dc2a3a
2 changed files with 102 additions and 34 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
/golang-19087:a15f344a9efa-xattrs.tar
/go1.2.1.src.tar.gz
/go1.2.2.src.tar.gz
/go1.3.src.tar.gz

View File

@ -23,6 +23,9 @@
%global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \
/usr/lib/rpm/brp-compress
# allow turning this off
%{!?build_xemacs:%global build_xemacs 1}
# let this match the macros in macros.golang
%global goroot /usr/lib/%{name}
%global gopath %{_datadir}/gocode
@ -39,7 +42,7 @@
Name: golang
Version: 1.2.2
Release: 15%{?dist}
Release: 22%{?dist}
Summary: The Go Programming Language
License: BSD
@ -64,7 +67,7 @@ Requires: golang-src
BuildRequires: emacs
# xemacs on fedora only
%if 0%{?fedora}
%if 0%{?fedora} && %{build_xemacs} == 1
BuildRequires: xemacs
# xemacs-packages-extra-20130408-3 worked fine, but not the newer bump
# https://bugzilla.redhat.com/show_bug.cgi?id=1127518
@ -149,7 +152,7 @@ BuildArch: noarch
# xemacs on fedora only
%if 0%{?fedora}
%if 0%{?fedora} && %{build_xemacs} == 1
%package -n xemacs-%{name}
Summary: XEmacs add-on package for Go
Requires: xemacs(bin) >= %{_xemacs_version}
@ -176,6 +179,7 @@ BuildArch: noarch
Summary: Golang compiler tool for linux 386
Requires: go = %{version}-%{release}
Requires: golang-pkg-linux-386 = %{version}-%{release}
Requires(post): golang-pkg-linux-386 = %{version}-%{release}
Provides: golang-bin = 386
# We strip the meta dependency, but go does require glibc.
# This is an odd issue, still looking for a better fix.
@ -191,6 +195,7 @@ Requires(postun): %{_sbindir}/update-alternatives
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
# We strip the meta dependency, but go does require glibc.
# This is an odd issue, still looking for a better fix.
@ -206,6 +211,7 @@ Requires(postun): %{_sbindir}/update-alternatives
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
# We strip the meta dependency, but go does require glibc.
# This is an odd issue, still looking for a better fix.
@ -447,7 +453,7 @@ popd
cd misc
mv emacs/go-mode-load.el emacs/%{name}-init.el
# xemacs on fedora only
%if 0%{?fedora}
%if 0%{?fedora} && %{build_xemacs} == 1
cp -av emacs xemacs
%{_xemacs_bytecompile} xemacs/go-mode.el
%endif
@ -455,16 +461,6 @@ cp -av emacs xemacs
cd ..
%check
export GOROOT=$(pwd -P)
export PATH="$PATH":"$GOROOT"/bin
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
./run.bash --no-rebuild
cd ..
%install
rm -rf $RPM_BUILD_ROOT
@ -479,6 +475,34 @@ cp -apv api bin doc favicon.ico include lib pkg robots.txt src misc VERSION \
# bz1099206
find $RPM_BUILD_ROOT%{goroot}/src -exec touch -r $RPM_BUILD_ROOT%{goroot}/VERSION "{}" \;
# and level out all the built archives
touch $RPM_BUILD_ROOT%{goroot}/pkg
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
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
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
popd
# remove the unnecessary zoneinfo file (Go will always use the system one first)
rm -rfv $RPM_BUILD_ROOT%{goroot}/lib/time
@ -531,7 +555,7 @@ cp -av misc/emacs/go-mode.* $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name}
cp -av misc/emacs/%{name}-init.el $RPM_BUILD_ROOT%{_emacs_sitestartdir}
# xemacs on fedora only
%if 0%{?fedora}
%if 0%{?fedora} && %{build_xemacs} == 1
# misc/xemacs
mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitelispdir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitestartdir}
@ -566,9 +590,25 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm
cp -av %{SOURCE102} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.golang
%endif
%check
export GOROOT=$(pwd -P)
export PATH="$PATH":"$GOROOT"/bin
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
./run.bash --no-rebuild
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
%{_sbindir}/update-alternatives --install %{_bindir}/go \
go %{goroot}/bin/linux_386/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_386/gofmt
@ -581,6 +621,9 @@ fi
%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
@ -593,6 +636,9 @@ fi
%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
@ -654,14 +700,14 @@ fi
# xemacs on fedora only
%if 0%{?fedora}
%if 0%{?fedora} && %{build_xemacs} == 1
%files -n xemacs-%{name}
%doc AUTHORS CONTRIBUTORS LICENSE PATENTS
%{_xemacs_sitelispdir}/%{name}
%{_xemacs_sitestartdir}/*.el
%endif
%files src
%files -f go-src.list src
%{goroot}/src/
%ifarch %{ix86}
@ -800,7 +846,7 @@ fi
%{goroot}/src/pkg/runtime/ztime_linux_arm.c
%endif
%files pkg-linux-386
%files pkg-linux-386 -f pkg-linux-386.list
%{goroot}/pkg/linux_386/
%ifarch %{ix86}
%exclude %{goroot}/pkg/linux_386/runtime/cgo.a
@ -809,7 +855,7 @@ fi
%{goroot}/pkg/tool/linux_386/fix
%{goroot}/pkg/tool/linux_386/yacc
%files pkg-linux-amd64
%files pkg-linux-amd64 -f pkg-linux-amd64.list
%{goroot}/pkg/linux_amd64/
%ifarch x86_64
%exclude %{goroot}/pkg/linux_amd64/runtime/cgo.a
@ -818,7 +864,7 @@ fi
%{goroot}/pkg/tool/linux_amd64/fix
%{goroot}/pkg/tool/linux_amd64/yacc
%files pkg-linux-arm
%files pkg-linux-arm -f pkg-linux-arm.list
%{goroot}/pkg/linux_arm/
%ifarch %{arm}
%exclude %{goroot}/pkg/linux_arm/runtime/cgo.a
@ -827,59 +873,59 @@ fi
%{goroot}/pkg/tool/linux_arm/fix
%{goroot}/pkg/tool/linux_arm/yacc
%files pkg-darwin-386
%files pkg-darwin-386 -f pkg-darwin-386.list
%{goroot}/pkg/darwin_386/
%{goroot}/pkg/tool/darwin_386/
%files pkg-darwin-amd64
%files pkg-darwin-amd64 -f pkg-darwin-amd64.list
%{goroot}/pkg/darwin_amd64/
%{goroot}/pkg/tool/darwin_amd64/
%files pkg-windows-386
%files pkg-windows-386 -f pkg-windows-386.list
%{goroot}/pkg/windows_386/
%{goroot}/pkg/tool/windows_386/
%files pkg-windows-amd64
%files pkg-windows-amd64 -f pkg-windows-amd64.list
%{goroot}/pkg/windows_amd64/
%{goroot}/pkg/tool/windows_amd64/
%files pkg-plan9-386
%files pkg-plan9-386 -f pkg-plan9-386.list
%{goroot}/pkg/plan9_386/
%{goroot}/pkg/tool/plan9_386/
%files pkg-plan9-amd64
%files pkg-plan9-amd64 -f pkg-plan9-amd64.list
%{goroot}/pkg/plan9_amd64/
%{goroot}/pkg/tool/plan9_amd64/
%files pkg-freebsd-386
%files pkg-freebsd-386 -f pkg-freebsd-386.list
%{goroot}/pkg/freebsd_386/
%{goroot}/pkg/tool/freebsd_386/
%files pkg-freebsd-amd64
%files pkg-freebsd-amd64 -f pkg-freebsd-amd64.list
%{goroot}/pkg/freebsd_amd64/
%{goroot}/pkg/tool/freebsd_amd64/
%files pkg-freebsd-arm
%files pkg-freebsd-arm -f pkg-freebsd-arm.list
%{goroot}/pkg/freebsd_arm/
%{goroot}/pkg/tool/freebsd_arm/
%files pkg-netbsd-386
%files pkg-netbsd-386 -f pkg-netbsd-386.list
%{goroot}/pkg/netbsd_386/
%{goroot}/pkg/tool/netbsd_386/
%files pkg-netbsd-amd64
%files pkg-netbsd-amd64 -f pkg-netbsd-amd64.list
%{goroot}/pkg/netbsd_amd64/
%{goroot}/pkg/tool/netbsd_amd64/
%files pkg-netbsd-arm
%files pkg-netbsd-arm -f pkg-netbsd-arm.list
%{goroot}/pkg/netbsd_arm/
%{goroot}/pkg/tool/netbsd_arm/
%files pkg-openbsd-386
%files pkg-openbsd-386 -f pkg-openbsd-386.list
%{goroot}/pkg/openbsd_386/
%{goroot}/pkg/tool/openbsd_386/
%files pkg-openbsd-amd64
%files pkg-openbsd-amd64 -f pkg-openbsd-amd64.list
%{goroot}/pkg/openbsd_amd64/
%{goroot}/pkg/tool/openbsd_amd64/
@ -890,6 +936,27 @@ fi
%changelog
* Wed Aug 13 2014 Vincent Batts <vbatts@fedoraproject.org> - 1.2.2-22
- more work to get cgo.a timestamps to line up, due to build-env
* Wed Aug 13 2014 Vincent Batts <vbatts@fedoraproject.org> - 1.2.2-21
- touch cgo.a regardless
* Wed Aug 13 2014 Vincent Batts <vbatts@fedoraproject.org> - 1.2.2-20
- rpm dependency ordering for %%post
* Tue Aug 12 2014 Vincent Batts <vbatts@fedoraproject.org> - 1.2.2-19
- finally check for a Stale cgo in a %%post
* Tue Aug 12 2014 Vincent Batts <vbatts@fedoraproject.org> - 1.2.2-18
- explicitly list all the files and directories for the packages trees
* Tue Aug 12 2014 Vincent Batts <vbatts@fedoraproject.org> - 1.2.2-17
- explicitly list all the files and directories of the src tree, to preserve timestamps
* Mon Aug 11 2014 Vincent Batts <vbatts@fedoraproject.org> - 1.2.2-16
- touch all the built archives to be the same
* Mon Aug 11 2014 Vincent Batts <vbatts@fedoraproject.org> - 1.2.2-15
- make golang-src 'noarch' again, since that was not a fix, and takes up more space