]> git.pld-linux.org Git - packages/golang.git/blob - golang.spec
d0bd612115b58862da7b345bfee049731ca5b2d4
[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 Name:           golang
12 Version:        1.0.3
13 Release:        0.1
14 License:        BSD
15 Group:          Development/Languages
16 URL:            http://golang.org/
17 Source0:        http://go.googlecode.com/files/go%{version}.src.tar.gz
18 # Source0-md5:  31acddba58b4592242a3c3c16165866b
19 BuildRequires:  bison
20 BuildRequires:  ed
21 BuildRequires:  rpm-pythonprov
22 %if %{with tests}
23 BuildRequires:  hostname
24 %endif
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define _enable_debug_packages 0
28 %define no_install_post_strip 1
29 %define no_install_post_chrpath 1
30 %define _noautoreqfiles %{_libdir}/%{name}/src
31
32 %define         _vimdatadir     %{_datadir}/vim
33
34 %ifarch %{ix86}
35 %define GOARCH 386
36 %endif
37 %ifarch %{x8664}
38 %define GOARCH amd64
39 %endif
40
41 %description
42 Go is an open source programming environment that makes it easy to
43 build simple, reliable, and efficient software.
44
45 %package -n vim-syntax-%{name}
46 Summary:        go syntax files for vim
47 Group:          Applications/Editors
48 Requires:       %{name} = %{version}-%{release}
49 Requires:       vim-rt >= 4:7.2.170
50 %if "%{_rpmversion}" >= "5"
51 BuildArch:      noarch
52 %endif
53
54 %description -n vim-syntax-%{name}
55 Go syntax files for vim.
56
57 %package -n emacs-%{name}
58 Summary:        go syntax files for emacs
59 Group:          Applications/Editors
60 %if "%{_rpmversion}" >= "5"
61 BuildArch:      noarch
62 %endif
63
64 %description -n emacs-%{name}
65 Go mode for Emacs.
66
67 %prep
68 %setup -q -n go
69
70 # broken tests
71 rm src/pkg/net/multicast_test.go
72
73 %build
74 GOSRC=$(pwd)
75 GOROOT=$(pwd)
76 GOROOT_FINAL=%{_libdir}/%{name}
77
78 GOOS=linux
79 GOBIN=$GOROOT/bin
80 GOARCH=%{GOARCH}
81 export GOARCH GOROOT GOOS GOBIN GOROOT_FINAL
82 export MAKE="%{__make}"
83
84 install -d "$GOBIN"
85 cd src
86
87 LC_ALL=C PATH="$PATH:$GOBIN" ./all.bash
88
89 %install
90 rm -rf $RPM_BUILD_ROOT
91 GOROOT=$RPM_BUILD_ROOT%{_libdir}/%{name}
92
93 install -d $GOROOT/{misc,lib,src}
94 install -d $RPM_BUILD_ROOT%{_bindir}
95
96 cp -a pkg include lib bin $GOROOT
97 cp -a src/pkg src/cmd $GOROOT/src
98 cp -a misc/cgo $GOROOT/misc
99
100 ln -sf %{_libdir}/%{name}/bin/go $RPM_BUILD_ROOT%{_bindir}/go
101 ln -sf %{_libdir}/%{name}/bin/godoc $RPM_BUILD_ROOT%{_bindir}/godoc
102 ln -sf %{_libdir}/%{name}/bin/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt
103
104 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}/cgo
105 ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/ebnflint $RPM_BUILD_ROOT%{_bindir}/ebnflint
106
107 %ifarch %{ix86}
108 tools="8a 8c 8g 8l"
109 %else
110 tools="6a 6c 6g 6l"
111 %endif
112 for tool in $tools; do
113         ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/$tool $RPM_BUILD_ROOT%{_bindir}/$tool
114 done
115
116 install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
117 cp -p misc/emacs/go*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
118
119 VIMFILES="syntax/go.vim ftdetect/gofiletype.vim ftplugin/go/fmt.vim ftplugin/go/import.vim indent/go.vim"
120 for i in $VIMFILES; do
121         install -Dp misc/vim/$i $RPM_BUILD_ROOT%{_vimdatadir}/$i
122 done
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127 %files
128 %defattr(644,root,root,755)
129 %doc AUTHORS CONTRIBUTORS LICENSE README doc/*
130 %attr(755,root,root) %{_bindir}/*
131 %dir %{_libdir}/%{name}
132 %dir %{_libdir}/%{name}/bin
133 %attr(755,root,root) %{_libdir}/%{name}/bin/*
134
135 %{_libdir}/%{name}/include
136 %{_libdir}/%{name}/lib
137 %{_libdir}/%{name}/misc
138 %{_libdir}/%{name}/src
139 %dir %{_libdir}/%{name}/pkg
140 %{_libdir}/%{name}/pkg/linux_%{GOARCH}
141 %{_libdir}/%{name}/pkg/obj
142 %dir %{_libdir}/%{name}/pkg/tool
143 %dir %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}
144 %attr(755,root,root) %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/*
145
146 %files -n vim-syntax-%{name}
147 %defattr(644,root,root,755)
148 %{_vimdatadir}/ftdetect/gofiletype.vim
149 %{_vimdatadir}/ftplugin/go
150 %{_vimdatadir}/indent/go.vim
151 %{_vimdatadir}/syntax/go.vim
152
153 %files -n emacs-%{name}
154 %defattr(644,root,root,755)
155 %{_datadir}/emacs/site-lisp/go-mode*.el
This page took 0.036924 seconds and 2 git commands to generate.