From 7fe1dd8d0eebab12962a83f3e133f4df4cc3b78b Mon Sep 17 00:00:00 2001 From: DengXiewei Date: Fri, 14 Apr 2023 10:50:44 +0800 Subject: [PATCH 1/2] Remove the useless obsoletes Make the description clearer Signed-off-by: DengXiewei --- golang.spec | 376 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 217 insertions(+), 159 deletions(-) diff --git a/golang.spec b/golang.spec index 1d4a80a..cec693a 100644 --- a/golang.spec +++ b/golang.spec @@ -1,12 +1,6 @@ -%define anolis_release 1 - -%bcond_with bootstrap -%ifarch aarch64 -%bcond_without ignore_tests -%else -%bcond_with ignore_tests -%endif +%define anolis_release 2 +# Disable debuginfo packages %global debug_package %{nil} %global _binaries_in_noarch_packages_terminate_build 0 @@ -17,47 +11,43 @@ # Actually, don't strip at all since we are not even building debug packages and this corrupts the dwarf testdata %global __strip /bin/true +# Set goroot golibdir path +%global golibdir %{_libdir}/golang +%global goroot /usr/lib/%{name} + +# This macro may not always be defined, ensure it is +%{!?gopath: %global gopath %{_datadir}/gocode} + # rpmbuild magic to keep from having meta dependency on libc.so.6 %define _use_internal_dependency_generator 0 %define __find_requires %{nil} %global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \ /usr/lib/rpm/brp-compress -%global golibdir %{_libdir}/golang - -# This macro may not always be defined, ensure it is -%{!?gopath: %global gopath %{_datadir}/gocode} - -# Golang build options. +#### Golang build options. +# Build golang with cgo enabled/disabled(later equals more or less to internal linking). +%bcond_without cgo # Build golang using external/internal(close to cgo disabled) linking. -%global external_linker 1 - -# Build golang with cgo enabled/disabled(later equals more or less to internal linking). -%global cgo_enabled 1 +%bcond_without external_linker # Use golang/gcc-go as bootstrap compiler -%if %{with bootstrap} -%global golang_bootstrap 0 -%else -%global golang_bootstrap 1 -%endif +%bcond_without golang_bootstrap # Controls what ever we fail on failed tests -%if %{with ignore_tests} -%global fail_on_tests 0 +%ifarch aarch64 +%bcond_with fail_on_tests %else -%global fail_on_tests 1 +%bcond_without fail_on_tests %endif # Build golang shared objects for stdlib -%global shared 1 +%bcond_without shared # Pre build std lib with -race enabled # Disabled due to 1.20 new cache usage, see 1.20 upstream release notes -%global race 0 +%bcond_with race -%global goroot /usr/lib/%{name} %ifarch x86_64 %global gohostarch amd64 @@ -73,28 +63,28 @@ %global go_api 1.20 %global go_patch 3 -%global go_version %{go_api}%{?go_patch:.%{go_patch}} -%global go_source %{go_api}%{?go_patch:.%{go_patch}} - Name: golang -Version: %{go_version} +Version: %{go_api}%{?go_patch:.%{go_patch}} Release: %{anolis_release}%{?dist} Summary: The Go Programming Language License: BSD and Public Domain URL: https://go.dev -Source0: https://go.dev/dl/go%{go_source}.src.tar.gz +Source0: https://go.dev/dl/go%{go_api}%{?go_patch:.%{go_patch}}.src.tar.gz # make possible to override default traceback level at build time by setting build tag rpm_crashtraceback Source1: anolis.go # The compiler is written in Go. Needs go(1.4+) compiler for build. -%if !%{golang_bootstrap} +%if !%{with golang_bootstrap} BuildRequires: gcc-go >= 5 %else BuildRequires: golang > 1.4 %endif BuildRequires: hostname # for tests -BuildRequires: pcre-devel, glibc-static, perl-interpreter, procps-ng +BuildRequires: pcre-devel +BuildRequires: glibc-static +BuildRequires: perl-interpreter +BuildRequires: procps-ng Provides: go = %{version}-%{release} @@ -118,30 +108,38 @@ Requires: %{name}-src = %{version}-%{release} Patch3: 0001-cmd-go-use-aliyun-proxy-and-disable-sumdb.patch Patch4: 0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch -# Having documentation separate was broken -Obsoletes: %{name}-docs < 1.1 - -# RPM can't handle symlink -> dir with subpackages, so merge back -Obsoletes: %{name}-data < 1.1.1 - -# go1.4 deprecates a few packages -Obsoletes: %{name}-vim < 1.4 -Obsoletes: emacs-%{name} < 1.4 - Source100: golang-gdbinit %description -%{summary}. -Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. +The Go programming language is an open source project to make programmers more productive. + +Go is expressive, concise, clean, and efficient. Its concurrency mechanisms +make it easy to write programs that get the most out of multicore and networked +machines, while its novel type system enables flexible and modular program +construction. + +Go compiles quickly to machine code yet has the convenience of garbage +collection and the power of run-time reflection. It's a fast, statically typed, +compiled language that feels like a dynamically typed, interpreted language. %package docs Summary: Golang compiler docs Requires: %{name} = %{version}-%{release} BuildArch: noarch -Obsoletes: %{name}-docs < 1.1 %description docs -%{summary}. +The Go programming language is an open source project to make programmers more productive. + +Go is expressive, concise, clean, and efficient. Its concurrency mechanisms +make it easy to write programs that get the most out of multicore and networked +machines, while its novel type system enables flexible and modular program +construction. + +Go compiles quickly to machine code yet has the convenience of garbage +collection and the power of run-time reflection. It's a fast, statically typed, +compiled language that feels like a dynamically typed, interpreted language. + +This package includes compiler documents of Go. %package misc Summary: Golang compiler miscellaneous sources @@ -149,7 +147,18 @@ Requires: %{name} = %{version}-%{release} BuildArch: noarch %description misc -%{summary}. +The Go programming language is an open source project to make programmers more productive. + +Go is expressive, concise, clean, and efficient. Its concurrency mechanisms +make it easy to write programs that get the most out of multicore and networked +machines, while its novel type system enables flexible and modular program +construction. + +Go compiles quickly to machine code yet has the convenience of garbage +collection and the power of run-time reflection. It's a fast, statically typed, +compiled language that feels like a dynamically typed, interpreted language. + +This package includes misc of Go. %package tests Summary: Golang compiler tests for stdlib @@ -157,47 +166,41 @@ Requires: %{name} = %{version}-%{release} BuildArch: noarch %description tests -%{summary}. +The Go programming language is an open source project to make programmers more productive. + +Go is expressive, concise, clean, and efficient. Its concurrency mechanisms +make it easy to write programs that get the most out of multicore and networked +machines, while its novel type system enables flexible and modular program +construction. + +Go compiles quickly to machine code yet has the convenience of garbage +collection and the power of run-time reflection. It's a fast, statically typed, +compiled language that feels like a dynamically typed, interpreted language. + +This package includes compiler tests for stdlib of Go. %package src Summary: Golang compiler source tree BuildArch: noarch %description src -%{summary} +The Go programming language is an open source project to make programmers more productive. + +Go is expressive, concise, clean, and efficient. Its concurrency mechanisms +make it easy to write programs that get the most out of multicore and networked +machines, while its novel type system enables flexible and modular program +construction. + +Go compiles quickly to machine code yet has the convenience of garbage +collection and the power of run-time reflection. It's a fast, statically typed, +compiled language that feels like a dynamically typed, interpreted language. + +This package includes compiler source tree of Go. %package bin Summary: Golang core compiler tools # Some distributions refer to this package by this name Provides: %{name}-go = %{version}-%{release} Requires: go = %{version}-%{release} -# 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 - -Obsoletes: golang-vet < 0-12.1 -Obsoletes: golang-cover < 0-12.1 - Requires(post): %{_sbindir}/update-alternatives Requires(preun): %{_sbindir}/update-alternatives @@ -208,7 +211,18 @@ Requires: gcc Recommends: git, subversion, mercurial %description bin -%{summary}. +The Go programming language is an open source project to make programmers more productive. + +Go is expressive, concise, clean, and efficient. Its concurrency mechanisms +make it easy to write programs that get the most out of multicore and networked +machines, while its novel type system enables flexible and modular program +construction. + +Go compiles quickly to machine code yet has the convenience of garbage +collection and the power of run-time reflection. It's a fast, statically typed, +compiled language that feels like a dynamically typed, interpreted language. + +This package includes core compiler tools of Go. # Workaround old RPM bug of symlink-replaced-with-dir failure %pretrans -p @@ -220,22 +234,44 @@ for _,d in pairs({"api", "doc", "include", "lib", "src"}) do end end -%if %{shared} +%if %{with shared} %package shared Summary: Golang shared object libraries %description shared -%{summary}. +The Go programming language is an open source project to make programmers more productive. + +Go is expressive, concise, clean, and efficient. Its concurrency mechanisms +make it easy to write programs that get the most out of multicore and networked +machines, while its novel type system enables flexible and modular program +construction. + +Go compiles quickly to machine code yet has the convenience of garbage +collection and the power of run-time reflection. It's a fast, statically typed, +compiled language that feels like a dynamically typed, interpreted language. + +This package includes shared object libraries of Go. %endif -%if %{race} +%if %{with race} %package race Summary: Golang std library with -race enabled Requires: %{name} = %{version}-%{release} %description race -%{summary}. +The Go programming language is an open source project to make programmers more productive. + +Go is expressive, concise, clean, and efficient. Its concurrency mechanisms +make it easy to write programs that get the most out of multicore and networked +machines, while its novel type system enables flexible and modular program +construction. + +Go compiles quickly to machine code yet has the convenience of garbage +collection and the power of run-time reflection. It's a fast, statically typed, +compiled language that feels like a dynamically typed, interpreted language. + +This package includes std library with -race enabled of Go. %endif %prep @@ -250,7 +286,7 @@ cat /proc/cpuinfo cat /proc/meminfo # bootstrap compiler GOROOT -%if !%{golang_bootstrap} +%if !%{with golang_bootstrap} export GOROOT_BOOTSTRAP=/ %else export GOROOT_BOOTSTRAP=%{goroot} @@ -270,44 +306,44 @@ export CC="gcc" export CC_FOR_TARGET="gcc" export GOOS=linux export GOARCH=%{gohostarch} -%if !%{external_linker} +%if !%{with external_linker} export GO_LDFLAGS="-linkmode internal" %endif -%if !%{cgo_enabled} +%if !%{with cgo} export CGO_ENABLED=0 %endif ./make.bash --no-clean -v popd # build shared std lib -%if %{shared} +%if %{with shared} GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared -v -x std %endif -%if %{race} +%if %{with race} GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race -v -x std %endif %install echo "== 1 ==" -rm -rf $RPM_BUILD_ROOT +rm -rf %{buildroot} # remove GC build cache rm -rf pkg/obj/go-build/* # create the top level directories -mkdir -p $RPM_BUILD_ROOT%{_bindir} -mkdir -p $RPM_BUILD_ROOT%{goroot} +mkdir -p %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{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 lib pkg src misc test VERSION \ - $RPM_BUILD_ROOT%{goroot} + %{buildroot}%{goroot} echo "== 2 ==" # bz1099206 -find $RPM_BUILD_ROOT%{goroot}/src -exec touch -r $RPM_BUILD_ROOT%{goroot}/VERSION "{}" \; +find %{buildroot}%{goroot}/src -exec touch -r %{buildroot}%{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 "{}" \; +touch %{buildroot}%{goroot}/pkg +find %{buildroot}%{goroot}/pkg -exec touch -r %{buildroot}%{goroot}/pkg "{}" \; # generate the spec file ownership of this source tree and packages cwd=$(pwd) src_list=$cwd/go-src.list @@ -319,21 +355,29 @@ 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 $race_list touch $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list $race_list -pushd $RPM_BUILD_ROOT%{goroot} +pushd %{buildroot}%{goroot} echo "== 3 ==" - 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/*' -a ! -path '*_race/*' -printf '%%%dir %{goroot}/%p\n' >> $pkg_list - find bin/ pkg/ ! -type d -a ! -path '*_dynlink/*' -a ! -path '*_race/*' -printf '%{goroot}/%p\n' >> $pkg_list - - 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 - -%if %{shared} + 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/*' -a ! -path '*_race/*' \ + -printf '%%%dir %{goroot}/%p\n' >> $pkg_list + find bin/ pkg/ ! -type d -a ! -path '*_dynlink/*' -a ! -path '*_race/*' \ + -printf '%{goroot}/%p\n' >> $pkg_list + + 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 + +%if %{with shared} echo "== 4 ==" mkdir -p %{buildroot}/%{_libdir}/ mkdir -p %{buildroot}/%{golibdir}/ @@ -347,52 +391,60 @@ echo "== 4 ==" echo "%%{golibdir}/$(basename $file)" >> $shared_list done - find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list - find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list + find pkg/*_dynlink/ -type d \ + -printf '%%%dir %{goroot}/%p\n' >> $shared_list + find pkg/*_dynlink/ ! -type d \ + -printf '%{goroot}/%p\n' >> $shared_list %endif echo "== 5 ==" -%if %{race} - - find pkg/*_race/ -type d -printf '%%%dir %{goroot}/%p\n' >> $race_list - find pkg/*_race/ ! -type d -printf '%{goroot}/%p\n' >> $race_list - +%if %{with race} + find pkg/*_race/ -type d \ + -printf '%%%dir %{goroot}/%p\n' >> $race_list + find pkg/*_race/ ! -type d \ + -printf '%{goroot}/%p\n' >> $race_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 + 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 + find lib/ -type d \ + -printf '%%%dir %{goroot}/%p\n' >> $tests_list + find lib/ ! -type d \ + -printf '%{goroot}/%p\n' >> $tests_list popd echo "== 6 ==" # remove the doc Makefile -rm -rfv $RPM_BUILD_ROOT%{goroot}/doc/Makefile +rm -rfv %{buildroot}%{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} -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 +mkdir -p %{buildroot}%{goroot}/bin/linux_%{gohostarch} +ln -sf %{goroot}/bin/go %{buildroot}%{goroot}/bin/linux_%{gohostarch}/go +ln -sf %{goroot}/bin/gofmt %{buildroot}%{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/p -mkdir -p $RPM_BUILD_ROOT%{gopath}/src/golang.org/x +mkdir -p %{buildroot}%{gopath}/src/github.com \ + %{buildroot}%{gopath}/src/bitbucket.org \ + %{buildroot}%{gopath}/src/code.google.com/p \ + %{buildroot}%{gopath}/src/golang.org/x echo "== 7 ==" # make sure these files exist and point to alternatives -rm -f $RPM_BUILD_ROOT%{_bindir}/go -ln -sf /etc/alternatives/go $RPM_BUILD_ROOT%{_bindir}/go -rm -f $RPM_BUILD_ROOT%{_bindir}/gofmt -ln -sf /etc/alternatives/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt +rm -f %{buildroot}%{_bindir}/go +ln -sf /etc/alternatives/go %{buildroot}%{_bindir}/go +rm -f %{buildroot}%{_bindir}/gofmt +ln -sf /etc/alternatives/gofmt %{buildroot}%{_bindir}/gofmt # gdbinit -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d -cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang.gdb +mkdir -p %{buildroot}%{_sysconfdir}/gdbinit.d +cp -av %{SOURCE100} %{buildroot}%{_sysconfdir}/gdbinit.d/golang.gdb echo "== END OF INSTALL ==" @@ -404,10 +456,10 @@ cd src export CC="gcc" export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" -%if !%{external_linker} +%if !%{with external_linker} export GO_LDFLAGS="-linkmode internal" %endif -%if !%{cgo_enabled} || !%{external_linker} +%if !%{with cgo} || !%{with external_linker} export CGO_ENABLED=0 %endif # workaround for https://github.com/golang/go/issues/39466 until it gests fixed @@ -420,7 +472,7 @@ export CGO_ENABLED=0 # make sure to not timeout export GO_TEST_TIMEOUT_SCALE=2 -%if %{fail_on_tests} +%if %{with fail_on_tests} ./run.bash --no-rebuild -v -v -v -k %else ./run.bash --no-rebuild -v -v -v -k || : @@ -428,13 +480,16 @@ export GO_TEST_TIMEOUT_SCALE=2 cd .. %post bin -%{_sbindir}/update-alternatives --install %{_bindir}/go \ +%{_sbindir}/update-alternatives \ + --install %{_bindir}/go \ go %{goroot}/bin/go 90 \ - --slave %{_bindir}/gofmt gofmt %{goroot}/bin/gofmt + --slave %{_bindir}/gofmt \ + gofmt %{goroot}/bin/gofmt %preun bin if [ $1 = 0 ]; then - %{_sbindir}/update-alternatives --remove go %{goroot}/bin/go + %{_sbindir}/update-alternatives \ + --remove go %{goroot}/bin/go fi %files @@ -448,43 +503,46 @@ fi %{goroot}/api/ %{goroot}/lib/time/ +# gdbinit (for gdb debugging) +%{_sysconfdir}/gdbinit.d + # ensure directory ownership, so they are cleaned up if empty %dir %{gopath} %dir %{gopath}/src -%dir %{gopath}/src/github.com/ %dir %{gopath}/src/bitbucket.org/ %dir %{gopath}/src/code.google.com/ %dir %{gopath}/src/code.google.com/p/ +%dir %{gopath}/src/github.com/ %dir %{gopath}/src/golang.org %dir %{gopath}/src/golang.org/x - -# gdbinit (for gdb debugging) -%{_sysconfdir}/gdbinit.d +%files bin -f go-pkg.list +%{_bindir}/go +%{_bindir}/gofmt +%{goroot}/bin/linux_%{gohostarch}/go +%{goroot}/bin/linux_%{gohostarch}/gofmt %files src -f go-src.list -%files docs -f go-docs.list - %files misc -f go-misc.list %files tests -f go-tests.list -%files bin -f go-pkg.list -%{_bindir}/go -%{_bindir}/gofmt -%{goroot}/bin/linux_%{gohostarch}/go -%{goroot}/bin/linux_%{gohostarch}/gofmt - -%if %{shared} +%if %{with shared} %files shared -f go-shared.list %endif -%if %{race} +%if %{with race} %files race -f go-race.list %endif +%files docs -f go-docs.list + %changelog +* Thu Apr 13 2023 DengXiewei - 1.20.3-2 +- Remove the useless obsoletes +- Make the description clearer + * Thu Apr 06 2023 Funda Wang - 1.20.3-1 - New version 1.20.3 - Disable race package due go 1.20 new feature -- Gitee From b96611a819f3f7a367293b3d2c9bf7c22b723650 Mon Sep 17 00:00:00 2001 From: DengXiewei Date: Sat, 15 Apr 2023 10:24:03 +0800 Subject: [PATCH 2/2] adjust bootstrap Signed-off-by: DengXiewei --- golang.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/golang.spec b/golang.spec index cec693a..006c970 100644 --- a/golang.spec +++ b/golang.spec @@ -32,7 +32,7 @@ %bcond_without external_linker # Use golang/gcc-go as bootstrap compiler -%bcond_without golang_bootstrap +%bcond_with bootstrap # Controls what ever we fail on failed tests %ifarch aarch64 @@ -74,7 +74,7 @@ Source0: https://go.dev/dl/go%{go_api}%{?go_patch:.%{go_patch}}.src.tar.g Source1: anolis.go # The compiler is written in Go. Needs go(1.4+) compiler for build. -%if !%{with golang_bootstrap} +%if %{with bootstrap} BuildRequires: gcc-go >= 5 %else BuildRequires: golang > 1.4 @@ -286,7 +286,7 @@ cat /proc/cpuinfo cat /proc/meminfo # bootstrap compiler GOROOT -%if !%{with golang_bootstrap} +%if %{with bootstrap} export GOROOT_BOOTSTRAP=/ %else export GOROOT_BOOTSTRAP=%{goroot} -- Gitee