source: projects/specs/trunk/g/golang/golang-vl.spec @ 12431

Revision 12431, 15.5 KB checked in by tomop, 4 years ago (diff)

updated 9 packages

control-center-3.30.3-2

docker-ce-19.03.9-1

docker-compose-1.26.2-1

golang-1.14.6-1

polkit-0.116-2

postfix-3.5.6-1

unbound-1.11.0-1

webkitgtk4-2.28.3-1

zabbix-5.0.2-1

Line 
1# temporalily ignore test failures
2%ifarch %{ix86} x86_64
3%bcond_without ignore_tests
4%else
5%bcond_with ignore_tests
6%endif
7
8# Define arches for PA and SA
9%global golang_arches   %{ix86} x86_64
10%global go_arches       %{golang_arches}
11
12# Where to set GOPATH for builds
13%global gopath          %{_datadir}/gocode
14
15# build ids are not currently generated:
16# https://code.google.com/p/go/issues/detail?id=5238
17#
18# also, debuginfo extraction currently fails with
19# "Failed to write file: invalid section alignment"
20%global debug_package %{nil}
21
22# we are shipping the full contents of src in the data subpackage, which
23# contains binary-like things (ELF data for tests, etc)
24%global _binaries_in_noarch_packages_terminate_build 0
25
26# Do not check any files in doc or src for requires
27#global __requires_exclude_from ^(%{_datadir}|/usr/lib)/%{name}/(doc|src)/.*$
28
29# Don't alter timestamps of especially the .a files (or else go will rebuild later)
30# Actually, don't strip at all since we are not even building debug packages and this corrupts the dwarf testdata
31%global __strip /bin/true
32
33# rpmbuild magic to keep from having meta dependency on libc.so.6
34%global __requires_exclude_from ^.*$
35%global __spec_install_post /usr/lib/rpm/check-rpaths \
36  /usr/lib/rpm/check-buildroot \
37  /usr/lib/rpm/brp-compress
38
39# Golang build options.
40
41# Buid golang using external/internal(close to cgo disabled) linking.
42%global external_linker 1
43
44# Build golang with cgo enabled/disabled(later equals more or less to internal linking).
45%global cgo_enabled 1
46
47# Use golang/gcc-go as bootstrap compiler
48%global golang_bootstrap 1
49
50# boostrap(with internal linking) using gcc-go fails due to bug in tests(https://github.com/golang/go/issues/12629)
51# make check not to fail due to it
52
53# Controls what ever we fail on failed tests
54%if %{with ignore_tests}
55%global fail_on_tests 0
56%else
57%global fail_on_tests 1
58%endif
59
60# TODO get more support for shared objects
61# Build golang shared objects for stdlib
62%ifarch x86_64
63%global shared 1
64%else
65%global shared 0
66%endif
67
68# Fedora GOROOT
69%global goroot          /usr/lib/%{name}
70
71%ifarch x86_64
72%global gohostarch  amd64
73%endif
74%ifarch %{ix86}
75%global gohostarch  386
76%endif
77
78%global go_api 1.14
79%global go_version 1.14.6
80
81Name:           golang
82Version:        %{go_version}
83Release:        1%{?_dist_release}
84Summary:        The Go Programming Language
85Summary(ja):    プログラミング言語 Go
86Group:          Development/Languages
87
88Vendor:         Project Vine
89Distribution:   Vine Linux
90
91# source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain
92License:        BSD and Public Domain
93URL:            http://golang.org/
94# pre-processed by source.sh to make Mark.Twain-Tom.Sawyer.txt free again
95Source0:        https://dl.google.com/go/go%{go_version}.src.tar.gz
96
97# The compiler is written in Go. Needs go(1.4+) compiler for build.
98BuildRequires:  golang > 1.4
99BuildRequires:  net-tools
100
101# for tests
102BuildRequires:  pcre-devel, glibc-static
103
104Provides:       go = %{version}-%{release}
105Requires:       %{name}-bin
106Requires:       %{name}-src = %{version}-%{release}
107
108# These are the only RHEL/Fedora architectures that we compile this package for
109ExclusiveArch:  %{golang_arches}
110
111Source100:      golang-gdbinit
112Source101:      golang-prelink.conf
113Source102:      macros.golang
114
115%description
116%{summary}.
117
118%package       docs
119Summary:       Golang compiler docs
120Requires:      %{name} = %{version}-%{release}
121#BuildArch:     noarch
122Obsoletes:     %{name}-docs < 1.1-4
123
124%description   docs
125%{summary}.
126
127%package       misc
128Summary:       Golang compiler miscellaneous sources
129Requires:      %{name} = %{version}-%{release}
130#BuildArch:     noarch
131
132%description   misc
133%{summary}.
134
135%package       tests
136Summary:       Golang compiler tests for stdlib
137Requires:      %{name} = %{version}-%{release}
138#BuildArch:     noarch
139
140%description   tests
141%{summary}.
142
143%package        src
144Summary:        Golang compiler source tree
145#BuildArch:      noarch
146%description    src
147%{summary}
148
149%package        bin
150Summary:        Golang core compiler tools
151Requires:       go = %{version}-%{release}
152Requires(post): %{_sbindir}/update-alternatives
153Requires(postun): %{_sbindir}/update-alternatives
154
155# We strip the meta dependency, but go does require glibc.
156# This is an odd issue, still looking for a better fix.
157Requires:       glibc
158Requires:       gcc
159%description    bin
160%{summary}
161
162# Workaround old RPM bug of symlink-replaced-with-dir failure
163%pretrans -p <lua>
164for _,d in pairs({"api", "doc", "include", "lib", "src"}) do
165  path = "%{goroot}/" .. d
166  if posix.stat(path, "type") == "link" then
167    os.remove(path)
168    posix.mkdir(path)
169  end
170end
171
172%if %{shared}
173%package        shared
174Summary:        Golang shared object libraries
175
176%description    shared
177%{summary}.
178%endif
179
180
181%debug_package
182
183
184%prep
185%setup -q -n go
186
187%build
188# bootstrap compiler GOROOT
189%if !%{golang_bootstrap}
190export GOROOT_BOOTSTRAP=/
191%else
192export GOROOT_BOOTSTRAP=%{goroot}
193%endif
194
195# set up final install location
196export GOROOT_FINAL=%{goroot}
197
198export GOHOSTOS=linux
199export GOHOSTARCH=%{gohostarch}
200
201pushd src
202# use our gcc options for this build, but store gcc as default for compiler
203export CFLAGS="$RPM_OPT_FLAGS"
204export LDFLAGS="$RPM_LD_FLAGS"
205export CC="gcc"
206export CC_FOR_TARGET="gcc"
207export GOOS=linux
208export GOARCH=%{gohostarch}
209%if !%{external_linker}
210export GO_LDFLAGS="-linkmode internal"
211%endif
212%if !%{cgo_enabled}
213export CGO_ENABLED=0
214%endif
215./make.bash --no-clean
216popd
217
218# build shared std lib
219%if %{shared}
220GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std
221%endif
222
223%install
224rm -rf $RPM_BUILD_ROOT
225
226# create the top level directories
227mkdir -p $RPM_BUILD_ROOT%{_bindir}
228mkdir -p $RPM_BUILD_ROOT%{goroot}
229
230# install everything into libdir (until symlink problems are fixed)
231# https://code.google.com/p/go/issues/detail?id=5830
232cp -apv api bin doc favicon.ico lib pkg robots.txt src misc test VERSION \
233   $RPM_BUILD_ROOT%{goroot}
234
235# bz1099206
236find $RPM_BUILD_ROOT%{goroot}/src -exec touch -r $RPM_BUILD_ROOT%{goroot}/VERSION "{}" \;
237# and level out all the built archives
238touch $RPM_BUILD_ROOT%{goroot}/pkg
239find $RPM_BUILD_ROOT%{goroot}/pkg -exec touch -r $RPM_BUILD_ROOT%{goroot}/pkg "{}" \;
240# generate the spec file ownership of this source tree and packages
241cwd=$(pwd)
242src_list=$cwd/go-src.list
243pkg_list=$cwd/go-pkg.list
244shared_list=$cwd/go-shared.list
245misc_list=$cwd/go-misc.list
246docs_list=$cwd/go-docs.list
247tests_list=$cwd/go-tests.list
248rm -f $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list
249touch $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list
250pushd $RPM_BUILD_ROOT%{goroot}
251        find src/ -type d -a \( ! -name testdata -a ! -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $src_list
252        find src/ ! -type d -a \( ! -ipath '*/testdata/*' -a ! -name '*_test*.go' \) -printf '%{goroot}/%p\n' >> $src_list
253
254        find bin/ pkg/ -type d -a ! -path '*_dynlink/*' -printf '%%%dir %{goroot}/%p\n' >> $pkg_list
255        find bin/ pkg/ ! -type d -a ! -path '*_dynlink/*' -printf '%{goroot}/%p\n' >> $pkg_list
256
257        find doc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $docs_list
258        find doc/ ! -type d -printf '%{goroot}/%p\n' >> $docs_list
259
260        find misc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $misc_list
261        find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list
262
263%if %{shared}
264        find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list
265        find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list
266%endif
267
268        find test/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list
269        find test/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list
270        find src/ -type d -a \( -name testdata -o -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $tests_list
271        find src/ ! -type d -a \( -ipath '*/testdata/*' -o -name '*_test*.go' \)  -printf '%{goroot}/%p\n' >> $tests_list
272        # this is only the zoneinfo.zip
273        find lib/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list
274        find lib/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list
275popd
276
277# remove the doc Makefile
278rm -rfv $RPM_BUILD_ROOT%{goroot}/doc/Makefile
279
280# put binaries to bindir, linked to the arch we're building,
281# leave the arch independent pieces in %{goroot}
282mkdir -p $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}
283ln -sf %{goroot}/bin/go $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/go
284ln -sf %{goroot}/bin/gofmt $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/gofmt
285
286# ensure these exist and are owned
287mkdir -p $RPM_BUILD_ROOT%{gopath}/src/github.com
288mkdir -p $RPM_BUILD_ROOT%{gopath}/src/bitbucket.org
289mkdir -p $RPM_BUILD_ROOT%{gopath}/src/code.google.com/p
290mkdir -p $RPM_BUILD_ROOT%{gopath}/src/golang.org/x
291
292# make sure these files exist and point to alternatives
293rm -f $RPM_BUILD_ROOT%{_bindir}/go
294ln -sf /etc/alternatives/go $RPM_BUILD_ROOT%{_bindir}/go
295rm -f $RPM_BUILD_ROOT%{_bindir}/gofmt
296ln -sf /etc/alternatives/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
297
298# gdbinit
299mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d
300cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang.gdb
301
302# prelink blacklist
303mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d
304cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf
305
306# rpm macros
307mkdir -p %{buildroot}
308mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm
309cp -av %{SOURCE102} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.golang
310
311
312%check
313export GOROOT=$(pwd -P)
314export PATH="$GOROOT"/bin:"$PATH"
315cd src
316
317export CC="gcc"
318export CFLAGS="$RPM_OPT_FLAGS"
319export LDFLAGS="$RPM_LD_FLAGS"
320%if !%{external_linker}
321export GO_LDFLAGS="-linkmode internal"
322%endif
323%if !%{cgo_enabled} || !%{external_linker}
324export CGO_ENABLED=0
325%endif
326
327# make sure to not timeout
328export GO_TEST_TIMEOUT_SCALE=2
329
330%if %{fail_on_tests}
331./run.bash --no-rebuild -v -v -v -k
332%else
333./run.bash --no-rebuild -v -v -v -k || :
334%endif
335cd ..
336
337
338%post bin
339%{_sbindir}/update-alternatives --install %{_bindir}/go \
340        go %{goroot}/bin/go 90 \
341        --slave %{_bindir}/gofmt gofmt %{goroot}/bin/gofmt
342
343%preun bin
344if [ $1 = 0 ]; then
345        %{_sbindir}/update-alternatives --remove go %{goroot}/bin/go
346fi
347
348
349%files
350%license LICENSE
351%doc AUTHORS CONTRIBUTORS PATENTS
352# VERSION has to be present in the GOROOT, for `go install std` to work
353%doc %{goroot}/VERSION
354%dir %{goroot}/doc
355%doc %{goroot}/doc/*
356
357# go files
358%dir %{goroot}
359%exclude %{goroot}/bin/
360%exclude %{goroot}/pkg/
361%exclude %{goroot}/src/
362%exclude %{goroot}/doc/
363%exclude %{goroot}/misc/
364%{goroot}/*
365
366# ensure directory ownership, so they are cleaned up if empty
367%dir %{gopath}
368%dir %{gopath}/src
369%dir %{gopath}/src/github.com/
370%dir %{gopath}/src/bitbucket.org/
371%dir %{gopath}/src/code.google.com/
372%dir %{gopath}/src/code.google.com/p/
373%dir %{gopath}/src/golang.org
374%dir %{gopath}/src/golang.org/x
375
376
377# gdbinit (for gdb debugging)
378%{_sysconfdir}/gdbinit.d
379
380# prelink blacklist
381%{_sysconfdir}/prelink.conf.d
382
383%{_sysconfdir}/rpm/macros.golang
384
385%files -f go-src.list src
386
387%files -f go-docs.list docs
388
389%files -f go-misc.list misc
390
391%files -f go-tests.list tests
392
393%files -f go-pkg.list bin
394%{_bindir}/go
395%{_bindir}/gofmt
396
397%if %{shared}
398%files -f go-shared.list shared
399%endif
400
401%changelog
402* Sat Jul 25 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.14.6-1
403- new upstream release.
404
405* Sat Mar 21 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.14.1-1
406- new upstream release.
407
408* Sun Dec 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.13.5-1
409- new upstream release.
410
411* Sat Nov 02 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.13.4-1
412- new upstream release.
413
414* Tue Jun 26 2018 IWAI, Masaharu <iwaim.sub@gmail.com> 1.10.3-1
415- update to 1.10.3
416- drop patches (Patch0, 212, 215)
417- export 'GO_TEST_TIMEOUT_SCALE=2' in %%check
418- add bcond for tests
419
420* Tue Jun 06 2017 IWAI, Masaharu <iwaim.sub@gmail.com> 1.8.3-1
421- update to 1.8.3
422
423* Mon Jun  5 2017 IWAI, Masaharu <iwaim.sub@gmail.com> 1.8.1-1
424- update to 1.8.1
425- remove BuildArch tags
426- drop Source1
427- drop patches
428 - remove ECC p224 patch (Patch1)
429 - X.509 patch (Patch2): upstream merged
430 - disable TestGdbPython patch (Patch213)
431 - disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups patch (Patch214)
432 - drop Patch216: upstream fixed
433- update bootstrap binary path patch (Patch212)
434
435* Mon Dec 21 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.5.2-1
436- new upstream release.
437
438* Sun Mar  8 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.2-1
439- new upstream release.
440
441* Mon Dec 15 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.2-2
442- added Group tag
443
444* Sat Feb  1 2014 IWAI, Masaharu <iwaim.sub@gmail.com> 1.2
445- initial build for Vine Linux
446- drop emacs and vim package
447
448* Fri Jan 24 2014 Vincent Batts <vbatts@redhat.com> 1.2-4
449- skip a flaky test that is sporadically failing on the build server
450
451* Thu Jan 16 2014 Vincent Batts <vbatts@redhat.com> 1.2-3
452- remove golang-godoc dependency. cyclic dependency on compiling godoc
453
454* Wed Dec 18 2013 Vincent Batts <vbatts@redhat.com> - 1.2-2
455- removing P224 ECC curve
456
457* Mon Dec 2 2013 Vincent Batts <vbatts@fedoraproject.org> - 1.2-1
458- Update to upstream 1.2 release
459- remove the pax tar patches
460
461* Tue Nov 26 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-8
462- fix the rpmspec conditional for rhel and fedora
463
464* Thu Nov 21 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-7
465- patch tests for testing on rawhide
466- let the same spec work for rhel and fedora
467
468* Wed Nov 20 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-6
469- don't symlink /usr/bin out to ../lib..., move the file
470- seperate out godoc, to accomodate the go.tools godoc
471
472* Fri Sep 20 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-5
473- Pull upstream patches for BZ#1010271
474- Add glibc requirement that got dropped because of meta dep fix
475
476* Fri Aug 30 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-4
477- fix the libc meta dependency (thanks to vbatts [at] redhat.com for the fix)
478
479* Tue Aug 27 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-3
480- Revert incorrect merged changelog
481
482* Tue Aug 27 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-2
483- This was reverted, just a placeholder changelog entry for bad merge
484
485* Tue Aug 20 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-1
486- Update to latest upstream
487
488* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-7
489- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
490
491* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 1.1.1-6
492- Perl 5.18 rebuild
493
494* Wed Jul 10 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-5
495- Blacklist testdata files from prelink
496- Again try to fix #973842
497
498* Fri Jul  5 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-4
499- Move src to libdir for now (#973842) (upstream issue https://code.google.com/p/go/issues/detail?id=5830)
500- Eliminate noarch data package to work around RPM bug (#975909)
501- Try to add runtime-gdb.py to the gdb safe-path (#981356)
502
503* Wed Jun 19 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-3
504- Use lua for pretrans (http://fedoraproject.org/wiki/Packaging:Guidelines#The_.25pretrans_scriptlet)
505
506* Mon Jun 17 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-2
507- Hopefully really fix #973842
508- Fix update from pre-1.1.1 (#974840)
509
510* Thu Jun 13 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-1
511- Update to 1.1.1
512- Fix basically useless package (#973842)
513
514* Sat May 25 2013 Dan Horák <dan[at]danny.cz> - 1.1-3
515- set ExclusiveArch
516
517* Fri May 24 2013 Adam Goode <adam@spicenitz.org> - 1.1-2
518- Fix noarch package discrepancies
519
520* Fri May 24 2013 Adam Goode <adam@spicenitz.org> - 1.1-1
521- Initial Fedora release.
522- Update to 1.1
523
524* Thu May  9 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.3.rc3
525- Update to rc3
526
527* Thu Apr 11 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.2.beta2
528- Update to beta2
529
530* Tue Apr  9 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.1.beta1
531- Initial packaging.
Note: See TracBrowser for help on using the repository browser.