]> git.pld-linux.org Git - packages/golang.git/blame - golang.spec
- added download URL
[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
602caf80
ER
5
6# Conditional build:
7%bcond_without tests # build without tests
30cbf052 8%bcond_without verbose # verbose build (V=1)
602caf80 9
2ecef135 10Summary: Go compiler and tools
78dbb97f 11Summary(pl.UTF-8): Kompilator języka Go i narzędzia
2ecef135
PG
12Name: golang
13Version: 1.0.3
14Release: 0.1
15License: BSD
16Group: Development/Languages
8cd0ab3e 17#Source0Download: https://code.google.com/p/go/downloads/list
2ecef135 18Source0: http://go.googlecode.com/files/go%{version}.src.tar.gz
510be9c2 19# Source0-md5: 31acddba58b4592242a3c3c16165866b
78dbb97f 20URL: http://golang.org/
2ecef135
PG
21BuildRequires: bison
22BuildRequires: ed
30cbf052 23BuildRequires: rpm-pythonprov
602caf80
ER
24%if %{with tests}
25BuildRequires: hostname
26%endif
d5759e4c 27ExclusiveArch: %{ix86} %{x8664} %{arm}
2ecef135
PG
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
2502d5f0
ER
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
34
35%define _vimdatadir %{_datadir}/vim
36
37%ifarch %{ix86}
38%define GOARCH 386
39%endif
40%ifarch %{x8664}
41%define GOARCH amd64
42%endif
43
2ecef135 44%description
510be9c2
PG
45Go is an open source programming environment that makes it easy to
46build simple, reliable, and efficient software.
2ecef135 47
78dbb97f
JB
48%description -l pl.UTF-8
49Go to mające otwarte źródła środowisko do programowania, pozwalające
50na łatwe tworzenie prostych, pewnych i wydajnych programów.
51
2502d5f0 52%package -n vim-syntax-%{name}
78dbb97f
JB
53Summary: Go syntax files for Vim
54Summary(pl.UTF-8): Pliki składni Go dla Vima
2ecef135
PG
55Group: Applications/Editors
56Requires: %{name} = %{version}-%{release}
2502d5f0
ER
57Requires: vim-rt >= 4:7.2.170
58%if "%{_rpmversion}" >= "5"
59BuildArch: noarch
60%endif
2ecef135 61
2502d5f0 62%description -n vim-syntax-%{name}
2ecef135
PG
63Go syntax files for vim.
64
78dbb97f
JB
65%description -n vim-syntax-%{name} -l pl.UTF-8
66Pliki składni Go dla Vima.
67
2502d5f0 68%package -n emacs-%{name}
78dbb97f
JB
69Summary: Go mode for Emacs
70Summary(pl.UTF-8): Tryb Go dla Emacsa
2ecef135 71Group: Applications/Editors
2502d5f0
ER
72%if "%{_rpmversion}" >= "5"
73BuildArch: noarch
74%endif
2ecef135 75
2502d5f0 76%description -n emacs-%{name}
2ecef135
PG
77Go mode for Emacs.
78
78dbb97f
JB
79%description -n emacs-%{name} -l pl.UTF-8
80Tryb Go dla Emacsa.
81
2ecef135
PG
82%prep
83%setup -q -n go
84
30cbf052 85# broken tests
78dbb97f 86%{__rm} src/pkg/net/multicast_test.go
30cbf052 87
2ecef135 88%build
2502d5f0
ER
89GOSRC=$(pwd)
90GOROOT=$(pwd)
2ecef135
PG
91GOROOT_FINAL=%{_libdir}/%{name}
92
93GOOS=linux
2502d5f0
ER
94GOBIN=$GOROOT/bin
95GOARCH=%{GOARCH}
2ecef135 96export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL
2502d5f0 97export MAKE="%{__make}"
d5759e4c
JB
98export CC="%{__cc}"
99# optflags for go tools build
100nflags="\"$(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
2ecef135 103
2502d5f0 104install -d "$GOBIN"
2ecef135
PG
105cd src
106
107LC_ALL=C PATH="$PATH:$GOBIN" ./all.bash
108
109%install
110rm -rf $RPM_BUILD_ROOT
2502d5f0 111GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name}
2ecef135
PG
112
113install -d $GOROOT/{misc,lib,src}
114install -d $RPM_BUILD_ROOT%{_bindir}
115
116cp -a pkg include lib bin $GOROOT
117cp -a src/pkg src/cmd $GOROOT/src
118cp -a misc/cgo $GOROOT/misc
119
120ln -sf %{_libdir}/%{name}/bin/go $RPM_BUILD_ROOT%{_bindir}/go
121ln -sf %{_libdir}/%{name}/bin/godoc $RPM_BUILD_ROOT%{_bindir}/godoc
122ln -sf %{_libdir}/%{name}/bin/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
123
124ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}/cgo
125ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bindir}/ebnflint
126
127%ifarch %{ix86}
128tools="8a 8c 8g 8l"
d5759e4c
JB
129%endif
130%ifarch %{x8664}
2ecef135
PG
131tools="6a 6c 6g 6l"
132%endif
d5759e4c
JB
133%ifarch %{arm}
134tools="5a 5c 5g 5l"
135%endif
510be9c2 136for tool in $tools; do
2502d5f0 137 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
2ecef135
PG
138done
139
140install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
2502d5f0 141cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
2ecef135
PG
142
143VIMFILES="syntax/go.vim ftdetect/gofiletype.vim ftplugin/go/fmt.vim ftplugin/go/import.vim indent/go.vim"
144for i in $VIMFILES; do
b87ab065 145 install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i
2ecef135
PG
146done
147
2ecef135
PG
148%clean
149rm -rf $RPM_BUILD_ROOT
150
151%files
152%defattr(644,root,root,755)
153%doc AUTHORS CONTRIBUTORS LICENSE README doc/*
d5759e4c
JB
154%ifarch %{arm}
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
159%endif
160%ifarch %{x8664}
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
165%endif
166%ifarch %{ix86}
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
171%endif
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
2ecef135
PG
177%dir %{_libdir}/%{name}
178%dir %{_libdir}/%{name}/bin
179%attr(755,root,root) %{_libdir}/%{name}/bin/*
180
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}/*
191
2c8cd7b5 192%files -n vim-syntax-%{name}
2ecef135 193%defattr(644,root,root,755)
b87ab065
ER
194%{_vimdatadir}/ftdetect/gofiletype.vim
195%{_vimdatadir}/ftplugin/go
196%{_vimdatadir}/indent/go.vim
197%{_vimdatadir}/syntax/go.vim
2ecef135 198
2502d5f0 199%files -n emacs-%{name}
2ecef135
PG
200%defattr(644,root,root,755)
201%{_datadir}/emacs/site-lisp/go-mode*.el
This page took 0.052273 seconds and 4 git commands to generate.