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

Revision 12320, 15.3 KB checked in by tomop, 4 years ago (diff)

updated 18 packages

clamav-0.102.2-1

dhcpcd-8.1.1-1

dovecot-2.3.9.3-1

golang-1.13.5-1

llvm-9.0.1-1

libjpeg-turbo-2.0.4-1

libserf-1.3.9-2

libxml2-2.9.10-2

mariadb-10.4.12-1

nodejs-12.16.0-1

php-ext-clearsilver-0.4-15

php73-7.3.14-1

python-pillow-6.2.2-1

rust-1.40.0-1

spamassassin-3.4.4-1

sqlite3-3.31.1-1

squid-4.10-1

sudo-1.8.31-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.13
79%global go_version 1.13.5
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* Sun Dec 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.13.5-1
399- new upstream release.
400
401* Sat Nov 02 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.13.4-1
402- new upstream release.
403
404* Tue Jun 26 2018 IWAI, Masaharu <iwaim.sub@gmail.com> 1.10.3-1
405- update to 1.10.3
406- drop patches (Patch0, 212, 215)
407- export 'GO_TEST_TIMEOUT_SCALE=2' in %%check
408- add bcond for tests
409
410* Tue Jun 06 2017 IWAI, Masaharu <iwaim.sub@gmail.com> 1.8.3-1
411- update to 1.8.3
412
413* Mon Jun  5 2017 IWAI, Masaharu <iwaim.sub@gmail.com> 1.8.1-1
414- update to 1.8.1
415- remove BuildArch tags
416- drop Source1
417- drop patches
418 - remove ECC p224 patch (Patch1)
419 - X.509 patch (Patch2): upstream merged
420 - disable TestGdbPython patch (Patch213)
421 - disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups patch (Patch214)
422 - drop Patch216: upstream fixed
423- update bootstrap binary path patch (Patch212)
424
425* Mon Dec 21 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.5.2-1
426- new upstream release.
427
428* Sun Mar  8 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.2-1
429- new upstream release.
430
431* Mon Dec 15 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.2-2
432- added Group tag
433
434* Sat Feb  1 2014 IWAI, Masaharu <iwaim.sub@gmail.com> 1.2
435- initial build for Vine Linux
436- drop emacs and vim package
437
438* Fri Jan 24 2014 Vincent Batts <vbatts@redhat.com> 1.2-4
439- skip a flaky test that is sporadically failing on the build server
440
441* Thu Jan 16 2014 Vincent Batts <vbatts@redhat.com> 1.2-3
442- remove golang-godoc dependency. cyclic dependency on compiling godoc
443
444* Wed Dec 18 2013 Vincent Batts <vbatts@redhat.com> - 1.2-2
445- removing P224 ECC curve
446
447* Mon Dec 2 2013 Vincent Batts <vbatts@fedoraproject.org> - 1.2-1
448- Update to upstream 1.2 release
449- remove the pax tar patches
450
451* Tue Nov 26 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-8
452- fix the rpmspec conditional for rhel and fedora
453
454* Thu Nov 21 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-7
455- patch tests for testing on rawhide
456- let the same spec work for rhel and fedora
457
458* Wed Nov 20 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-6
459- don't symlink /usr/bin out to ../lib..., move the file
460- seperate out godoc, to accomodate the go.tools godoc
461
462* Fri Sep 20 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-5
463- Pull upstream patches for BZ#1010271
464- Add glibc requirement that got dropped because of meta dep fix
465
466* Fri Aug 30 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-4
467- fix the libc meta dependency (thanks to vbatts [at] redhat.com for the fix)
468
469* Tue Aug 27 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-3
470- Revert incorrect merged changelog
471
472* Tue Aug 27 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-2
473- This was reverted, just a placeholder changelog entry for bad merge
474
475* Tue Aug 20 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-1
476- Update to latest upstream
477
478* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-7
479- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
480
481* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 1.1.1-6
482- Perl 5.18 rebuild
483
484* Wed Jul 10 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-5
485- Blacklist testdata files from prelink
486- Again try to fix #973842
487
488* Fri Jul  5 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-4
489- Move src to libdir for now (#973842) (upstream issue https://code.google.com/p/go/issues/detail?id=5830)
490- Eliminate noarch data package to work around RPM bug (#975909)
491- Try to add runtime-gdb.py to the gdb safe-path (#981356)
492
493* Wed Jun 19 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-3
494- Use lua for pretrans (http://fedoraproject.org/wiki/Packaging:Guidelines#The_.25pretrans_scriptlet)
495
496* Mon Jun 17 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-2
497- Hopefully really fix #973842
498- Fix update from pre-1.1.1 (#974840)
499
500* Thu Jun 13 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-1
501- Update to 1.1.1
502- Fix basically useless package (#973842)
503
504* Sat May 25 2013 Dan Horák <dan[at]danny.cz> - 1.1-3
505- set ExclusiveArch
506
507* Fri May 24 2013 Adam Goode <adam@spicenitz.org> - 1.1-2
508- Fix noarch package discrepancies
509
510* Fri May 24 2013 Adam Goode <adam@spicenitz.org> - 1.1-1
511- Initial Fedora release.
512- Update to 1.1
513
514* Thu May  9 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.3.rc3
515- Update to rc3
516
517* Thu Apr 11 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.2.beta2
518- Update to beta2
519
520* Tue Apr  9 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.1.beta1
521- Initial packaging.
Note: See TracBrowser for help on using the repository browser.