2010-10-08 16:25:58 +02:00
|
|
|
#
|
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.
|
|
|
|
|
|
|
|
Name: go
|
2011-08-02 10:19:31 +02:00
|
|
|
Version: 0.0.r59
|
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
|
|
|
|
Group: Development/Languages/Other
|
2011-03-21 16:14:21 +01:00
|
|
|
License: BSD3c
|
2011-07-10 17:54:26 +02:00
|
|
|
URL: http://golang.org
|
2011-03-21 16:14:21 +01:00
|
|
|
Source0: go-%{version}.tar.bz2
|
2011-06-30 11:18:52 +02:00
|
|
|
Source1: rpmlintrc
|
2011-02-17 11:34:25 +01:00
|
|
|
Source2: go.sh
|
2011-05-19 20:17:10 +02:00
|
|
|
Source3: macros.go
|
2011-06-30 11:18:52 +02:00
|
|
|
# PATCH-FIX-OPENSUSE adjust documentation paths
|
|
|
|
Patch1: go-godoc-path-locations.patch
|
2011-07-10 17:54:26 +02:00
|
|
|
# PATCH-FIX-UPSTREAM fix various compiler warnings
|
2011-06-30 11:18:52 +02:00
|
|
|
#Patch2: go-fix-werrors.patch
|
2010-10-08 16:25:58 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2011-05-19 20:17:10 +02:00
|
|
|
BuildRequires: ed
|
|
|
|
BuildRequires: bison
|
2011-07-10 17:54:26 +02:00
|
|
|
BuildRequires: mercurial
|
2011-06-15 16:51:05 +02:00
|
|
|
%if 0%{?suse_version} > 1020
|
2011-05-18 13:09:25 +02:00
|
|
|
BuildRequires: fdupes
|
2010-11-09 19:54:11 +01:00
|
|
|
Recommends: go-doc
|
2010-10-08 16:25:58 +02:00
|
|
|
%endif
|
2011-05-20 16:44:12 +02:00
|
|
|
Provides: libcgo = %{version}
|
2011-05-21 14:19:45 +02:00
|
|
|
Provides: go-devel-static = %{version}
|
|
|
|
Provides: go-devel = %{version}
|
|
|
|
Obsoletes: go-devel < %{version}
|
2011-05-19 20:23:17 +02: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
|
|
|
|
Summary: Go documentation
|
|
|
|
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.
|
|
|
|
|
|
|
|
%package kate
|
|
|
|
Summary: Go syntax files for Kate and KWrite editors
|
|
|
|
Group: Productivity/Text/Editors
|
2011-03-21 16:14:21 +01:00
|
|
|
Requires: %{name} = %{version}
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%description kate
|
|
|
|
Kate syntax highlighting scheme for the Go programming language.
|
|
|
|
|
|
|
|
%prep
|
2010-12-08 17:27:49 +01:00
|
|
|
%setup -q -n %{name}
|
2011-02-03 18:47:56 +01:00
|
|
|
%patch1 -p1
|
2011-06-30 11:18:52 +02:00
|
|
|
#%%patch2 -p1
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%build
|
2010-11-08 22:29:08 +01:00
|
|
|
export GOROOT="`pwd`"
|
|
|
|
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
|
2011-06-30 11:18:52 +02:00
|
|
|
HOST_EXTRA_CFLAGS="%{optflags} -Wno-error" ./make.bash
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%install
|
2011-04-29 20:34:27 +02:00
|
|
|
export GOROOT="%{buildroot}%{_libdir}/%{name}"
|
|
|
|
install -Dm644 misc/bash/go %{buildroot}%{_sysconfdir}/bash_completion.d/go
|
|
|
|
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
|
|
|
|
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
|
|
|
|
install -Dm644 misc/kate/go.xml %{buildroot}%{_datadir}/kde4/apps/katepart/syntax/go.xml
|
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
|
|
mkdir -p %{buildroot}%{_sbindir}
|
|
|
|
cp -r bin/* %{buildroot}%{_bindir}
|
|
|
|
mv %{buildroot}%{_bindir}/goinstall %{buildroot}%{_sbindir}/goinstall
|
|
|
|
rm -f %{buildroot}%{_bindir}/{hgpatch,quietgcc}
|
2010-11-16 10:08:21 +01:00
|
|
|
mkdir -p $GOROOT/src
|
2010-11-16 21:48:02 +01:00
|
|
|
install -m644 src/Make.{ccmd,clib,cmd,common,inc,pkg} $GOROOT/src
|
|
|
|
|
2011-05-21 14:19:45 +02:00
|
|
|
# source files for goinstall, godoc, etc
|
|
|
|
install -d %{buildroot}%{_datadir}/go
|
2011-05-19 20:17:10 +02:00
|
|
|
for ext in *.{go,c,h}; 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
|
|
|
|
|
2011-05-21 14:19:45 +02:00
|
|
|
# replace $GOROOT in several scripts
|
|
|
|
sed -i 's|GOROOT=.*$|GOROOT=%{_libdir}/go|g' %{buildroot}%{_bindir}/gomake
|
|
|
|
sed -i 's|GOROOT=.*$|GOROOT=%{_libdir}/go|g' %{buildroot}%{_bindir}/gotry
|
2011-05-19 22:36:34 +02:00
|
|
|
|
2011-04-29 20:34:27 +02:00
|
|
|
install -Dm644 lib/{lib9.a,libbio.a,libmach.a} %{buildroot}%{_libdir}
|
2010-10-08 16:25:58 +02:00
|
|
|
cp -r lib/godoc $GOROOT/lib
|
2010-11-16 21:48:02 +01:00
|
|
|
cp -r pkg $GOROOT
|
|
|
|
|
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 doc/codelab/wiki/{htmlify.bin,srcextract.bin}
|
|
|
|
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-06-15 15:34:00 +02:00
|
|
|
rm misc/swig/{callback/run,stdio/hello}
|
2011-06-30 11:18:52 +02:00
|
|
|
rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8}
|
2011-05-18 13:09:25 +02:00
|
|
|
# fix bnc#686557, contains image licensed under non-commercial license
|
|
|
|
rm doc/talks/go_talk-20091030.pdf
|
2011-02-02 13:51:53 +01:00
|
|
|
|
2011-05-20 11:29:51 +02:00
|
|
|
# install RPM macros and set proper go_arch (BSD-like scheme)
|
|
|
|
%ifarch %ix86
|
|
|
|
sed -i 's|GOARCH|386|' %{SOURCE3}
|
2011-05-21 14:19:45 +02:00
|
|
|
%define go_arch 386
|
2011-05-20 11:29:51 +02:00
|
|
|
%endif
|
|
|
|
%ifarch x86_64
|
|
|
|
sed -i 's|GOARCH|amd64|' %{SOURCE3}
|
2011-05-21 14:19:45 +02:00
|
|
|
%define go_arch amd64
|
2011-05-20 11:29:51 +02:00
|
|
|
%endif
|
|
|
|
%ifarch %arm
|
|
|
|
sed -i 's|GOARCH|arm|' %{SOURCE3}
|
2011-05-21 14:19:45 +02:00
|
|
|
%define go_arch arm
|
2011-05-20 11:29:51 +02:00
|
|
|
%endif
|
2011-05-19 20:17:10 +02:00
|
|
|
install -Dm644 %{SOURCE3} %{buildroot}%{_sysconfdir}/rpm/macros.go
|
|
|
|
|
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-06-15 16:51:05 +02:00
|
|
|
%if 0%{?suse_version} > 1020
|
2011-06-30 11:18:52 +02:00
|
|
|
%fdupes %{buildroot}%{_prefix}
|
2011-06-15 16:51:05 +02:00
|
|
|
%endif
|
2011-05-18 13:09:25 +02:00
|
|
|
|
2010-10-08 16:25:58 +02:00
|
|
|
%clean
|
2011-04-29 20:34:27 +02:00
|
|
|
rm -rf %{buildroot}
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
2011-05-18 13:09:25 +02:00
|
|
|
%doc AUTHORS CONTRIBUTORS LICENSE PATENTS README
|
2010-10-08 16:25:58 +02:00
|
|
|
%ifarch %ix86
|
|
|
|
%{_bindir}/8*
|
|
|
|
%endif
|
|
|
|
%{_bindir}/6*
|
|
|
|
%{_bindir}/cgo
|
|
|
|
%{_bindir}/ebnflint
|
|
|
|
%{_bindir}/go*
|
2011-05-21 14:19:45 +02:00
|
|
|
%{_sbindir}/goinstall
|
|
|
|
%{_libdir}/lib9.a
|
|
|
|
%{_libdir}/libbio.a
|
|
|
|
%{_libdir}/libmach.a
|
|
|
|
%{_libdir}/go/
|
|
|
|
%{_datadir}/go/
|
2010-10-08 16:25:58 +02:00
|
|
|
%config %{_sysconfdir}/bash_completion.d/go
|
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,-)
|
2011-05-21 14:19:45 +02:00
|
|
|
%doc doc misc
|
2010-10-08 16:25:58 +02:00
|
|
|
|
|
|
|
%files vim
|
|
|
|
%defattr(-,root,root,-)
|
2011-05-20 16:44:12 +02:00
|
|
|
%dir %{_datadir}/vim
|
|
|
|
%dir %{_datadir}/vim/site
|
|
|
|
%dir %{_datadir}/vim/site/ftdetect
|
|
|
|
%dir %{_datadir}/vim/site/syntax
|
2010-10-08 16:25:58 +02:00
|
|
|
%{_datadir}/vim/site/syntax/go.vim
|
|
|
|
%{_datadir}/vim/site/ftdetect/gofiletype.vim
|
|
|
|
|
|
|
|
%files emacs
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_datadir}/emacs/site-lisp/go-mode*.el
|
|
|
|
|
|
|
|
%files kate
|
|
|
|
%defattr(-,root,root,-)
|
2011-05-20 16:44:12 +02:00
|
|
|
%dir %{_datadir}/kde4
|
|
|
|
%dir %{_datadir}/kde4/apps
|
|
|
|
%dir %{_datadir}/kde4/apps/katepart
|
|
|
|
%dir %{_datadir}/kde4/apps/katepart/syntax
|
2010-10-08 16:25:58 +02:00
|
|
|
%{_datadir}/kde4/apps/katepart/syntax/go.xml
|
|
|
|
|
|
|
|
%changelog
|