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

Revision 12346, 15.4 KB checked in by tomop, 4 years ago (diff)

updated 14 packages

ca-certificates-2020.2.40-1

dmidecode-3.2-1

dnsmasq-2.80-2

golang-1.14.1-1

gthumb-3.8.3-1

haveged-1.9.8-1

iw-5.4-1

liblockfile-1.14-6

libnl3-3.5.0-1

libvisio-0.1.7-2

mailx-8.1.2.20180807-1

strace-5.5-1

tzdata-2019c-1

zlib-1.2.11-2

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.1
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%prep
181%setup -q -n go
182
183%build
184# bootstrap compiler GOROOT
185%if !%{golang_bootstrap}
186export GOROOT_BOOTSTRAP=/
187%else
188export GOROOT_BOOTSTRAP=%{goroot}
189%endif
190
191# set up final install location
192export GOROOT_FINAL=%{goroot}
193
194export GOHOSTOS=linux
195export GOHOSTARCH=%{gohostarch}
196
197pushd src
198# use our gcc options for this build, but store gcc as default for compiler
199export CFLAGS="$RPM_OPT_FLAGS"
200export LDFLAGS="$RPM_LD_FLAGS"
201export CC="gcc"
202export CC_FOR_TARGET="gcc"
203export GOOS=linux
204export GOARCH=%{gohostarch}
205%if !%{external_linker}
206export GO_LDFLAGS="-linkmode internal"
207%endif
208%if !%{cgo_enabled}
209export CGO_ENABLED=0
210%endif
211./make.bash --no-clean
212popd
213
214# build shared std lib
215%if %{shared}
216GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std
217%endif
218
219%install
220rm -rf $RPM_BUILD_ROOT
221
222# create the top level directories
223mkdir -p $RPM_BUILD_ROOT%{_bindir}
224mkdir -p $RPM_BUILD_ROOT%{goroot}
225
226# install everything into libdir (until symlink problems are fixed)
227# https://code.google.com/p/go/issues/detail?id=5830
228cp -apv api bin doc favicon.ico lib pkg robots.txt src misc test VERSION \
229   $RPM_BUILD_ROOT%{goroot}
230
231# bz1099206
232find $RPM_BUILD_ROOT%{goroot}/src -exec touch -r $RPM_BUILD_ROOT%{goroot}/VERSION "{}" \;
233# and level out all the built archives
234touch $RPM_BUILD_ROOT%{goroot}/pkg
235find $RPM_BUILD_ROOT%{goroot}/pkg -exec touch -r $RPM_BUILD_ROOT%{goroot}/pkg "{}" \;
236# generate the spec file ownership of this source tree and packages
237cwd=$(pwd)
238src_list=$cwd/go-src.list
239pkg_list=$cwd/go-pkg.list
240shared_list=$cwd/go-shared.list
241misc_list=$cwd/go-misc.list
242docs_list=$cwd/go-docs.list
243tests_list=$cwd/go-tests.list
244rm -f $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list
245touch $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list
246pushd $RPM_BUILD_ROOT%{goroot}
247        find src/ -type d -a \( ! -name testdata -a ! -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $src_list
248        find src/ ! -type d -a \( ! -ipath '*/testdata/*' -a ! -name '*_test*.go' \) -printf '%{goroot}/%p\n' >> $src_list
249
250        find bin/ pkg/ -type d -a ! -path '*_dynlink/*' -printf '%%%dir %{goroot}/%p\n' >> $pkg_list
251        find bin/ pkg/ ! -type d -a ! -path '*_dynlink/*' -printf '%{goroot}/%p\n' >> $pkg_list
252
253        find doc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $docs_list
254        find doc/ ! -type d -printf '%{goroot}/%p\n' >> $docs_list
255
256        find misc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $misc_list
257        find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list
258
259%if %{shared}
260        find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list
261        find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list
262%endif
263
264        find test/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list
265        find test/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list
266        find src/ -type d -a \( -name testdata -o -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $tests_list
267        find src/ ! -type d -a \( -ipath '*/testdata/*' -o -name '*_test*.go' \)  -printf '%{goroot}/%p\n' >> $tests_list
268        # this is only the zoneinfo.zip
269        find lib/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list
270        find lib/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list
271popd
272
273# remove the doc Makefile
274rm -rfv $RPM_BUILD_ROOT%{goroot}/doc/Makefile
275
276# put binaries to bindir, linked to the arch we're building,
277# leave the arch independent pieces in %{goroot}
278mkdir -p $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}
279ln -sf %{goroot}/bin/go $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/go
280ln -sf %{goroot}/bin/gofmt $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/gofmt
281
282# ensure these exist and are owned
283mkdir -p $RPM_BUILD_ROOT%{gopath}/src/github.com
284mkdir -p $RPM_BUILD_ROOT%{gopath}/src/bitbucket.org
285mkdir -p $RPM_BUILD_ROOT%{gopath}/src/code.google.com/p
286mkdir -p $RPM_BUILD_ROOT%{gopath}/src/golang.org/x
287
288# make sure these files exist and point to alternatives
289rm -f $RPM_BUILD_ROOT%{_bindir}/go
290ln -sf /etc/alternatives/go $RPM_BUILD_ROOT%{_bindir}/go
291rm -f $RPM_BUILD_ROOT%{_bindir}/gofmt
292ln -sf /etc/alternatives/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
293
294# gdbinit
295mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d
296cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang.gdb
297
298# prelink blacklist
299mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d
300cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf
301
302# rpm macros
303mkdir -p %{buildroot}
304mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm
305cp -av %{SOURCE102} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.golang
306
307
308%check
309export GOROOT=$(pwd -P)
310export PATH="$GOROOT"/bin:"$PATH"
311cd src
312
313export CC="gcc"
314export CFLAGS="$RPM_OPT_FLAGS"
315export LDFLAGS="$RPM_LD_FLAGS"
316%if !%{external_linker}
317export GO_LDFLAGS="-linkmode internal"
318%endif
319%if !%{cgo_enabled} || !%{external_linker}
320export CGO_ENABLED=0
321%endif
322
323# make sure to not timeout
324export GO_TEST_TIMEOUT_SCALE=2
325
326%if %{fail_on_tests}
327./run.bash --no-rebuild -v -v -v -k
328%else
329./run.bash --no-rebuild -v -v -v -k || :
330%endif
331cd ..
332
333
334%post bin
335%{_sbindir}/update-alternatives --install %{_bindir}/go \
336        go %{goroot}/bin/go 90 \
337        --slave %{_bindir}/gofmt gofmt %{goroot}/bin/gofmt
338
339%preun bin
340if [ $1 = 0 ]; then
341        %{_sbindir}/update-alternatives --remove go %{goroot}/bin/go
342fi
343
344
345%files
346%license LICENSE
347%doc AUTHORS CONTRIBUTORS PATENTS
348# VERSION has to be present in the GOROOT, for `go install std` to work
349%doc %{goroot}/VERSION
350%dir %{goroot}/doc
351%doc %{goroot}/doc/*
352
353# go files
354%dir %{goroot}
355%exclude %{goroot}/bin/
356%exclude %{goroot}/pkg/
357%exclude %{goroot}/src/
358%exclude %{goroot}/doc/
359%exclude %{goroot}/misc/
360%{goroot}/*
361
362# ensure directory ownership, so they are cleaned up if empty
363%dir %{gopath}
364%dir %{gopath}/src
365%dir %{gopath}/src/github.com/
366%dir %{gopath}/src/bitbucket.org/
367%dir %{gopath}/src/code.google.com/
368%dir %{gopath}/src/code.google.com/p/
369%dir %{gopath}/src/golang.org
370%dir %{gopath}/src/golang.org/x
371
372
373# gdbinit (for gdb debugging)
374%{_sysconfdir}/gdbinit.d
375
376# prelink blacklist
377%{_sysconfdir}/prelink.conf.d
378
379%{_sysconfdir}/rpm/macros.golang
380
381%files -f go-src.list src
382
383%files -f go-docs.list docs
384
385%files -f go-misc.list misc
386
387%files -f go-tests.list tests
388
389%files -f go-pkg.list bin
390%{_bindir}/go
391%{_bindir}/gofmt
392
393%if %{shared}
394%files -f go-shared.list shared
395%endif
396
397%changelog
398* Sat Mar 21 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.14.1-1
399- new upstream release.
400
401* Sun Dec 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.13.5-1
402- new upstream release.
403
404* Sat Nov 02 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.13.4-1
405- new upstream release.
406
407* Tue Jun 26 2018 IWAI, Masaharu <iwaim.sub@gmail.com> 1.10.3-1
408- update to 1.10.3
409- drop patches (Patch0, 212, 215)
410- export 'GO_TEST_TIMEOUT_SCALE=2' in %%check
411- add bcond for tests
412
413* Tue Jun 06 2017 IWAI, Masaharu <iwaim.sub@gmail.com> 1.8.3-1
414- update to 1.8.3
415
416* Mon Jun  5 2017 IWAI, Masaharu <iwaim.sub@gmail.com> 1.8.1-1
417- update to 1.8.1
418- remove BuildArch tags
419- drop Source1
420- drop patches
421 - remove ECC p224 patch (Patch1)
422 - X.509 patch (Patch2): upstream merged
423 - disable TestGdbPython patch (Patch213)
424 - disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups patch (Patch214)
425 - drop Patch216: upstream fixed
426- update bootstrap binary path patch (Patch212)
427
428* Mon Dec 21 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.5.2-1
429- new upstream release.
430
431* Sun Mar  8 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.2-1
432- new upstream release.
433
434* Mon Dec 15 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.2-2
435- added Group tag
436
437* Sat Feb  1 2014 IWAI, Masaharu <iwaim.sub@gmail.com> 1.2
438- initial build for Vine Linux
439- drop emacs and vim package
440
441* Fri Jan 24 2014 Vincent Batts <vbatts@redhat.com> 1.2-4
442- skip a flaky test that is sporadically failing on the build server
443
444* Thu Jan 16 2014 Vincent Batts <vbatts@redhat.com> 1.2-3
445- remove golang-godoc dependency. cyclic dependency on compiling godoc
446
447* Wed Dec 18 2013 Vincent Batts <vbatts@redhat.com> - 1.2-2
448- removing P224 ECC curve
449
450* Mon Dec 2 2013 Vincent Batts <vbatts@fedoraproject.org> - 1.2-1
451- Update to upstream 1.2 release
452- remove the pax tar patches
453
454* Tue Nov 26 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-8
455- fix the rpmspec conditional for rhel and fedora
456
457* Thu Nov 21 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-7
458- patch tests for testing on rawhide
459- let the same spec work for rhel and fedora
460
461* Wed Nov 20 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-6
462- don't symlink /usr/bin out to ../lib..., move the file
463- seperate out godoc, to accomodate the go.tools godoc
464
465* Fri Sep 20 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-5
466- Pull upstream patches for BZ#1010271
467- Add glibc requirement that got dropped because of meta dep fix
468
469* Fri Aug 30 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-4
470- fix the libc meta dependency (thanks to vbatts [at] redhat.com for the fix)
471
472* Tue Aug 27 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-3
473- Revert incorrect merged changelog
474
475* Tue Aug 27 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-2
476- This was reverted, just a placeholder changelog entry for bad merge
477
478* Tue Aug 20 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-1
479- Update to latest upstream
480
481* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-7
482- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
483
484* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 1.1.1-6
485- Perl 5.18 rebuild
486
487* Wed Jul 10 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-5
488- Blacklist testdata files from prelink
489- Again try to fix #973842
490
491* Fri Jul  5 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-4
492- Move src to libdir for now (#973842) (upstream issue https://code.google.com/p/go/issues/detail?id=5830)
493- Eliminate noarch data package to work around RPM bug (#975909)
494- Try to add runtime-gdb.py to the gdb safe-path (#981356)
495
496* Wed Jun 19 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-3
497- Use lua for pretrans (http://fedoraproject.org/wiki/Packaging:Guidelines#The_.25pretrans_scriptlet)
498
499* Mon Jun 17 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-2
500- Hopefully really fix #973842
501- Fix update from pre-1.1.1 (#974840)
502
503* Thu Jun 13 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-1
504- Update to 1.1.1
505- Fix basically useless package (#973842)
506
507* Sat May 25 2013 Dan Horák <dan[at]danny.cz> - 1.1-3
508- set ExclusiveArch
509
510* Fri May 24 2013 Adam Goode <adam@spicenitz.org> - 1.1-2
511- Fix noarch package discrepancies
512
513* Fri May 24 2013 Adam Goode <adam@spicenitz.org> - 1.1-1
514- Initial Fedora release.
515- Update to 1.1
516
517* Thu May  9 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.3.rc3
518- Update to rc3
519
520* Thu Apr 11 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.2.beta2
521- Update to beta2
522
523* Tue Apr  9 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.1.beta1
524- Initial packaging.
Note: See TracBrowser for help on using the repository browser.