]> git.pld-linux.org Git - packages/golang.git/blob - golang.spec
- pl
[packages/golang.git] / golang.spec
1 # TODO
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
5
6 # Conditional build:
7 %bcond_without  tests   # build without tests
8 %bcond_without  verbose # verbose build (V=1)
9
10 Summary:        Go compiler and tools
11 Summary(pl.UTF-8):      Kompilator języka Go i narzędzia
12 Name:           golang
13 Version:        1.0.3
14 Release:        0.1
15 License:        BSD
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/
20 BuildRequires:  bison
21 BuildRequires:  ed
22 BuildRequires:  rpm-pythonprov
23 %if %{with tests}
24 BuildRequires:  hostname
25 %endif
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
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
42 %description
43 Go is an open source programming environment that makes it easy to
44 build simple, reliable, and efficient software.
45
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
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"
57 BuildArch:      noarch
58 %endif
59
60 %description -n vim-syntax-%{name}
61 Go syntax files for vim.
62
63 %description -n vim-syntax-%{name} -l pl.UTF-8
64 Pliki składni Go dla Vima.
65
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"
71 BuildArch:      noarch
72 %endif
73
74 %description -n emacs-%{name}
75 Go mode for Emacs.
76
77 %description -n emacs-%{name} -l pl.UTF-8
78 Tryb Go dla Emacsa.
79
80 %prep
81 %setup -q -n go
82
83 # broken tests
84 %{__rm} src/pkg/net/multicast_test.go
85
86 %build
87 GOSRC=$(pwd)
88 GOROOT=$(pwd)
89 GOROOT_FINAL=%{_libdir}/%{name}
90
91 GOOS=linux
92 GOBIN=$GOROOT/bin
93 GOARCH=%{GOARCH}
94 export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL
95 export MAKE="%{__make}"
96
97 install -d "$GOBIN"
98 cd src
99
100 LC_ALL=C PATH="$PATH:$GOBIN" ./all.bash
101
102 %install
103 rm -rf $RPM_BUILD_ROOT
104 GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name}
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
125 for tool in $tools; do
126         ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
127 done
128
129 install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
130 cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
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
134         install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i
135 done
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %files
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/*
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
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
165
166 %files -n emacs-%{name}
167 %defattr(644,root,root,755)
168 %{_datadir}/emacs/site-lisp/go-mode*.el
This page took 0.082683 seconds and 3 git commands to generate.