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
15 Group: Development/Languages
16 URL: http://golang.org/
17 Source0: http://go.googlecode.com/files/go%{version}.src.tar.gz
18 # Source0-md5: 31acddba58b4592242a3c3c16165866b
21 BuildRequires: rpm-pythonprov
23 BuildRequires: hostname
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define _enable_debug_packages 0
28 %define no_install_post_strip 1
29 %define no_install_post_chrpath 1
30 %define _noautoreqfiles %{_libdir}/%{name}/src
32 %define _vimdatadir %{_datadir}/vim
42 Go is an open source programming environment that makes it easy to
43 build simple, reliable, and efficient software.
45 %package -n vim-syntax-%{name}
46 Summary: go syntax files for vim
47 Group: Applications/Editors
48 Requires: %{name} = %{version}-%{release}
49 Requires: vim-rt >= 4:7.2.170
50 %if "%{_rpmversion}" >= "5"
54 %description -n vim-syntax-%{name}
55 Go syntax files for vim.
57 %package -n emacs-%{name}
58 Summary: go syntax files for emacs
59 Group: Applications/Editors
60 %if "%{_rpmversion}" >= "5"
64 %description -n emacs-%{name}
71 rm src/pkg/net/multicast_test.go
76 GOROOT_FINAL=%{_libdir}/%{name}
81 export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL
82 export MAKE="%{__make}"
87 LC_ALL=C PATH="$PATH:$GOBIN" ./all.bash
90 rm -rf $RPM_BUILD_ROOT
91 GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name}
93 install -d $GOROOT/{misc,lib,src}
94 install -d $RPM_BUILD_ROOT%{_bindir}
96 cp -a pkg include lib bin $GOROOT
97 cp -a src/pkg src/cmd $GOROOT/src
98 cp -a misc/cgo $GOROOT/misc
100 ln -sf %{_libdir}/%{name}/bin/go $RPM_BUILD_ROOT%{_bindir}/go
101 ln -sf %{_libdir}/%{name}/bin/godoc $RPM_BUILD_ROOT%{_bindir}/godoc
102 ln -sf %{_libdir}/%{name}/bin/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
104 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}/cgo
105 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bindir}/ebnflint
112 for tool in $tools; do
113 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
116 install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
117 cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
119 VIMFILES="syntax/go.vim ftdetect/gofiletype.vim ftplugin/go/fmt.vim ftplugin/go/import.vim indent/go.vim"
120 for i in $VIMFILES; do
121 install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i
125 rm -rf $RPM_BUILD_ROOT
128 %defattr(644,root,root,755)
129 %doc AUTHORS CONTRIBUTORS LICENSE README doc/*
130 %attr(755,root,root) %{_bindir}/*
131 %dir %{_libdir}/%{name}
132 %dir %{_libdir}/%{name}/bin
133 %attr(755,root,root) %{_libdir}/%{name}/bin/*
135 %{_libdir}/%{name}/include
136 %{_libdir}/%{name}/lib
137 %{_libdir}/%{name}/misc
138 %{_libdir}/%{name}/src
139 %dir %{_libdir}/%{name}/pkg
140 %{_libdir}/%{name}/pkg/linux_%{GOARCH}
141 %{_libdir}/%{name}/pkg/obj
142 %dir %{_libdir}/%{name}/pkg/tool
143 %dir %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}
144 %attr(755,root,root) %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/*
146 %files -n vim-syntax-%{name}
147 %defattr(644,root,root,755)
148 %{_vimdatadir}/ftdetect/gofiletype.vim
149 %{_vimdatadir}/ftplugin/go
150 %{_vimdatadir}/indent/go.vim
151 %{_vimdatadir}/syntax/go.vim
153 %files -n emacs-%{name}
154 %defattr(644,root,root,755)
155 %{_datadir}/emacs/site-lisp/go-mode*.el