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