2 # - allow disabling tests (currently bcond exists just for showing which are test deps)
3 # - add verbose build output (currently dummy bcond)
4 # - setup GOMAXPROCS=2 from _smp_mflags
5 # - fix CC containing spaces (ccache)
6 # - check if hg use at build time can be dropped
9 %bcond_without tests # build without tests
10 %bcond_without verbose # verbose build (V=1)
12 Summary: Go compiler and tools
13 Summary(pl.UTF-8): Kompilator języka Go i narzędzia
18 Group: Development/Languages
19 #Source0Download: https://code.google.com/p/go/downloads/list
20 Source0: https://go.googlecode.com/files/go%{version}.src.tar.gz
21 # Source0-md5: 705feb2246c8ddaf820d7e171f1430c5
22 Patch0: ca-certs.patch
23 URL: http://golang.org/
25 BuildRequires: rpm-pythonprov
27 BuildRequires: hostname
30 Requires: ca-certificates
31 ExclusiveArch: %{ix86} %{x8664} %{arm}
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 %define _enable_debug_packages 0
35 %define no_install_post_strip 1
36 %define no_install_post_chrpath 1
37 %define _noautoreqfiles %{_libdir}/%{name}/src
39 %define _vimdatadir %{_datadir}/vim
49 Go is an open source programming environment that makes it easy to
50 build simple, reliable, and efficient software.
52 %description -l pl.UTF-8
53 Go to mające otwarte źródła środowisko do programowania, pozwalające
54 na łatwe tworzenie prostych, pewnych i wydajnych programów.
57 Summary: Source code of go
58 Summary(pl.UTF-8): Kod źródłowy go
60 %if "%{_rpmversion}" >= "5"
67 %description source -l pl.UTF-8
71 Summary: Manual for go
72 Summary(fr.UTF-8): Documentation pour go
73 Summary(it.UTF-8): Documentazione di go
74 Summary(pl.UTF-8): Podręcznik dla go
76 %if "%{_rpmversion}" >= "5"
83 %description doc -l fr.UTF-8
84 Documentation pour go.
86 %description doc -l it.UTF-8
89 %description doc -l pl.UTF-8
92 %package -n vim-syntax-%{name}
93 Summary: Go syntax files for Vim
94 Summary(pl.UTF-8): Pliki składni Go dla Vima
95 Group: Applications/Editors
96 Requires: vim-rt >= 4:7.2.170
97 %if "%{_rpmversion}" >= "5"
101 %description -n vim-syntax-%{name}
102 Go syntax files for vim.
104 %description -n vim-syntax-%{name} -l pl.UTF-8
105 Pliki składni Go dla Vima.
107 %package -n emacs-%{name}
108 Summary: Go mode for Emacs
109 Summary(pl.UTF-8): Tryb Go dla Emacsa
110 Group: Applications/Editors
111 %if "%{_rpmversion}" >= "5"
115 %description -n emacs-%{name}
118 %description -n emacs-%{name} -l pl.UTF-8
126 %{__sed} -i -e 's,/usr/bin/awk,/bin/awk,' src/cmd/gc/bisonerrors
129 %{__rm} src/pkg/net/multicast_test.go
133 export GOROOT_FINAL=%{_libdir}/%{name}
136 export GOBIN=$GOROOT/bin
137 export GOARCH=%{GOARCH}
139 export MAKE="%{__make}"
141 export CC="${CC#ccache }"
143 export PATH="$PATH:$GOBIN"
148 # optflags for go tools build
149 nflags="\"$(echo '%{rpmcflags}' | sed -e 's/^[ ]*//;s/[ ]*$//;s/[ ]\+/ /g' -e 's/ /\",\"/g')\""
150 %{__sed} -i -e "s/\"-O2\"/$nflags/" src/cmd/dist/build.c
151 # NOTE: optflags used in gcc calls from go compiler are in src/cmd/go/build.go
161 rm -rf $RPM_BUILD_ROOT
162 GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name}
164 install -d $RPM_BUILD_ROOT{%{_bindir},%{_usrsrc}/%{name}-%{version}} \
167 cp -a pkg include lib bin $GOROOT
168 cp -a src/pkg src/cmd $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}
169 cp -a misc/cgo $GOROOT/misc
171 ln -sf %{_libdir}/%{name}/bin/go $RPM_BUILD_ROOT%{_bindir}/go
172 ln -sf %{_libdir}/%{name}/bin/godoc $RPM_BUILD_ROOT%{_bindir}/godoc
173 ln -sf %{_libdir}/%{name}/bin/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
175 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}/cgo
176 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bindir}/ebnflint
187 for tool in $tools; do
188 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
191 install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
192 cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
194 VIMFILES="syntax/go.vim ftdetect/gofiletype.vim ftplugin/go/fmt.vim ftplugin/go/import.vim indent/go.vim"
195 for i in $VIMFILES; do
196 install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i
200 rm -rf $RPM_BUILD_ROOT
203 %defattr(644,root,root,755)
204 %doc AUTHORS CONTRIBUTORS LICENSE README
206 %attr(755,root,root) %{_bindir}/5a
207 %attr(755,root,root) %{_bindir}/5c
208 %attr(755,root,root) %{_bindir}/5g
209 %attr(755,root,root) %{_bindir}/5l
212 %attr(755,root,root) %{_bindir}/6a
213 %attr(755,root,root) %{_bindir}/6c
214 %attr(755,root,root) %{_bindir}/6g
215 %attr(755,root,root) %{_bindir}/6l
218 %attr(755,root,root) %{_bindir}/8a
219 %attr(755,root,root) %{_bindir}/8c
220 %attr(755,root,root) %{_bindir}/8g
221 %attr(755,root,root) %{_bindir}/8l
223 %attr(755,root,root) %{_bindir}/cgo
224 %attr(755,root,root) %{_bindir}/ebnflint
225 %attr(755,root,root) %{_bindir}/go
226 %attr(755,root,root) %{_bindir}/godoc
227 %attr(755,root,root) %{_bindir}/gofmt
228 %dir %{_libdir}/%{name}
229 %dir %{_libdir}/%{name}/bin
230 %attr(755,root,root) %{_libdir}/%{name}/bin/*
232 %{_libdir}/%{name}/include
233 %{_libdir}/%{name}/lib
234 %{_libdir}/%{name}/misc
235 %dir %{_libdir}/%{name}/pkg
236 %{_libdir}/%{name}/pkg/linux_%{GOARCH}
237 %{_libdir}/%{name}/pkg/obj
238 %dir %{_libdir}/%{name}/pkg/tool
239 %dir %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}
240 %attr(755,root,root) %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/*
243 %dir %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race
244 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/*.a
245 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/regexp
246 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/runtime
247 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/sync
248 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/text
249 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/unicode
253 %defattr(644,root,root,755)
254 %{_usrsrc}/%{name}-%{version}
257 %defattr(644,root,root,755)
260 %files -n vim-syntax-%{name}
261 %defattr(644,root,root,755)
262 %{_vimdatadir}/ftdetect/gofiletype.vim
263 %{_vimdatadir}/ftplugin/go
264 %{_vimdatadir}/indent/go.vim
265 %{_vimdatadir}/syntax/go.vim
267 %files -n emacs-%{name}
268 %defattr(644,root,root,755)
269 %{_datadir}/emacs/site-lisp/go-mode*.el