]>
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 | |
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 | 10 | Summary: Go compiler and tools |
78dbb97f | 11 | Summary(pl.UTF-8): Kompilator języka Go i narzędzia |
2ecef135 PG |
12 | Name: golang |
13 | Version: 1.0.3 | |
14 | Release: 0.1 | |
15 | License: BSD | |
16 | Group: Development/Languages | |
2ecef135 | 17 | Source0: http://go.googlecode.com/files/go%{version}.src.tar.gz |
510be9c2 | 18 | # Source0-md5: 31acddba58b4592242a3c3c16165866b |
78dbb97f | 19 | URL: http://golang.org/ |
2ecef135 PG |
20 | BuildRequires: bison |
21 | BuildRequires: ed | |
30cbf052 | 22 | BuildRequires: rpm-pythonprov |
602caf80 ER |
23 | %if %{with tests} |
24 | BuildRequires: hostname | |
25 | %endif | |
2ecef135 PG |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
27 | ||
2502d5f0 ER |
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 | |
32 | ||
33 | %define _vimdatadir %{_datadir}/vim | |
34 | ||
35 | %ifarch %{ix86} | |
36 | %define GOARCH 386 | |
37 | %endif | |
38 | %ifarch %{x8664} | |
39 | %define GOARCH amd64 | |
40 | %endif | |
41 | ||
2ecef135 | 42 | %description |
510be9c2 PG |
43 | Go is an open source programming environment that makes it easy to |
44 | build simple, reliable, and efficient software. | |
2ecef135 | 45 | |
78dbb97f JB |
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. | |
49 | ||
2502d5f0 | 50 | %package -n vim-syntax-%{name} |
78dbb97f JB |
51 | Summary: Go syntax files for Vim |
52 | Summary(pl.UTF-8): Pliki składni Go dla Vima | |
2ecef135 PG |
53 | Group: Applications/Editors |
54 | Requires: %{name} = %{version}-%{release} | |
2502d5f0 ER |
55 | Requires: vim-rt >= 4:7.2.170 |
56 | %if "%{_rpmversion}" >= "5" | |
57 | BuildArch: noarch | |
58 | %endif | |
2ecef135 | 59 | |
2502d5f0 | 60 | %description -n vim-syntax-%{name} |
2ecef135 PG |
61 | Go syntax files for vim. |
62 | ||
78dbb97f JB |
63 | %description -n vim-syntax-%{name} -l pl.UTF-8 |
64 | Pliki składni Go dla Vima. | |
65 | ||
2502d5f0 | 66 | %package -n emacs-%{name} |
78dbb97f JB |
67 | Summary: Go mode for Emacs |
68 | Summary(pl.UTF-8): Tryb Go dla Emacsa | |
2ecef135 | 69 | Group: Applications/Editors |
2502d5f0 ER |
70 | %if "%{_rpmversion}" >= "5" |
71 | BuildArch: noarch | |
72 | %endif | |
2ecef135 | 73 | |
2502d5f0 | 74 | %description -n emacs-%{name} |
2ecef135 PG |
75 | Go mode for Emacs. |
76 | ||
78dbb97f JB |
77 | %description -n emacs-%{name} -l pl.UTF-8 |
78 | Tryb Go dla Emacsa. | |
79 | ||
2ecef135 PG |
80 | %prep |
81 | %setup -q -n go | |
82 | ||
30cbf052 | 83 | # broken tests |
78dbb97f | 84 | %{__rm} src/pkg/net/multicast_test.go |
30cbf052 | 85 | |
2ecef135 | 86 | %build |
2502d5f0 ER |
87 | GOSRC=$(pwd) |
88 | GOROOT=$(pwd) | |
2ecef135 PG |
89 | GOROOT_FINAL=%{_libdir}/%{name} |
90 | ||
91 | GOOS=linux | |
2502d5f0 ER |
92 | GOBIN=$GOROOT/bin |
93 | GOARCH=%{GOARCH} | |
2ecef135 | 94 | export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL |
2502d5f0 | 95 | export MAKE="%{__make}" |
2ecef135 | 96 | |
2502d5f0 | 97 | install -d "$GOBIN" |
2ecef135 PG |
98 | cd src |
99 | ||
100 | LC_ALL=C PATH="$PATH:$GOBIN" ./all.bash | |
101 | ||
102 | %install | |
103 | rm -rf $RPM_BUILD_ROOT | |
2502d5f0 | 104 | GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name} |
2ecef135 PG |
105 | |
106 | install -d $GOROOT/{misc,lib,src} | |
107 | install -d $RPM_BUILD_ROOT%{_bindir} | |
108 | ||
109 | cp -a pkg include lib bin $GOROOT | |
110 | cp -a src/pkg src/cmd $GOROOT/src | |
111 | cp -a misc/cgo $GOROOT/misc | |
112 | ||
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 | |
116 | ||
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 | |
119 | ||
120 | %ifarch %{ix86} | |
121 | tools="8a 8c 8g 8l" | |
122 | %else | |
123 | tools="6a 6c 6g 6l" | |
124 | %endif | |
510be9c2 | 125 | for tool in $tools; do |
2502d5f0 | 126 | ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool |
2ecef135 PG |
127 | done |
128 | ||
129 | install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp | |
2502d5f0 | 130 | cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
2ecef135 PG |
131 | |
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 | |
b87ab065 | 134 | install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i |
2ecef135 PG |
135 | done |
136 | ||
2ecef135 PG |
137 | %clean |
138 | rm -rf $RPM_BUILD_ROOT | |
139 | ||
140 | %files | |
141 | %defattr(644,root,root,755) | |
142 | %doc AUTHORS CONTRIBUTORS LICENSE README doc/* | |
510be9c2 | 143 | %attr(755,root,root) %{_bindir}/* |
2ecef135 PG |
144 | %dir %{_libdir}/%{name} |
145 | %dir %{_libdir}/%{name}/bin | |
146 | %attr(755,root,root) %{_libdir}/%{name}/bin/* | |
147 | ||
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}/* | |
158 | ||
2c8cd7b5 | 159 | %files -n vim-syntax-%{name} |
2ecef135 | 160 | %defattr(644,root,root,755) |
b87ab065 ER |
161 | %{_vimdatadir}/ftdetect/gofiletype.vim |
162 | %{_vimdatadir}/ftplugin/go | |
163 | %{_vimdatadir}/indent/go.vim | |
164 | %{_vimdatadir}/syntax/go.vim | |
2ecef135 | 165 | |
2502d5f0 | 166 | %files -n emacs-%{name} |
2ecef135 PG |
167 | %defattr(644,root,root,755) |
168 | %{_datadir}/emacs/site-lisp/go-mode*.el |