]> git.pld-linux.org Git - packages/golang.git/blame - golang.spec
Revert "split source to -source package (why package it anyway?)"
[packages/golang.git] / golang.spec
CommitLineData
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 12Summary: Go compiler and tools
78dbb97f 13Summary(pl.UTF-8): Kompilator języka Go i narzędzia
2ecef135 14Name: golang
f77d9896 15Version: 1.1.2
c278766b 16Release: 1
2ecef135
PG
17License: BSD
18Group: Development/Languages
8cd0ab3e 19#Source0Download: https://code.google.com/p/go/downloads/list
f77d9896
ER
20Source0: https://go.googlecode.com/files/go%{version}.src.tar.gz
21# Source0-md5: 705feb2246c8ddaf820d7e171f1430c5
c6ce79b1 22Patch0: ca-certs.patch
78dbb97f 23URL: http://golang.org/
811d7a98 24BuildRequires: bash
30cbf052 25BuildRequires: rpm-pythonprov
602caf80
ER
26%if %{with tests}
27BuildRequires: hostname
672135e3 28BuildRequires: tzdata
602caf80 29%endif
c6ce79b1 30Requires: ca-certificates
d5759e4c 31ExclusiveArch: %{ix86} %{x8664} %{arm}
2ecef135
PG
32BuildRoot: %{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
49Go is an open source programming environment that makes it easy to
50build simple, reliable, and efficient software.
2ecef135 51
78dbb97f
JB
52%description -l pl.UTF-8
53Go to mające otwarte źródła środowisko do programowania, pozwalające
54na łatwe tworzenie prostych, pewnych i wydajnych programów.
55
c278766b
ER
56%package doc
57Summary: Manual for go
58Summary(fr.UTF-8): Documentation pour go
59Summary(it.UTF-8): Documentazione di go
60Summary(pl.UTF-8): Podręcznik dla go
61Group: Documentation
62%if "%{_rpmversion}" >= "5"
63BuildArch: noarch
64%endif
65
66%description doc
67Documentation for go.
68
69%description doc -l fr.UTF-8
70Documentation pour go.
71
72%description doc -l it.UTF-8
73Documentazione di go.
74
75%description doc -l pl.UTF-8
76Dokumentacja do go.
77
2502d5f0 78%package -n vim-syntax-%{name}
78dbb97f
JB
79Summary: Go syntax files for Vim
80Summary(pl.UTF-8): Pliki składni Go dla Vima
2ecef135 81Group: Applications/Editors
2502d5f0
ER
82Requires: vim-rt >= 4:7.2.170
83%if "%{_rpmversion}" >= "5"
84BuildArch: noarch
85%endif
2ecef135 86
2502d5f0 87%description -n vim-syntax-%{name}
2ecef135
PG
88Go syntax files for vim.
89
78dbb97f
JB
90%description -n vim-syntax-%{name} -l pl.UTF-8
91Pliki składni Go dla Vima.
92
2502d5f0 93%package -n emacs-%{name}
78dbb97f
JB
94Summary: Go mode for Emacs
95Summary(pl.UTF-8): Tryb Go dla Emacsa
2ecef135 96Group: Applications/Editors
2502d5f0
ER
97%if "%{_rpmversion}" >= "5"
98BuildArch: noarch
99%endif
2ecef135 100
2502d5f0 101%description -n emacs-%{name}
2ecef135
PG
102Go mode for Emacs.
103
78dbb97f
JB
104%description -n emacs-%{name} -l pl.UTF-8
105Tryb Go dla Emacsa.
106
2ecef135 107%prep
c6ce79b1
ER
108%setup -qc
109mv go/* .
110%patch0 -p1
2ecef135 111
30cbf052 112# broken tests
78dbb97f 113%{__rm} src/pkg/net/multicast_test.go
30cbf052 114
811d7a98
ER
115cat > env.sh <<'EOF'
116export GOROOT=$(pwd)
117export GOROOT_FINAL=%{_libdir}/%{name}
118
119export GOOS=linux
120export GOBIN=$GOROOT/bin
121export GOARCH=%{GOARCH}
122export GOROOT_FINAL
2502d5f0 123export MAKE="%{__make}"
811d7a98
ER
124CC="%{__cc}"
125export CC="${CC#ccache }"
126
127export PATH="$PATH:$GOBIN"
128EOF
129
130install -d bin
131
d5759e4c
JB
132# optflags for go tools build
133nflags="\"$(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
141cd src
142./all.bash
2ecef135
PG
143
144%install
145rm -rf $RPM_BUILD_ROOT
2502d5f0 146GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name}
2ecef135 147
3fcc5b17
ER
148install -d $GOROOT/{misc,lib,src}
149install -d $RPM_BUILD_ROOT%{_bindir}
2ecef135
PG
150
151cp -a pkg include lib bin $GOROOT
3fcc5b17 152cp -a src/pkg src/cmd $GOROOT/src
2ecef135
PG
153cp -a misc/cgo $GOROOT/misc
154
155ln -sf %{_libdir}/%{name}/bin/go $RPM_BUILD_ROOT%{_bindir}/go
156ln -sf %{_libdir}/%{name}/bin/godoc $RPM_BUILD_ROOT%{_bindir}/godoc
157ln -sf %{_libdir}/%{name}/bin/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
158
159ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}/cgo
160ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bindir}/ebnflint
161
162%ifarch %{ix86}
163tools="8a 8c 8g 8l"
d5759e4c
JB
164%endif
165%ifarch %{x8664}
2ecef135
PG
166tools="6a 6c 6g 6l"
167%endif
d5759e4c
JB
168%ifarch %{arm}
169tools="5a 5c 5g 5l"
170%endif
510be9c2 171for tool in $tools; do
2502d5f0 172 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
2ecef135
PG
173done
174
175install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
2502d5f0 176cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
2ecef135
PG
177
178VIMFILES="syntax/go.vim ftdetect/gofiletype.vim ftplugin/go/fmt.vim ftplugin/go/import.vim indent/go.vim"
179for i in $VIMFILES; do
b87ab065 180 install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i
2ecef135
PG
181done
182
2ecef135
PG
183%clean
184rm -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
This page took 0.075737 seconds and 4 git commands to generate.