forked from serbaut/go-rpm-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
go.spec
58 lines (49 loc) · 1.49 KB
/
go.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Name: go
Version: 1.2
Release: 1%{?dist}
Summary: Go development tools
Group: Development/Languages
License: BSD
URL: http://golang.org
Source: https://go.googlecode.com/files/%{name}%{version}.src.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gcc
AutoReqProv: no
%define __spec_install_post %{nil}
%description
Go is an open source programming environment that makes
it easy to build simple, reliable, and efficient software.
This package also includes support for cross compiling to
windows/amd64 and darwin/amd64.
%prep
%setup -q -n go
%build
cd src
unset GOROOT GOBIN
export GOROOT_FINAL=%{_libdir}/go
for os in linux darwin windows; do
for arch in amd64; do
GOOS=$os GOARCH=$arch ./make.bash --no-clean
done
done
%install
rm -rf %{buildroot}
install -d %{buildroot}%{_libdir}/go
cp -a pkg src %{buildroot}%{_libdir}/go
install -d %{buildroot}%{_bindir}
install -m 755 bin/{go,gofmt} %{buildroot}%{_bindir}
install -d %{buildroot}%{_includedir}/go
cp -a include/* %{buildroot}%{_includedir}/go
install -d %{buildroot}%{_datadir}/go
cp -a lib misc %{buildroot}%{_datadir}/go
install -D misc/bash/go %{buildroot}%{_sysconfdir}/bash_completion.d/go
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc AUTHORS CONTRIBUTORS LICENSE PATENTS README VERSION api doc/*
%{_libdir}/go
%{_bindir}/*
%{_datadir}/go
%{_includedir}/go
%{_sysconfdir}/bash_completion.d/go