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 URL: http://golang.org/
25 BuildRequires: mercurial
26 BuildRequires: rpm-pythonprov
28 BuildRequires: hostname
30 ExclusiveArch: %{ix86} %{x8664} %{arm}
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 %define _enable_debug_packages 0
34 %define no_install_post_strip 1
35 %define no_install_post_chrpath 1
36 %define _noautoreqfiles %{_libdir}/%{name}/src
38 %define _vimdatadir %{_datadir}/vim
48 Go is an open source programming environment that makes it easy to
49 build simple, reliable, and efficient software.
51 %description -l pl.UTF-8
52 Go to mające otwarte źródła środowisko do programowania, pozwalające
53 na łatwe tworzenie prostych, pewnych i wydajnych programów.
55 %package -n vim-syntax-%{name}
56 Summary: Go syntax files for Vim
57 Summary(pl.UTF-8): Pliki składni Go dla Vima
58 Group: Applications/Editors
59 Requires: %{name} = %{version}-%{release}
60 Requires: vim-rt >= 4:7.2.170
61 %if "%{_rpmversion}" >= "5"
65 %description -n vim-syntax-%{name}
66 Go syntax files for vim.
68 %description -n vim-syntax-%{name} -l pl.UTF-8
69 Pliki składni Go dla Vima.
71 %package -n emacs-%{name}
72 Summary: Go mode for Emacs
73 Summary(pl.UTF-8): Tryb Go dla Emacsa
74 Group: Applications/Editors
75 %if "%{_rpmversion}" >= "5"
79 %description -n emacs-%{name}
82 %description -n emacs-%{name} -l pl.UTF-8
89 %{__rm} src/pkg/net/multicast_test.go
94 GOROOT_FINAL=%{_libdir}/%{name}
99 export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL
100 export MAKE="%{__make}"
103 # optflags for go tools build
104 nflags="\"$(echo '%{rpmcflags}' | sed -e 's/^[ ]*//;s/[ ]*$//;s/[ ]\+/ /g' -e 's/ /\",\"/g')\""
105 %{__sed} -i -e "s/\"-O2\"/$nflags/" src/cmd/dist/build.c
106 # NOTE: optflags used in gcc calls from go compiler are in src/cmd/go/build.go
111 LC_ALL=C PATH="$PATH:$GOBIN" ./all.bash
114 rm -rf $RPM_BUILD_ROOT
115 GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name}
117 install -d $GOROOT/{misc,lib,src}
118 install -d $RPM_BUILD_ROOT%{_bindir}
120 cp -a pkg include lib bin $GOROOT
121 cp -a src/pkg src/cmd $GOROOT/src
122 cp -a misc/cgo $GOROOT/misc
124 ln -sf %{_libdir}/%{name}/bin/go $RPM_BUILD_ROOT%{_bindir}/go
125 ln -sf %{_libdir}/%{name}/bin/godoc $RPM_BUILD_ROOT%{_bindir}/godoc
126 ln -sf %{_libdir}/%{name}/bin/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
128 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}/cgo
129 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bindir}/ebnflint
140 for tool in $tools; do
141 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
144 install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
145 cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
147 VIMFILES="syntax/go.vim ftdetect/gofiletype.vim ftplugin/go/fmt.vim ftplugin/go/import.vim indent/go.vim"
148 for i in $VIMFILES; do
149 install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i
153 rm -rf $RPM_BUILD_ROOT
156 %defattr(644,root,root,755)
157 %doc AUTHORS CONTRIBUTORS LICENSE README doc/*
159 %attr(755,root,root) %{_bindir}/5a
160 %attr(755,root,root) %{_bindir}/5c
161 %attr(755,root,root) %{_bindir}/5g
162 %attr(755,root,root) %{_bindir}/5l
165 %attr(755,root,root) %{_bindir}/6a
166 %attr(755,root,root) %{_bindir}/6c
167 %attr(755,root,root) %{_bindir}/6g
168 %attr(755,root,root) %{_bindir}/6l
171 %attr(755,root,root) %{_bindir}/8a
172 %attr(755,root,root) %{_bindir}/8c
173 %attr(755,root,root) %{_bindir}/8g
174 %attr(755,root,root) %{_bindir}/8l
176 %attr(755,root,root) %{_bindir}/cgo
177 %attr(755,root,root) %{_bindir}/ebnflint
178 %attr(755,root,root) %{_bindir}/go
179 %attr(755,root,root) %{_bindir}/godoc
180 %attr(755,root,root) %{_bindir}/gofmt
181 %dir %{_libdir}/%{name}
182 %dir %{_libdir}/%{name}/bin
183 %attr(755,root,root) %{_libdir}/%{name}/bin/*
185 %{_libdir}/%{name}/include
186 %{_libdir}/%{name}/lib
187 %{_libdir}/%{name}/misc
188 %{_libdir}/%{name}/src
189 %dir %{_libdir}/%{name}/pkg
190 %{_libdir}/%{name}/pkg/linux_%{GOARCH}
191 %{_libdir}/%{name}/pkg/obj
192 %dir %{_libdir}/%{name}/pkg/tool
193 %dir %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}
194 %attr(755,root,root) %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/*
196 %dir %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race
197 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/*.a
198 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/regexp
199 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/runtime
200 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/sync
201 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/text
202 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/unicode
205 %files -n vim-syntax-%{name}
206 %defattr(644,root,root,755)
207 %{_vimdatadir}/ftdetect/gofiletype.vim
208 %{_vimdatadir}/ftplugin/go
209 %{_vimdatadir}/indent/go.vim
210 %{_vimdatadir}/syntax/go.vim
212 %files -n emacs-%{name}
213 %defattr(644,root,root,755)
214 %{_datadir}/emacs/site-lisp/go-mode*.el