-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgo.spec
182 lines (143 loc) · 5.49 KB
/
go.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
%global __os_install_post %{nil}
%define debug_package %{nil}
%undefine _missing_build_ids_terminate_build
%define _go_rel_major_minor 1.22
%define _go_rel_bugfix 5
%define _go_rel %{_go_rel_major_minor}.%{_go_rel_bugfix}
%define _go_patch 0
%if (0%{?suse_version} > 0)
Name: go%{_go_rel}
%else
%if (0%{?rhel} >= 7)
Name: golang
%else
Name: go
%endif
%endif
%if (0%{?_go_patch} > 0)
Version: %{_go_rel}.%{_go_patch}
%else
Version: %{_go_rel}
%endif
Release: 1.daos%{?dist}
Summary: The Go Programming Language
License: BSD and Public Domain
URL: http://golang.org/
Source0: https://go.dev/dl/go%{version}.linux-amd64.tar.gz
%define _fullver %{version}-%{release}
ExclusiveArch: x86_64
AutoReqProv: no
%if (0%{?suse_version} > 0)
Requires(post): update-alternatives
Requires(postun):update-alternatives
%endif
%if (0%{?rhel} > 0)
Provides: go = %{_fullver} golang-src = %{_fullver} golang-bin = %{_fullver}
Obsoletes: go < %{_fullver} golang-src < %{_fullver} golang-bin < %{_fullver}
%endif
%if (0%{?suse_version} > 0)
# Emulate the main go package
Provides: go = %{version} go-devel = go%{version} go-devel-static = go%{version} go%{_go_rel_major_minor} = %{_fullver} go%{_go_rel_major_minor}(x86-64) = %{_fullver} golang(API) = %{_go_rel_major_minor}
# Emulate the go-race sub-package
Provides: go-race = %{version} go-%{_go_rel_major_minor}-race = %{_fullver} go-%{_go_rel_major_minor}-race(x86_64) = %{_fullver}
# Emulate the go-doc sub-package
Provides: go-doc = %{version} go%{_go_rel_major_minor}-doc = %{_fullver} go%{_go_rel_major_minor}-doc(x86_64) = %{_fullver}
Obsoletes: go < %{version} go-race < %{version} go-doc < %{_fullver}
%endif
%description
Installs the precompiled Go toolchain provided at https://go.dev/dl/, replacing
any older distro-provided versions.
%prep
%setup -q -n go
%build
%install
%if (0%{?suse_version} > 0)
# update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
mkdir -p %{buildroot}%{_bindir}
touch %{buildroot}%{_sysconfdir}/alternatives/{go,gofmt}
ln -sf %{_sysconfdir}/alternatives/go %{buildroot}%{_bindir}/go
ln -sf %{_sysconfdir}/alternatives/gofmt %{buildroot}%{_bindir}/gofmt
%{__mkdir_p} %{buildroot}/%{_exec_prefix}/lib64/go/%{_go_rel}
cp -a bin %{buildroot}/%{_exec_prefix}/lib64/go/%{_go_rel}/
cp -a pkg %{buildroot}/%{_exec_prefix}/lib64/go/%{_go_rel}/
cp -a src %{buildroot}/%{_exec_prefix}/lib64/go/%{_go_rel}/
%else
%{__mkdir_p} %{buildroot}/%{_exec_prefix}
cp -a bin %{buildroot}/%{_exec_prefix}
cp -a pkg %{buildroot}/%{_exec_prefix}
cp -a src %{buildroot}/%{_exec_prefix}
%endif
%files
%if (0%{?suse_version} > 0)
%{_exec_prefix}/lib64/go/%{_go_rel}/bin/*
%{_exec_prefix}/lib64/go/%{_go_rel}/pkg/*
%{_exec_prefix}/lib64/go/%{_go_rel}/src/*
%{_bindir}/go
%{_bindir}/gofmt
%ghost %{_sysconfdir}/alternatives/go
%ghost %{_sysconfdir}/alternatives/gofmt
%else
%{_bindir}/*
%{_exec_prefix}/pkg/*
%{_exec_prefix}/src/*
%endif
%doc
%if (0%{?suse_version} > 0)
%post
update-alternatives \
--install %{_bindir}/go go %{_libdir}/go/%{version}/bin/go $((20+$(echo %{version} | cut -d. -f2))) \
--slave %{_bindir}/gofmt gofmt %{_libdir}/go/%{version}/bin/gofmt
%postun
if [ $1 -eq 0 ] ; then
update-alternatives --remove go %{_libdir}/go/%{version}/bin/go
fi
%endif
%changelog
* Fri Jul 27 2024 Tomasz Gromadzki <[email protected]> - 1.22.5-1
- Update to version 1.22.5
* Fri Jun 21 2024 Tomasz Gromadzki <[email protected]> - 1.22.4-1
- Update to version 1.22.4
* Tue May 14 2024 Tomasz Gromadzki <[email protected]> - 1.22.3-1
- Update to version 1.22.3
* Thu Jan 18 2024 Tomasz Gromadzki <[email protected]> - 1.21.6-1
- Update to version 1.21.6
* Fri Dec 08 2023 Ryon Jensen <[email protected]> - 1.21.4-1
- Update to version 1.21.4
* Tue Nov 07 2023 Brian J. Murrell <[email protected]> - 1.21.3-2
- Fix Provides: to use only the major.minor of the go release
* Mon Oct 23 2023 Lei Huang <[email protected]> - 1.21.3-1
- Update to 1.21.3
- Build for EL9
* Tue Oct 17 2023 Brian J. Murrell <[email protected]> - 1.20.3-2
- Add Obsoletes: for the EL subpackages
* Thu Apr 13 2023 Michael J. MacDonald <[email protected]> - 1.20.3-1
- Update to 1.20.3
* Thu Mar 16 2023 Michael J. MacDonald <[email protected]> - 1.20.2-1
- Update to 1.20.2
* Fri Feb 17 2023 Michael J. MacDonald <[email protected]> - 1.20.1-1
- Update to 1.20.1
* Fri Feb 03 2023 Michael J. MacDonald <[email protected]> - 1.20-1
- Update to 1.20
* Wed Jan 25 2023 Michael J. MacDonald <[email protected]> - 1.19.5-1
- Update to 1.19.5
* Tue Nov 01 2022 Michael J. MacDonald <[email protected]> - 1.19.3-1
- Update to 1.19.3
* Wed Oct 19 2022 Michael J. MacDonald <[email protected]> - 1.19.2-1
- Update to 1.19.2
* Thu Aug 11 2022 Michael J. MacDonald <[email protected]> - 1.19-1
- Update to 1.19
* Fri Jun 03 2022 Michael J. MacDonald <[email protected]> - 1.18.3-1
- Update to 1.18.3
* Fri May 13 2022 Michael J. MacDonald <[email protected]> - 1.18.2-1
- Update to 1.18.2
* Thu May 05 2022 Michael J. MacDonald <[email protected]> - 1.18.1-1
- Update to 1.18.1
* Thu Mar 17 2022 Michael J. MacDonald <[email protected]> - 1.18-1
- Update to 1.18
* Fri Mar 04 2022 David Quigley <[email protected]> - 1.17.8-1
- Bump the patch version to apply fixes for new CVEs
* Thu Feb 17 2022 Michael J. MacDonald <[email protected]> - 1.17.7-2
- adjust names per distro
* Fri Feb 11 2022 Michael J. MacDonald <[email protected]> - 1.17.7-1
- initial packaging for internal builders