Search
SailfishOS Open Build Service
>
Projects
>
home:eenemo
:
branches:nemo:devel:mw
>
go
> go.spec
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File go.spec of Package go
Name: go Version: 1.0.3 Release: 1 Summary: A compiled, garbage-collected, concurrent programming language License: BSD-3-Clause Group: Development/Languages/Other Url: http://golang.org Source0: http://go.googlecode.com/files/go%{version}.src.tar.gz Provides: go-devel = %{name}%{version} Provides: go-devel-static = %{name}%{version} Obsoletes: go-devel < %{name}%{version} #The Go compilers support three instruction sets. There are important differences in the quality of the compilers for the different architectures. ExclusiveArch: %ix86 x86_64 %arm %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 Requires: %{name} = %{version} %description doc Go examples and documentation. %prep %setup -q -n %{name} # setup go_arch (BSD-like scheme) %ifarch %ix86 # 386 (a.k.a. x86 or x86-32); 8g,8l,8c,8a %define go_arch 386 %endif %ifarch x86_64 # amd64 (a.k.a. x86-64); 6g,6l,6c,6a %define go_arch amd64 %endif %ifarch %arm # arm (a.k.a. ARM); 5g,5l,5c,5a %define go_arch arm #Starting from Go 1.1, the appropriate GOARM value will be chosen if you compile Go from source on the target machine. In cross compilation situations, it is recommended that you always export an appropriate GOARM value. #ARMv6 supported GOARM=6 is the default value %endif %build export GOROOT="`pwd`" export GOROOT_FINAL=%{_libdir}/go export GOBIN="$GOROOT/bin" mkdir -p "$GOBIN" cd src #echo %{optflags} #TODO: set env var before make to match optflags?: #GO_GCFLAGS: Additional 5g/6g/8g arguments to use when # building the packages and commands. ./make.bash %if ! 0%{?qemu_user_space_build} echo "check: running tests on uninstalled code" bash run.bash --no-rebuild %endif %install echo "> > install" #default goroot would be /usr/local/go. export GOROOT="%{buildroot}%{_libdir}/%{name}" #place src in libdir (i.e., goroot); only minimal stuff to datadir (/usr/share). # source files for go install, godoc, etc install -d %{buildroot}%{_datadir}/go mkdir -p $GOROOT/src for ext in *.{go,c,h,s,S,py}; do find src -name ${ext} -exec install -Dm644 \{\} $GOROOT/\{\} \; done #all the built-in-place stuff has to be moved/copied/installed. #install of no use for recursive dirs. # copy document templates, packages, obj libs and command utilities install -d $GOROOT/lib cp -ar lib/godoc $GOROOT/lib #do we need the _race libs for anything besides testing? rm -fr pkg/linux_%{go_arch}_race #compiled stuff may be stale cp -dR pkg $GOROOT mkdir -p %{buildroot}%{_bindir} cp -ar bin/* %{buildroot}%{_bindir} # locations for third party libraries (empty) install -d $GOROOT/contrib/pkg/linux_%{go_arch} install -d $GOROOT/contrib/src/pkg install -d $GOROOT/contrib/src/cmd # documentation and examples # fix documetation permissions (rpmlint warning) # #find doc/ misc/ -type f -exec chmod 0644 '{}' \; # remove unwanted arch-dependant binaries (rpmlint warning) # #rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8} # #rm -f misc/dashboard/builder/{gobuilder,*6,*.8} # #rm -f misc/goplay/{goplay,*.6,*.8} # #rm -rf misc/windows # #rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8} # # Disable brp-strip-static-archive breaks build #symptom: #/usr/bin/strip:/home/d/rpmbuild/BUILDROOT/go-1.1-1.x86_64/usr/lib64/go/pkg/linux_amd64/crypto/hmac.a(_go_.6): Unable to recognise the format of file: File format not recognized echo "WARNING: redefining os_install_post" %define __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib/rpm/[^/]*/?brp-strip-static-archive %{__strip}!!g') %pre %post %preun %postun %files %defattr(-,root,root,-) %doc AUTHORS CONTRIBUTORS LICENSE PATENTS README %{_bindir}/go* %{_libdir}/go/ %files doc %defattr(-,root,root,-) %doc doc