2010-10-08 16:25:58 +02:00
|
|
|
#
|
2011-11-04 10:06:56 +01:00
|
|
|
# spec file for package go
|
|
|
|
#
|
2014-08-12 09:18:55 +02:00
|
|
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2011-03-21 16:16:38 +01:00
|
|
|
# Copyright (c) 2011, Sascha Peilicke <saschpe@gmx.de>
|
2010-10-08 16:25:58 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2011-11-04 10:06:56 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2012-02-08 10:24:23 +01:00
|
|
|
|
2010-10-08 16:25:58 +02:00
|
|
|
Name: go
|
2014-09-09 16:52:11 +02:00
|
|
|
Version: 1.3.1
|
2011-06-30 11:18:52 +02:00
|
|
|
Release: 0
|
2010-10-08 16:25:58 +02:00
|
|
|
Summary: A compiled, garbage-collected, concurrent programming language
|
2011-09-02 11:15:17 +02:00
|
|
|
License: BSD-3-Clause
|
2013-08-13 09:25:05 +02:00
|
|
|
Group: Development/Languages/Other
|
|
|
|
Url: http://golang.org
|
2014-08-12 09:43:08 +02:00
|
|
|
Source0: http://golang.org/dl/go%{version}.src.tar.gz
|
2014-08-12 09:18:55 +02:00
|
|
|
Source1: go-rpmlintrc
|
2011-02-17 11:34:25 +01:00
|
|
|
Source2: go.sh
|
2011-05-19 20:17:10 +02:00
|
|
|
Source3: macros.go
|
2014-09-18 11:18:45 +02:00
|
|
|
Source4: go-wiki-gadget.xml
|
2012-08-15 03:10:55 +02:00
|
|
|
Source5: README-openSUSE
|
2012-02-08 10:24:23 +01:00
|
|
|
# PATCH-FIX-OPENSUSE add -s flag to 'go install' (don't rebuild/install std libs)
|
2013-10-18 15:05:09 +02:00
|
|
|
Patch1: go-build-dont-reinstall-stdlibs.patch
|
2012-04-02 05:00:41 +02:00
|
|
|
# PATCH-FIX-OPENSUSE re-enable build binary only packages (we are binary distro)
|
|
|
|
# see http://code.google.com/p/go/issues/detail?id=2775 & also issue 3268
|
2013-10-18 15:05:09 +02:00
|
|
|
Patch2: allow-binary-only-packages.patch
|
2013-05-15 05:38:25 +02:00
|
|
|
#PATCH-FIX-OPENSUSE use -x verbose build output for qemu-arm builders
|
2013-10-18 15:05:09 +02:00
|
|
|
Patch3: verbose-build.patch
|
2012-09-05 06:10:28 +02:00
|
|
|
# PATCH-FIX-OPENSUSE BNC#776058
|
2013-10-18 15:05:09 +02:00
|
|
|
Patch4: go-install-dont-reinstall-stdlibs.patch
|
2014-09-18 11:18:45 +02:00
|
|
|
# PATCH-FIX-OPENSUSE enable writing tools outside $GOROOT/pkg/tool for packaging
|
|
|
|
Patch5: tools-packaging.patch
|
2010-10-08 16:25:58 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2013-05-15 05:38:25 +02:00
|
|
|
BuildRequires: rpm
|
2012-03-07 13:05:43 +01:00
|
|
|
%if 0%{?suse_version} >= 1210
|
2013-05-15 05:38:25 +02:00
|
|
|
BuildRequires: mercurial
|
2012-03-06 05:25:38 +01:00
|
|
|
BuildRequires: systemd
|
2012-03-07 13:05:43 +01:00
|
|
|
%endif
|
2012-06-05 16:11:33 +02:00
|
|
|
%if 0%{?suse_version} >= 1100
|
2011-05-18 13:09:25 +02:00
|
|
|
BuildRequires: fdupes
|
2010-11-09 19:54:11 +01:00
|
|
|
Recommends: go-doc
|
2013-07-19 01:23:23 +02:00
|
|
|
#BNC#818502 debug edit tool of rpm fails on i586 builds
|
|
|
|
%if 0%{?suse_version} > 1230
|
|
|
|
BuildRequires: rpm >= 4.11.1
|
|
|
|
%endif
|
2012-06-05 16:11:33 +02:00
|
|
|
%endif
|
2014-09-18 11:18:45 +02:00
|
|
|
Requires: gcc
|
2012-08-15 03:10:55 +02:00
|
|
|
Provides: go-devel = %{name}%{version}
|
|
|
|
Provides: go-devel-static = %{name}%{version}
|
|
|
|
Obsoletes: go-devel < %{name}%{version}
|
2012-01-03 10:22:32 +01:00
|
|
|
ExclusiveArch: %ix86 x86_64 %arm
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Go is an expressive, concurrent, garbage collected systems programming language
|
|
|
|
that is type safe and memory safe. It has pointers but no pointer arithmetic.
|
|
|
|
Go has fast builds, clean syntax, garbage collection, methods for any type, and
|
|
|
|
run-time reflection. It feels like a dynamic language but has the speed and
|
|
|
|
safety of a static language.
|
|
|
|
|
|
|
|
%package doc
|
2012-04-02 11:37:35 +02:00
|
|
|
Summary: Go documentation
|
2010-10-08 16:25:58 +02:00
|
|
|
Group: Documentation/Other
|
2011-03-21 16:14:21 +01:00
|
|
|
Requires: %{name} = %{version}
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%description doc
|
|
|
|
Go examples and documentation.
|
|
|
|
|
|
|
|
%package vim
|
|
|
|
Summary: Go syntax files for Vim
|
|
|
|
Group: Productivity/Text/Editors
|
2011-03-21 16:14:21 +01:00
|
|
|
Requires: %{name} = %{version}
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%description vim
|
|
|
|
Vim syntax highlighting scheme for the Go programming language.
|
|
|
|
|
|
|
|
%package emacs
|
|
|
|
Summary: Go language syntax files for Emacs
|
|
|
|
Group: Productivity/Text/Editors
|
2011-03-21 16:14:21 +01:00
|
|
|
Requires: %{name} = %{version}
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%description emacs
|
|
|
|
Emacs syntax highlighting scheme for the Go programming language.
|
|
|
|
|
|
|
|
%prep
|
2010-12-08 17:27:49 +01:00
|
|
|
%setup -q -n %{name}
|
2013-07-10 14:34:19 +02:00
|
|
|
%patch1 -p1
|
2013-10-18 15:05:09 +02:00
|
|
|
%patch2 -p1
|
2011-12-13 15:55:11 +01:00
|
|
|
%patch3 -p1
|
2012-04-02 05:00:41 +02:00
|
|
|
%patch4 -p1
|
2014-09-18 11:18:45 +02:00
|
|
|
%patch5 -p1
|
2012-03-06 05:25:38 +01:00
|
|
|
cp %{SOURCE5} .
|
2010-10-08 16:25:58 +02:00
|
|
|
|
2011-10-06 13:06:36 +02:00
|
|
|
# setup go_arch (BSD-like scheme)
|
2014-09-25 16:44:02 +02:00
|
|
|
cp %{SOURCE3} go.macros
|
2011-10-06 13:06:36 +02:00
|
|
|
%ifarch %ix86
|
2014-09-25 16:44:02 +02:00
|
|
|
sed -i 's|GOARCH|386|' go.macros
|
2011-10-06 13:06:36 +02:00
|
|
|
%define go_arch 386
|
|
|
|
%endif
|
|
|
|
%ifarch x86_64
|
2014-09-25 16:44:02 +02:00
|
|
|
sed -i 's|GOARCH|amd64|' go.macros
|
2011-10-06 13:06:36 +02:00
|
|
|
%define go_arch amd64
|
|
|
|
%endif
|
|
|
|
%ifarch %arm
|
2014-09-25 16:44:02 +02:00
|
|
|
sed -i 's|GOARCH|arm|' go.macros
|
2011-10-06 13:06:36 +02:00
|
|
|
%define go_arch arm
|
|
|
|
%endif
|
|
|
|
|
2010-10-08 16:25:58 +02:00
|
|
|
%build
|
2010-11-08 22:29:08 +01:00
|
|
|
export GOROOT="`pwd`"
|
2012-03-06 05:25:38 +01:00
|
|
|
export GOROOT_FINAL=%{_libdir}/go
|
2010-11-08 22:29:08 +01:00
|
|
|
export GOBIN="$GOROOT/bin"
|
2010-10-08 16:25:58 +02:00
|
|
|
mkdir -p "$GOBIN"
|
2011-05-19 22:36:34 +02:00
|
|
|
cd src
|
2012-03-06 05:25:38 +01:00
|
|
|
HOST_EXTRA_CFLAGS="%{optflags} -Wno-error" ./make.bash
|
2010-10-08 16:25:58 +02:00
|
|
|
|
2013-05-15 05:38:25 +02:00
|
|
|
%ifarch x86_64
|
|
|
|
# Install race detection version of std libraries (amd64 only)
|
|
|
|
cd ../
|
|
|
|
bin/go install -race std
|
|
|
|
%endif
|
2013-08-14 15:51:53 +02:00
|
|
|
%ifarch %ix86
|
2013-10-18 15:05:09 +02:00
|
|
|
strip $GOBIN/go # bnc#818502
|
2013-08-14 15:51:53 +02:00
|
|
|
%endif
|
2013-05-15 05:38:25 +02:00
|
|
|
|
2010-10-08 16:25:58 +02:00
|
|
|
%install
|
2011-04-29 20:34:27 +02:00
|
|
|
export GOROOT="%{buildroot}%{_libdir}/%{name}"
|
2013-05-15 05:38:25 +02:00
|
|
|
# bash completion seems broken
|
|
|
|
#install -Dm644 misc/bash/go %%{buildroot}%%{_sysconfdir}/bash_completion.d/go.sh
|
2011-04-29 20:34:27 +02:00
|
|
|
install -Dm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/go.sh
|
|
|
|
install -Dm644 misc/emacs/go-mode-load.el %{buildroot}%{_datadir}/emacs/site-lisp/go-mode-load.el
|
|
|
|
install -Dm644 misc/emacs/go-mode.el %{buildroot}%{_datadir}/emacs/site-lisp/go-mode.el
|
2012-03-10 19:49:47 +01:00
|
|
|
install -Dm644 misc/vim/autoload/go/complete.vim %{buildroot}%{_datadir}/vim/site/autoload/go/complete.vim
|
|
|
|
install -d %{buildroot}%{_datadir}/vim/site/ftplugin/go
|
2013-05-15 05:38:25 +02:00
|
|
|
install -Dm644 misc/vim/ftplugin/go/{fmt,import}.vim %{buildroot}%{_datadir}/vim/site/ftplugin/go/
|
2012-03-10 19:49:47 +01:00
|
|
|
install -Dm644 misc/vim/indent/go.vim %{buildroot}%{_datadir}/vim/site/indent/go.vim
|
|
|
|
install -Dm644 misc/vim/plugin/godoc.vim %{buildroot}%{_datadir}/vim/site/plugin/godoc.vim
|
|
|
|
install -Dm644 misc/vim/syntax/godoc.vim %{buildroot}%{_datadir}/vim/site/syntax/godoc.vim
|
2011-04-29 20:34:27 +02:00
|
|
|
install -Dm644 misc/vim/syntax/go.vim %{buildroot}%{_datadir}/vim/site/syntax/go.vim
|
|
|
|
install -Dm644 misc/vim/ftdetect/gofiletype.vim %{buildroot}%{_datadir}/vim/site/ftdetect/gofiletype.vim
|
2012-03-05 18:07:14 +01:00
|
|
|
|
2012-05-09 17:04:39 +02:00
|
|
|
# locations for third party libraries, see README-openSUSE for info about locations.
|
2014-09-26 16:25:10 +02:00
|
|
|
install -d %{buildroot}%{_datadir}/go/contrib
|
|
|
|
install -d $GOROOT/contrib/pkg/linux_%{go_arch}
|
|
|
|
ln -s %{_libdir}/%{name}/contrib/pkg/ %{buildroot}%{_datadir}/go/contrib/pkg
|
|
|
|
install -d %{buildroot}%{_datadir}/go/contrib/cmd
|
|
|
|
install -d %{buildroot}%{_datadir}/go/contrib/src
|
|
|
|
install -Dm644 README-openSUSE $GOROOT/contrib/
|
|
|
|
ln -s %{_libdir}/go/contrib/README-openSUSE %{buildroot}%{_datadir}/go/contrib/README-openSUSE
|
2012-05-09 17:04:39 +02:00
|
|
|
|
2012-03-05 18:07:14 +01:00
|
|
|
# source files for go install, godoc, etc
|
2014-09-26 16:25:10 +02:00
|
|
|
install -d %{buildroot}%{_datadir}/go
|
2012-03-06 05:25:38 +01:00
|
|
|
for ext in *.{go,c,h,s,S,py}; do
|
2011-04-29 20:34:27 +02:00
|
|
|
find src -name ${ext} -exec install -Dm644 \{\} %{buildroot}%{_datadir}/go/\{\} \;
|
2011-02-17 11:34:25 +01:00
|
|
|
done
|
2012-03-05 18:07:14 +01:00
|
|
|
mkdir -p $GOROOT/src
|
2012-01-25 04:57:43 +01:00
|
|
|
ln -s /usr/share/go/src/pkg $GOROOT/src/pkg
|
|
|
|
ln -s /usr/share/go/src/cmd $GOROOT/src/cmd
|
2011-02-17 11:34:25 +01:00
|
|
|
|
2012-08-16 13:34:24 +02:00
|
|
|
# copy document templates, packages, obj libs and command utilities
|
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
|
|
mkdir -p $GOROOT/lib
|
|
|
|
mv pkg $GOROOT
|
|
|
|
mv bin/* %{buildroot}%{_bindir}
|
|
|
|
rm -f %{buildroot}%{_bindir}/{hgpatch,quietgcc}
|
|
|
|
|
2011-05-21 14:19:45 +02:00
|
|
|
# documentation and examples
|
|
|
|
# fix documetation permissions (rpmlint warning)
|
|
|
|
find doc/ misc/ -type f -exec chmod 0644 '{}' \;
|
|
|
|
# remove unwanted arch-dependant binaries (rpmlint warning)
|
2011-06-30 11:18:52 +02:00
|
|
|
rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8}
|
|
|
|
rm -f misc/dashboard/builder/{gobuilder,*6,*.8}
|
|
|
|
rm -f misc/goplay/{goplay,*.6,*.8}
|
2011-12-02 14:33:26 +01:00
|
|
|
rm -rf misc/windows
|
2011-06-30 11:18:52 +02:00
|
|
|
rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8}
|
2013-03-22 19:03:45 +01:00
|
|
|
# remove kate syntax file, it is shipped with libktexteditor already
|
|
|
|
rm -f misc/kate/go.xml
|
2011-02-02 13:51:53 +01:00
|
|
|
|
2011-10-07 14:02:52 +02:00
|
|
|
# install RPM macros ($GOARCH prepared in %%prep section)
|
2014-09-25 16:44:02 +02:00
|
|
|
install -Dm644 go.macros %{buildroot}%{_sysconfdir}/rpm/macros.go
|
2011-05-19 20:17:10 +02:00
|
|
|
|
2011-05-21 14:19:45 +02:00
|
|
|
# break hard links
|
|
|
|
rm %{buildroot}%{_libdir}/go/pkg/linux_%{go_arch}/{cgocall,runtime}.h
|
2011-05-21 14:30:13 +02:00
|
|
|
ln -s %{_datadir}/go/src/pkg/runtime/{cgocall,runtime}.h %{buildroot}%{_libdir}/go/pkg/linux_%{go_arch}/
|
2011-05-21 14:19:45 +02:00
|
|
|
|
2011-08-02 13:55:49 +02:00
|
|
|
# Disable brp-strip-static-archive breaks build
|
|
|
|
%define __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib/rpm/[^/]*/?brp-strip-static-archive %{__strip}!!g')
|
|
|
|
|
2012-06-05 16:11:33 +02:00
|
|
|
%if 0%{?suse_version} >= 1100
|
2011-06-30 11:18:52 +02:00
|
|
|
%fdupes %{buildroot}%{_prefix}
|
2012-06-05 16:11:33 +02:00
|
|
|
%endif
|
2011-05-18 13:09:25 +02:00
|
|
|
|
2010-10-08 16:25:58 +02:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
2012-05-09 17:04:39 +02:00
|
|
|
%doc AUTHORS CONTRIBUTORS LICENSE PATENTS README README-openSUSE
|
2012-07-11 14:36:49 +02:00
|
|
|
%ifarch %ix86
|
|
|
|
%{_libdir}/go/pkg/tool/linux_%{go_arch}/8*
|
|
|
|
%endif
|
|
|
|
%ifarch x86_64
|
|
|
|
%{_libdir}/go/pkg/tool/linux_%{go_arch}/6*
|
|
|
|
%endif
|
|
|
|
%ifarch %arm
|
|
|
|
%{_libdir}/go/pkg/tool/linux_%{go_arch}/5*
|
|
|
|
%endif
|
2012-08-23 14:08:58 +02:00
|
|
|
%{_datadir}/go/
|
2010-10-08 16:25:58 +02:00
|
|
|
%{_bindir}/go*
|
2014-09-26 16:25:10 +02:00
|
|
|
%{_libdir}/go/
|
2013-05-15 05:38:25 +02:00
|
|
|
# bash completion seems broken
|
|
|
|
#%%config %{_sysconfdir}/bash_completion.d/go.sh
|
2011-02-03 18:47:56 +01:00
|
|
|
%config %{_sysconfdir}/profile.d/go.sh
|
2011-05-19 22:36:34 +02:00
|
|
|
%config %{_sysconfdir}/rpm/macros.go
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root,-)
|
2012-11-06 14:48:04 +01:00
|
|
|
%doc doc
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%files vim
|
|
|
|
%defattr(-,root,root,-)
|
2012-03-10 19:49:47 +01:00
|
|
|
%dir %{_datadir}/vim
|
|
|
|
%{_datadir}/vim/*
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%files emacs
|
|
|
|
%defattr(-,root,root,-)
|
2012-02-04 11:55:47 +01:00
|
|
|
%{_datadir}/emacs/site-lisp/go-mode*
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%changelog
|