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)
8 %bcond_without tests # build without tests
9 %bcond_without verbose # verbose build (V=1)
11 Summary: Go compiler and tools
12 Summary(pl.UTF-8): Kompilator języka Go i narzędzia
17 Group: Development/Languages
18 #Source0Download: https://code.google.com/p/go/downloads/list
19 Source0: https://go.googlecode.com/files/go%{version}.src.tar.gz
20 # Source0-md5: 705feb2246c8ddaf820d7e171f1430c5
21 URL: http://golang.org/
24 BuildRequires: rpm-pythonprov
26 BuildRequires: hostname
28 ExclusiveArch: %{ix86} %{x8664} %{arm}
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define _enable_debug_packages 0
32 %define no_install_post_strip 1
33 %define no_install_post_chrpath 1
34 %define _noautoreqfiles %{_libdir}/%{name}/src
36 %define _vimdatadir %{_datadir}/vim
46 Go is an open source programming environment that makes it easy to
47 build simple, reliable, and efficient software.
49 %description -l pl.UTF-8
50 Go to mające otwarte źródła środowisko do programowania, pozwalające
51 na łatwe tworzenie prostych, pewnych i wydajnych programów.
53 %package -n vim-syntax-%{name}
54 Summary: Go syntax files for Vim
55 Summary(pl.UTF-8): Pliki składni Go dla Vima
56 Group: Applications/Editors
57 Requires: %{name} = %{version}-%{release}
58 Requires: vim-rt >= 4:7.2.170
59 %if "%{_rpmversion}" >= "5"
63 %description -n vim-syntax-%{name}
64 Go syntax files for vim.
66 %description -n vim-syntax-%{name} -l pl.UTF-8
67 Pliki składni Go dla Vima.
69 %package -n emacs-%{name}
70 Summary: Go mode for Emacs
71 Summary(pl.UTF-8): Tryb Go dla Emacsa
72 Group: Applications/Editors
73 %if "%{_rpmversion}" >= "5"
77 %description -n emacs-%{name}
80 %description -n emacs-%{name} -l pl.UTF-8
87 %{__rm} src/pkg/net/multicast_test.go
92 GOROOT_FINAL=%{_libdir}/%{name}
97 export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL
98 export MAKE="%{__make}"
101 # optflags for go tools build
102 nflags="\"$(echo '%{rpmcflags}' | sed -e 's/^[ ]*//;s/[ ]*$//;s/[ ]\+/ /g' -e 's/ /\",\"/g')\""
103 %{__sed} -i -e "s/\"-O2\"/$nflags/" src/cmd/dist/build.c
104 # NOTE: optflags used in gcc calls from go compiler are in src/cmd/go/build.go
109 LC_ALL=C PATH="$PATH:$GOBIN" ./all.bash
112 rm -rf $RPM_BUILD_ROOT
113 GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name}
115 install -d $GOROOT/{misc,lib,src}
116 install -d $RPM_BUILD_ROOT%{_bindir}
118 cp -a pkg include lib bin $GOROOT
119 cp -a src/pkg src/cmd $GOROOT/src
120 cp -a misc/cgo $GOROOT/misc
122 ln -sf %{_libdir}/%{name}/bin/go $RPM_BUILD_ROOT%{_bindir}/go
123 ln -sf %{_libdir}/%{name}/bin/godoc $RPM_BUILD_ROOT%{_bindir}/godoc
124 ln -sf %{_libdir}/%{name}/bin/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
126 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}/cgo
127 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bindir}/ebnflint
138 for tool in $tools; do
139 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
142 install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
143 cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
145 VIMFILES="syntax/go.vim ftdetect/gofiletype.vim ftplugin/go/fmt.vim ftplugin/go/import.vim indent/go.vim"
146 for i in $VIMFILES; do
147 install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i
151 rm -rf $RPM_BUILD_ROOT
154 %defattr(644,root,root,755)
155 %doc AUTHORS CONTRIBUTORS LICENSE README doc/*
157 %attr(755,root,root) %{_bindir}/5a
158 %attr(755,root,root) %{_bindir}/5c
159 %attr(755,root,root) %{_bindir}/5g
160 %attr(755,root,root) %{_bindir}/5l
163 %attr(755,root,root) %{_bindir}/6a
164 %attr(755,root,root) %{_bindir}/6c
165 %attr(755,root,root) %{_bindir}/6g
166 %attr(755,root,root) %{_bindir}/6l
169 %attr(755,root,root) %{_bindir}/8a
170 %attr(755,root,root) %{_bindir}/8c
171 %attr(755,root,root) %{_bindir}/8g
172 %attr(755,root,root) %{_bindir}/8l
174 %attr(755,root,root) %{_bindir}/cgo
175 %attr(755,root,root) %{_bindir}/ebnflint
176 %attr(755,root,root) %{_bindir}/go
177 %attr(755,root,root) %{_bindir}/godoc
178 %attr(755,root,root) %{_bindir}/gofmt
179 %dir %{_libdir}/%{name}
180 %dir %{_libdir}/%{name}/bin
181 %attr(755,root,root) %{_libdir}/%{name}/bin/*
183 %{_libdir}/%{name}/include
184 %{_libdir}/%{name}/lib
185 %{_libdir}/%{name}/misc
186 %{_libdir}/%{name}/src
187 %dir %{_libdir}/%{name}/pkg
188 %{_libdir}/%{name}/pkg/linux_%{GOARCH}
189 %{_libdir}/%{name}/pkg/obj
190 %dir %{_libdir}/%{name}/pkg/tool
191 %dir %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}
192 %attr(755,root,root) %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/*
194 %dir %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race
195 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/*.a
196 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/regexp
197 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/runtime
198 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/sync
199 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/text
200 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/unicode
203 %files -n vim-syntax-%{name}
204 %defattr(644,root,root,755)
205 %{_vimdatadir}/ftdetect/gofiletype.vim
206 %{_vimdatadir}/ftplugin/go
207 %{_vimdatadir}/indent/go.vim
208 %{_vimdatadir}/syntax/go.vim
210 %files -n emacs-%{name}
211 %defattr(644,root,root,755)
212 %{_datadir}/emacs/site-lisp/go-mode*.el