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 Source0: http://go.googlecode.com/files/go%{version}.src.tar.gz
18 # Source0-md5: 31acddba58b4592242a3c3c16165866b
19 URL: http://golang.org/
22 BuildRequires: rpm-pythonprov
24 BuildRequires: hostname
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 %define _enable_debug_packages 0
29 %define no_install_post_strip 1
30 %define no_install_post_chrpath 1
31 %define _noautoreqfiles %{_libdir}/%{name}/src
33 %define _vimdatadir %{_datadir}/vim
43 Go is an open source programming environment that makes it easy to
44 build simple, reliable, and efficient software.
46 %description -l pl.UTF-8
47 Go to mające otwarte źródła środowisko do programowania, pozwalające
48 na łatwe tworzenie prostych, pewnych i wydajnych programów.
50 %package -n vim-syntax-%{name}
51 Summary: Go syntax files for Vim
52 Summary(pl.UTF-8): Pliki składni Go dla Vima
53 Group: Applications/Editors
54 Requires: %{name} = %{version}-%{release}
55 Requires: vim-rt >= 4:7.2.170
56 %if "%{_rpmversion}" >= "5"
60 %description -n vim-syntax-%{name}
61 Go syntax files for vim.
63 %description -n vim-syntax-%{name} -l pl.UTF-8
64 Pliki składni Go dla Vima.
66 %package -n emacs-%{name}
67 Summary: Go mode for Emacs
68 Summary(pl.UTF-8): Tryb Go dla Emacsa
69 Group: Applications/Editors
70 %if "%{_rpmversion}" >= "5"
74 %description -n emacs-%{name}
77 %description -n emacs-%{name} -l pl.UTF-8
84 %{__rm} src/pkg/net/multicast_test.go
89 GOROOT_FINAL=%{_libdir}/%{name}
94 export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL
95 export MAKE="%{__make}"
100 LC_ALL=C PATH="$PATH:$GOBIN" ./all.bash
103 rm -rf $RPM_BUILD_ROOT
104 GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name}
106 install -d $GOROOT/{misc,lib,src}
107 install -d $RPM_BUILD_ROOT%{_bindir}
109 cp -a pkg include lib bin $GOROOT
110 cp -a src/pkg src/cmd $GOROOT/src
111 cp -a misc/cgo $GOROOT/misc
113 ln -sf %{_libdir}/%{name}/bin/go $RPM_BUILD_ROOT%{_bindir}/go
114 ln -sf %{_libdir}/%{name}/bin/godoc $RPM_BUILD_ROOT%{_bindir}/godoc
115 ln -sf %{_libdir}/%{name}/bin/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
117 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}/cgo
118 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bindir}/ebnflint
125 for tool in $tools; do
126 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
129 install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
130 cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
132 VIMFILES="syntax/go.vim ftdetect/gofiletype.vim ftplugin/go/fmt.vim ftplugin/go/import.vim indent/go.vim"
133 for i in $VIMFILES; do
134 install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i
138 rm -rf $RPM_BUILD_ROOT
141 %defattr(644,root,root,755)
142 %doc AUTHORS CONTRIBUTORS LICENSE README doc/*
143 %attr(755,root,root) %{_bindir}/*
144 %dir %{_libdir}/%{name}
145 %dir %{_libdir}/%{name}/bin
146 %attr(755,root,root) %{_libdir}/%{name}/bin/*
148 %{_libdir}/%{name}/include
149 %{_libdir}/%{name}/lib
150 %{_libdir}/%{name}/misc
151 %{_libdir}/%{name}/src
152 %dir %{_libdir}/%{name}/pkg
153 %{_libdir}/%{name}/pkg/linux_%{GOARCH}
154 %{_libdir}/%{name}/pkg/obj
155 %dir %{_libdir}/%{name}/pkg/tool
156 %dir %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}
157 %attr(755,root,root) %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/*
159 %files -n vim-syntax-%{name}
160 %defattr(644,root,root,755)
161 %{_vimdatadir}/ftdetect/gofiletype.vim
162 %{_vimdatadir}/ftplugin/go
163 %{_vimdatadir}/indent/go.vim
164 %{_vimdatadir}/syntax/go.vim
166 %files -n emacs-%{name}
167 %defattr(644,root,root,755)
168 %{_datadir}/emacs/site-lisp/go-mode*.el