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