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

Revision 12522, 16.2 KB checked in by tomop, 20 months ago (diff)

updated 16 packages

SDL2-2.0.14-1

gmp-6.2.1-1

gnupg2-2.2.27-1

gnutls-3.7.0-1

golang-1.15.7-1

iputils-20210202-1

libassuan-2.5.4-1

libgcrypt-1.9.1-1

libgpg-error-1.41-1

libksba-1.5.0-1

libusb1-1.0.24-1

nettle-3.7-1

npth-1.6-2

pcsc-lite-1.9.0-1

python3-3.8.7-1

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