]>
Commit | Line | Data |
---|---|---|
602caf80 ER |
1 | # TODO |
2 | # - allow disabling tests (currently bcond exists just for showing which are test deps) | |
30cbf052 ER |
3 | # - add verbose build output (currently dummy bcond) |
4 | # - setup GOMAXPROCS=2 from _smp_mflags | |
f77d9896 | 5 | # - fix CC containing spaces (ccache) |
8dbb36e3 | 6 | # - check if hg use at build time can be dropped |
602caf80 ER |
7 | |
8 | # Conditional build: | |
9 | %bcond_without tests # build without tests | |
30cbf052 | 10 | %bcond_without verbose # verbose build (V=1) |
602caf80 | 11 | |
2ecef135 | 12 | Summary: Go compiler and tools |
78dbb97f | 13 | Summary(pl.UTF-8): Kompilator języka Go i narzędzia |
2ecef135 | 14 | Name: golang |
f77d9896 | 15 | Version: 1.1.2 |
c278766b | 16 | Release: 1 |
2ecef135 PG |
17 | License: BSD |
18 | Group: Development/Languages | |
8cd0ab3e | 19 | #Source0Download: https://code.google.com/p/go/downloads/list |
f77d9896 ER |
20 | Source0: https://go.googlecode.com/files/go%{version}.src.tar.gz |
21 | # Source0-md5: 705feb2246c8ddaf820d7e171f1430c5 | |
c6ce79b1 | 22 | Patch0: ca-certs.patch |
78dbb97f | 23 | URL: http://golang.org/ |
811d7a98 | 24 | BuildRequires: bash |
30cbf052 | 25 | BuildRequires: rpm-pythonprov |
602caf80 ER |
26 | %if %{with tests} |
27 | BuildRequires: hostname | |
672135e3 | 28 | BuildRequires: tzdata |
602caf80 | 29 | %endif |
c6ce79b1 | 30 | Requires: ca-certificates |
d5759e4c | 31 | ExclusiveArch: %{ix86} %{x8664} %{arm} |
2ecef135 PG |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
33 | ||
2502d5f0 ER |
34 | %define _enable_debug_packages 0 |
35 | %define no_install_post_strip 1 | |
36 | %define no_install_post_chrpath 1 | |
37 | %define _noautoreqfiles %{_libdir}/%{name}/src | |
38 | ||
39 | %define _vimdatadir %{_datadir}/vim | |
40 | ||
41 | %ifarch %{ix86} | |
42 | %define GOARCH 386 | |
43 | %endif | |
44 | %ifarch %{x8664} | |
45 | %define GOARCH amd64 | |
46 | %endif | |
47 | ||
2ecef135 | 48 | %description |
510be9c2 PG |
49 | Go is an open source programming environment that makes it easy to |
50 | build simple, reliable, and efficient software. | |
2ecef135 | 51 | |
78dbb97f JB |
52 | %description -l pl.UTF-8 |
53 | Go to mające otwarte źródła środowisko do programowania, pozwalające | |
54 | na łatwe tworzenie prostych, pewnych i wydajnych programów. | |
55 | ||
c278766b ER |
56 | %package doc |
57 | Summary: Manual for go | |
58 | Summary(fr.UTF-8): Documentation pour go | |
59 | Summary(it.UTF-8): Documentazione di go | |
60 | Summary(pl.UTF-8): Podręcznik dla go | |
61 | Group: Documentation | |
62 | %if "%{_rpmversion}" >= "5" | |
63 | BuildArch: noarch | |
64 | %endif | |
65 | ||
66 | %description doc | |
67 | Documentation for go. | |
68 | ||
69 | %description doc -l fr.UTF-8 | |
70 | Documentation pour go. | |
71 | ||
72 | %description doc -l it.UTF-8 | |
73 | Documentazione di go. | |
74 | ||
75 | %description doc -l pl.UTF-8 | |
76 | Dokumentacja do go. | |
77 | ||
2502d5f0 | 78 | %package -n vim-syntax-%{name} |
78dbb97f JB |
79 | Summary: Go syntax files for Vim |
80 | Summary(pl.UTF-8): Pliki składni Go dla Vima | |
2ecef135 | 81 | Group: Applications/Editors |
2502d5f0 ER |
82 | Requires: vim-rt >= 4:7.2.170 |
83 | %if "%{_rpmversion}" >= "5" | |
84 | BuildArch: noarch | |
85 | %endif | |
2ecef135 | 86 | |
2502d5f0 | 87 | %description -n vim-syntax-%{name} |
2ecef135 PG |
88 | Go syntax files for vim. |
89 | ||
78dbb97f JB |
90 | %description -n vim-syntax-%{name} -l pl.UTF-8 |
91 | Pliki składni Go dla Vima. | |
92 | ||
2502d5f0 | 93 | %package -n emacs-%{name} |
78dbb97f JB |
94 | Summary: Go mode for Emacs |
95 | Summary(pl.UTF-8): Tryb Go dla Emacsa | |
2ecef135 | 96 | Group: Applications/Editors |
2502d5f0 ER |
97 | %if "%{_rpmversion}" >= "5" |
98 | BuildArch: noarch | |
99 | %endif | |
2ecef135 | 100 | |
2502d5f0 | 101 | %description -n emacs-%{name} |
2ecef135 PG |
102 | Go mode for Emacs. |
103 | ||
78dbb97f JB |
104 | %description -n emacs-%{name} -l pl.UTF-8 |
105 | Tryb Go dla Emacsa. | |
106 | ||
2ecef135 | 107 | %prep |
c6ce79b1 ER |
108 | %setup -qc |
109 | mv go/* . | |
110 | %patch0 -p1 | |
2ecef135 | 111 | |
30cbf052 | 112 | # broken tests |
78dbb97f | 113 | %{__rm} src/pkg/net/multicast_test.go |
30cbf052 | 114 | |
811d7a98 ER |
115 | cat > env.sh <<'EOF' |
116 | export GOROOT=$(pwd) | |
117 | export GOROOT_FINAL=%{_libdir}/%{name} | |
118 | ||
119 | export GOOS=linux | |
120 | export GOBIN=$GOROOT/bin | |
121 | export GOARCH=%{GOARCH} | |
122 | export GOROOT_FINAL | |
2502d5f0 | 123 | export MAKE="%{__make}" |
811d7a98 ER |
124 | CC="%{__cc}" |
125 | export CC="${CC#ccache }" | |
126 | ||
127 | export PATH="$PATH:$GOBIN" | |
128 | EOF | |
129 | ||
130 | install -d bin | |
131 | ||
d5759e4c JB |
132 | # optflags for go tools build |
133 | nflags="\"$(echo '%{rpmcflags}' | sed -e 's/^[ ]*//;s/[ ]*$//;s/[ ]\+/ /g' -e 's/ /\",\"/g')\"" | |
134 | %{__sed} -i -e "s/\"-O2\"/$nflags/" src/cmd/dist/build.c | |
135 | # NOTE: optflags used in gcc calls from go compiler are in src/cmd/go/build.go | |
2ecef135 | 136 | |
2ecef135 | 137 | |
811d7a98 ER |
138 | %build |
139 | . ./env.sh | |
140 | ||
141 | cd src | |
142 | ./all.bash | |
2ecef135 PG |
143 | |
144 | %install | |
145 | rm -rf $RPM_BUILD_ROOT | |
2502d5f0 | 146 | GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name} |
2ecef135 | 147 | |
3fcc5b17 ER |
148 | install -d $GOROOT/{misc,lib,src} |
149 | install -d $RPM_BUILD_ROOT%{_bindir} | |
2ecef135 PG |
150 | |
151 | cp -a pkg include lib bin $GOROOT | |
3fcc5b17 | 152 | cp -a src/pkg src/cmd $GOROOT/src |
2ecef135 PG |
153 | cp -a misc/cgo $GOROOT/misc |
154 | ||
155 | ln -sf %{_libdir}/%{name}/bin/go $RPM_BUILD_ROOT%{_bindir}/go | |
156 | ln -sf %{_libdir}/%{name}/bin/godoc $RPM_BUILD_ROOT%{_bindir}/godoc | |
157 | ln -sf %{_libdir}/%{name}/bin/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt | |
158 | ||
159 | ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}/cgo | |
160 | ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bindir}/ebnflint | |
161 | ||
162 | %ifarch %{ix86} | |
163 | tools="8a 8c 8g 8l" | |
d5759e4c JB |
164 | %endif |
165 | %ifarch %{x8664} | |
2ecef135 PG |
166 | tools="6a 6c 6g 6l" |
167 | %endif | |
d5759e4c JB |
168 | %ifarch %{arm} |
169 | tools="5a 5c 5g 5l" | |
170 | %endif | |
510be9c2 | 171 | for tool in $tools; do |
2502d5f0 | 172 | ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool |
2ecef135 PG |
173 | done |
174 | ||
175 | install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp | |
2502d5f0 | 176 | cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
2ecef135 PG |
177 | |
178 | VIMFILES="syntax/go.vim ftdetect/gofiletype.vim ftplugin/go/fmt.vim ftplugin/go/import.vim indent/go.vim" | |
179 | for i in $VIMFILES; do | |
b87ab065 | 180 | install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i |
2ecef135 PG |
181 | done |
182 | ||
2ecef135 PG |
183 | %clean |
184 | rm -rf $RPM_BUILD_ROOT | |
185 | ||
186 | %files | |
187 | %defattr(644,root,root,755) | |
c278766b | 188 | %doc AUTHORS CONTRIBUTORS LICENSE README |
d5759e4c JB |
189 | %ifarch %{arm} |
190 | %attr(755,root,root) %{_bindir}/5a | |
191 | %attr(755,root,root) %{_bindir}/5c | |
192 | %attr(755,root,root) %{_bindir}/5g | |
193 | %attr(755,root,root) %{_bindir}/5l | |
194 | %endif | |
195 | %ifarch %{x8664} | |
196 | %attr(755,root,root) %{_bindir}/6a | |
197 | %attr(755,root,root) %{_bindir}/6c | |
198 | %attr(755,root,root) %{_bindir}/6g | |
199 | %attr(755,root,root) %{_bindir}/6l | |
200 | %endif | |
201 | %ifarch %{ix86} | |
202 | %attr(755,root,root) %{_bindir}/8a | |
203 | %attr(755,root,root) %{_bindir}/8c | |
204 | %attr(755,root,root) %{_bindir}/8g | |
205 | %attr(755,root,root) %{_bindir}/8l | |
206 | %endif | |
207 | %attr(755,root,root) %{_bindir}/cgo | |
208 | %attr(755,root,root) %{_bindir}/ebnflint | |
209 | %attr(755,root,root) %{_bindir}/go | |
210 | %attr(755,root,root) %{_bindir}/godoc | |
211 | %attr(755,root,root) %{_bindir}/gofmt | |
2ecef135 PG |
212 | %dir %{_libdir}/%{name} |
213 | %dir %{_libdir}/%{name}/bin | |
214 | %attr(755,root,root) %{_libdir}/%{name}/bin/* | |
215 | ||
216 | %{_libdir}/%{name}/include | |
217 | %{_libdir}/%{name}/lib | |
218 | %{_libdir}/%{name}/misc | |
3fcc5b17 | 219 | %{_libdir}/%{name}/src |
2ecef135 PG |
220 | %dir %{_libdir}/%{name}/pkg |
221 | %{_libdir}/%{name}/pkg/linux_%{GOARCH} | |
222 | %{_libdir}/%{name}/pkg/obj | |
223 | %dir %{_libdir}/%{name}/pkg/tool | |
224 | %dir %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH} | |
225 | %attr(755,root,root) %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/* | |
c67d294c | 226 | |
79c76325 | 227 | %ifarch %{x8664} |
f77d9896 ER |
228 | %dir %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race |
229 | %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/*.a | |
230 | %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/regexp | |
231 | %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/runtime | |
232 | %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/sync | |
233 | %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/text | |
234 | %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/unicode | |
79c76325 | 235 | %endif |
f77d9896 | 236 | |
c278766b ER |
237 | %files doc |
238 | %defattr(644,root,root,755) | |
239 | %doc doc/* | |
240 | ||
2c8cd7b5 | 241 | %files -n vim-syntax-%{name} |
2ecef135 | 242 | %defattr(644,root,root,755) |
b87ab065 ER |
243 | %{_vimdatadir}/ftdetect/gofiletype.vim |
244 | %{_vimdatadir}/ftplugin/go | |
245 | %{_vimdatadir}/indent/go.vim | |
246 | %{_vimdatadir}/syntax/go.vim | |
2ecef135 | 247 | |
2502d5f0 | 248 | %files -n emacs-%{name} |
2ecef135 PG |
249 | %defattr(644,root,root,755) |
250 | %{_datadir}/emacs/site-lisp/go-mode*.el |