-
Notifications
You must be signed in to change notification settings - Fork 567
/
Copy pathgolang-1.16.spec
242 lines (186 loc) · 7.69 KB
/
golang-1.16.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
%global goroot /usr/lib/golang
%global gopath %{_datadir}/gocode
%ifarch aarch64
%global gohostarch arm64
%else
%global gohostarch amd64
%endif
%define debug_package %{nil}
%define __strip /bin/true
# rpmbuild magic to keep from having meta dependency on libc.so.6
%define _use_internal_dependency_generator 0
%define __find_requires %{nil}
Summary: Go
Name: golang
Version: 1.16.15
Release: 2%{?dist}
License: BSD
Vendor: Microsoft Corporation
Distribution: Mariner
Group: System Environment/Security
URL: https://golang.org
Source0: https://golang.org/dl/go%{version}.src.tar.gz
Source1: https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz
Patch0: go14_bootstrap_aarch64.patch
# Patch for CVE-2021-29923 is available upstream in v1.17
Patch1: CVE-2021-29923.patch
Patch2: CVE-2022-24675.patch
Obsoletes: %{name} < %{version}
Provides: %{name} = %{version}
%description
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
%prep
# Setup go 1.4 bootstrap source
tar xf %{SOURCE1} --no-same-owner
patch -Np1 --ignore-whitespace < %{_topdir}/SOURCES/go14_bootstrap_aarch64.patch
mv -v go go-bootstrap
# Setup go source and patch
%setup -q -n go
%patch1 -p1
%patch2 -p1
%build
# Build go 1.4 bootstrap
pushd %{_topdir}/BUILD/go-bootstrap/src
CGO_ENABLED=0 ./make.bash
popd
mv -v %{_topdir}/BUILD/go-bootstrap /usr/lib/golang
export GOROOT=/usr/lib/golang
# Build current go version
export GOHOSTOS=linux
export GOHOSTARCH=%{gohostarch}
export GOROOT_BOOTSTRAP=%{goroot}
export GOROOT="`pwd`"
export GOPATH=%{gopath}
export GOROOT_FINAL=%{_bindir}/go
rm -f %{gopath}/src/runtime/*.c
pushd src
./make.bash --no-clean
popd
%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{goroot}
cp -R api bin doc favicon.ico lib pkg robots.txt src misc VERSION %{buildroot}%{goroot}
# remove the unnecessary zoneinfo file (Go will always use the system one first)
rm -rfv %{buildroot}%{goroot}/lib/time
# remove the 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 %{buildroot}%{goroot}/bin/linux_%{gohostarch}
ln -sfv ../go %{buildroot}%{goroot}/bin/linux_%{gohostarch}/go
ln -sfv ../gofmt %{buildroot}%{goroot}/bin/linux_%{gohostarch}/gofmt
ln -sfv %{goroot}/bin/gofmt %{buildroot}%{_bindir}/gofmt
ln -sfv %{goroot}/bin/go %{buildroot}%{_bindir}/go
# ensure these exist and are owned
mkdir -p %{buildroot}%{gopath}/src/github.com/
mkdir -p %{buildroot}%{gopath}/src/bitbucket.org/
mkdir -p %{buildroot}%{gopath}/src/code.google.com/p/
install -vdm755 %{buildroot}%{_sysconfdir}/profile.d
cat >> %{buildroot}%{_sysconfdir}/profile.d/go-exports.sh <<- "EOF"
export GOROOT=%{goroot}
export GOPATH=%{_datadir}/gocode
export GOHOSTOS=linux
export GOHOSTARCH=%{gohostarch}
export GOOS=linux
EOF
%post -p /sbin/ldconfig
%postun
/sbin/ldconfig
if [ $1 -eq 0 ]; then
#This is uninstall
rm %{_sysconfdir}/profile.d/go-exports.sh
rm -rf /opt/go
exit 0
fi
%files
%defattr(-,root,root)
%license LICENSE
%exclude %{goroot}/src/*.rc
%exclude %{goroot}/include/plan9
%{_sysconfdir}/profile.d/go-exports.sh
%{goroot}/*
%{gopath}/src
%exclude %{goroot}/src/pkg/debug/dwarf/testdata
%exclude %{goroot}/src/pkg/debug/elf/testdata
%{_bindir}/*
%changelog
* Fri Apr 29 2022 Suresh Babu Chalamalasetty <[email protected]> - 1.16.15-2
- Fix for CVE-2022-24675.
* Thu Mar 17 2022 Muhammad Falak <[email protected]> - 1.16.15-1
- Bump version to 1.16.15 to address CVE-2022-24921
* Fri Feb 18 2022 Thomas Crain <[email protected]> - 1.16.14-1
- Upgrade to version 1.16.14 to resolve CVE-2022-23806, CVE-2022-23772, CVE-2022-23773
* Thu Feb 17 2022 Andrew Phelps <[email protected]> - 1.16.12-2
- Use _topdir instead of hard-coded value /usr/src/mariner
* Tue Jan 18 2022 Henry Li <[email protected]> - 1.16.12-1
- Upgrade to version 1.16.12 to resolve CVE-2021-44716
* Thu Nov 11 2021 Nick Samson <[email protected]> - 1.16.10-1
- Updated to version 1.16.10 to fix CVE-2021-41771 and CVE-2021-41772
* Mon Nov 01 2021 Thomas Crain <[email protected]> - 1.16.9-1
- Updated to version 1.16.9 to fix CVE-2021-38297, CVE-2021-39293
* Fri Aug 06 2021 Nicolas Guibourge <[email protected]> - 1.16.7-1
- Updated to version 1.16.7 and fix CVE-2021-29923
* Tue Jun 08 2021 Henry Beberman <[email protected]> - 1.15.13-1
- Updated to version 1.15.13 to fix CVE-2021-33194 and CVE-2021-31525
* Mon Apr 26 2021 Nicolas Guibourge <[email protected]> - 1.15.11-1
- Updated to version 1.15.11 to fix CVE-2021-27918
* Wed Feb 03 2021 Andrew Phelps <[email protected]> - 1.15.7-1
- Updated to version 1.15.7 to fix CVE-2021-3114
* Mon Nov 23 2020 Henry Beberman <[email protected]> - 1.15.5-1
- Updated to version 1.15.5
* Fri Oct 30 2020 Thomas Crain <[email protected]> - 1.13.15-2
- Patch CVE-2020-24553
* Tue Sep 08 2020 Nicolas Ontiveros <[email protected]> - 1.13.15-1
- Updated to version 1.13.15, which fixes CVE-2020-14039 and CVE-2020-16845.
* Sun May 24 2020 Mateusz Malisz <[email protected]> - 1.13.11-1
- Updated to version 1.13.11
* Sat May 09 2020 Nick Samson <[email protected]> - 1.12.5-7
- Added %%license line automatically
* Thu Apr 30 2020 Emre Girgin <[email protected]> - 1.12.5-6
- Renaming go to golang
* Thu Apr 23 2020 Nicolas Ontiveros <[email protected]> - 1.12.5-5
- Fix CVE-2019-14809.
* Fri Mar 27 2020 Andrew Phelps <[email protected]> - 1.12.5-4
- Support building standalone by adding go 1.4 bootstrap.
* Thu Feb 27 2020 Henry Beberman <[email protected]> - 1.12.5-3
- Remove meta dependency on libc.so.6
* Thu Feb 6 2020 Andrew Phelps <[email protected]> - 1.12.5-2
- Remove ExtraBuildRequires
* Tue Sep 03 2019 Mateusz Malisz <[email protected]> - 1.12.5-1
- Initial CBL-Mariner import from Photon (license: Apache2).
* Mon Jan 21 2019 Bo Gan <[email protected]> - 1.9.7-1
- Update to 1.9.7
* Wed Oct 24 2018 Alexey Makhalov <[email protected]> - 1.9.4-3
- Use extra build requires
* Mon Apr 02 2018 Dheeraj Shetty <[email protected]> - 1.9.4-2
- Fix for CVE-2018-7187
* Thu Mar 15 2018 Xiaolin Li <[email protected]> - 1.9.4-1
- Update to golang release v1.9.4
* Tue Nov 14 2017 Alexey Makhalov <[email protected]> - 1.9.1-2
- Aarch64 support
* Wed Nov 01 2017 Vinay Kulkarni <[email protected]> - 1.9.1-1
- Update to golang release v1.9.1
* Wed May 31 2017 Xiaolin Li <[email protected]> - 1.8.1-2
- Remove mercurial from buildrequires and requires.
* Tue Apr 11 2017 Danut Moraru <[email protected]> - 1.8.1-1
- Update Golang to version 1.8.1, updated patch0
* Wed Dec 28 2016 Xiaolin Li <[email protected]> - 1.7.4-1
- Updated Golang to 1.7.4.
* Thu Oct 06 2016 ChangLee <[email protected]> - 1.6.3-2
- Modified %check
* Wed Jul 27 2016 Anish Swaminathan <[email protected]> - 1.6.3-1
- Update Golang to version 1.6.3 - fixes CVE 2016-5386
* Fri Jul 8 2016 Harish Udaiya Kumar <[email protected]> - 1.6.2-1
- Updated the Golang to version 1.6.2
* Thu Jun 2 2016 Priyesh Padmavilasom <[email protected]> - 1.4.2-5
- Fix script syntax
* Tue May 24 2016 Priyesh Padmavilasom <[email protected]> - 1.4.2-4
- GA - Bump release of all rpms
* Thu May 05 2016 Kumar Kaushik <[email protected]> - 1.4.2-3
- Handling upgrade scenario pre/post/un scripts.
* Wed Dec 09 2015 Anish Swaminathan <[email protected]> - 1.4.2-2
- Edit post script.
* Mon Aug 03 2015 Vinay Kulkarni <[email protected]> - 1.4.2-1
- Update to golang release version 1.4.2
* Fri Oct 17 2014 Divya Thaluru <[email protected]> - 1.3.3-1
- Initial build. First version