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
7 %bcond_without tests # build without tests
8 %bcond_without verbose # verbose build (V=1)
10 Summary: Go compiler and tools
11 Summary(pl.UTF-8): Kompilator języka Go i narzędzia
16 Group: Development/Languages
17 #Source0Download: https://code.google.com/p/go/downloads/list
18 Source0: http://go.googlecode.com/files/go%{version}.src.tar.gz
19 # Source0-md5: 31acddba58b4592242a3c3c16165866b
20 URL: http://golang.org/
23 BuildRequires: rpm-pythonprov
25 BuildRequires: hostname
27 ExclusiveArch: %{ix86} %{x8664} %{arm}
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %define _enable_debug_packages 0
31 %define no_install_post_strip 1
32 %define no_install_post_chrpath 1
33 %define _noautoreqfiles %{_libdir}/%{name}/src
35 %define _vimdatadir %{_datadir}/vim
45 Go is an open source programming environment that makes it easy to
46 build simple, reliable, and efficient software.
48 %description -l pl.UTF-8
49 Go to mające otwarte źródła środowisko do programowania, pozwalające
50 na łatwe tworzenie prostych, pewnych i wydajnych programów.
52 %package -n vim-syntax-%{name}
53 Summary: Go syntax files for Vim
54 Summary(pl.UTF-8): Pliki składni Go dla Vima
55 Group: Applications/Editors
56 Requires: %{name} = %{version}-%{release}
57 Requires: vim-rt >= 4:7.2.170
58 %if "%{_rpmversion}" >= "5"
62 %description -n vim-syntax-%{name}
63 Go syntax files for vim.
65 %description -n vim-syntax-%{name} -l pl.UTF-8
66 Pliki składni Go dla Vima.
68 %package -n emacs-%{name}
69 Summary: Go mode for Emacs
70 Summary(pl.UTF-8): Tryb Go dla Emacsa
71 Group: Applications/Editors
72 %if "%{_rpmversion}" >= "5"
76 %description -n emacs-%{name}
79 %description -n emacs-%{name} -l pl.UTF-8
86 %{__rm} src/pkg/net/multicast_test.go
91 GOROOT_FINAL=%{_libdir}/%{name}
96 export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL
97 export MAKE="%{__make}"
99 # optflags for go tools build
100 nflags="\"$(echo '%{rpmcflags}' | sed -e 's/^[ ]*//;s/[ ]*$//;s/[ ]\+/ /g' -e 's/ /\",\"/g')\""
101 %{__sed} -i -e "s/\"-O2\"/$nflags/" src/cmd/dist/build.c
102 # NOTE: optflags used in gcc calls from go compiler are in src/cmd/go/build.go
107 LC_ALL=C PATH="$PATH:$GOBIN" ./all.bash
110 rm -rf $RPM_BUILD_ROOT
111 GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name}
113 install -d $GOROOT/{misc,lib,src}
114 install -d $RPM_BUILD_ROOT%{_bindir}
116 cp -a pkg include lib bin $GOROOT
117 cp -a src/pkg src/cmd $GOROOT/src
118 cp -a misc/cgo $GOROOT/misc
120 ln -sf %{_libdir}/%{name}/bin/go $RPM_BUILD_ROOT%{_bindir}/go
121 ln -sf %{_libdir}/%{name}/bin/godoc $RPM_BUILD_ROOT%{_bindir}/godoc
122 ln -sf %{_libdir}/%{name}/bin/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
124 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}/cgo
125 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bindir}/ebnflint
136 for tool in $tools; do
137 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
140 install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
141 cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
143 VIMFILES="syntax/go.vim ftdetect/gofiletype.vim ftplugin/go/fmt.vim ftplugin/go/import.vim indent/go.vim"
144 for i in $VIMFILES; do
145 install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i
149 rm -rf $RPM_BUILD_ROOT
152 %defattr(644,root,root,755)
153 %doc AUTHORS CONTRIBUTORS LICENSE README doc/*
155 %attr(755,root,root) %{_bindir}/5a
156 %attr(755,root,root) %{_bindir}/5c
157 %attr(755,root,root) %{_bindir}/5g
158 %attr(755,root,root) %{_bindir}/5l
161 %attr(755,root,root) %{_bindir}/6a
162 %attr(755,root,root) %{_bindir}/6c
163 %attr(755,root,root) %{_bindir}/6g
164 %attr(755,root,root) %{_bindir}/6l
167 %attr(755,root,root) %{_bindir}/8a
168 %attr(755,root,root) %{_bindir}/8c
169 %attr(755,root,root) %{_bindir}/8g
170 %attr(755,root,root) %{_bindir}/8l
172 %attr(755,root,root) %{_bindir}/cgo
173 %attr(755,root,root) %{_bindir}/ebnflint
174 %attr(755,root,root) %{_bindir}/go
175 %attr(755,root,root) %{_bindir}/godoc
176 %attr(755,root,root) %{_bindir}/gofmt
177 %dir %{_libdir}/%{name}
178 %dir %{_libdir}/%{name}/bin
179 %attr(755,root,root) %{_libdir}/%{name}/bin/*
181 %{_libdir}/%{name}/include
182 %{_libdir}/%{name}/lib
183 %{_libdir}/%{name}/misc
184 %{_libdir}/%{name}/src
185 %dir %{_libdir}/%{name}/pkg
186 %{_libdir}/%{name}/pkg/linux_%{GOARCH}
187 %{_libdir}/%{name}/pkg/obj
188 %dir %{_libdir}/%{name}/pkg/tool
189 %dir %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}
190 %attr(755,root,root) %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/*
192 %files -n vim-syntax-%{name}
193 %defattr(644,root,root,755)
194 %{_vimdatadir}/ftdetect/gofiletype.vim
195 %{_vimdatadir}/ftplugin/go
196 %{_vimdatadir}/indent/go.vim
197 %{_vimdatadir}/syntax/go.vim
199 %files -n emacs-%{name}
200 %defattr(644,root,root,755)
201 %{_datadir}/emacs/site-lisp/go-mode*.el