You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

134 lines
4.3 KiB

##
## go-bootstrap.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2022 OpenPKG Project <http://openpkg.org/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package information
Name: go-bootstrap
Summary: The Go Programming Language (Bootstrap Version 1.4)
URL: http://golang.org/
Vendor: Robert Griesemer, Rob Pike, Ken Thompson
Packager: OpenPKG Project
Distribution: OpenPKG Community
Class: PLUS
Group: Language
License: BSD
Version: 1.4.3
Release: 20170723
# list of sources
Source0: http://golang.org/dl/go%{version}.src.tar.gz
Patch0: go-bootstrap.patch
# build information
BuildPreReq: OpenPKG, openpkg >= 20160101, gcc, make, bison, flex
PreReq: OpenPKG, openpkg >= 20160101, gcc, x509
BuildPreReq: go-cc
PreReq: go-cc
%description
Go is a concurrent garbage-collected system programming language,
designed 2007 by Robert Griesemer, Rob Pike and Ken Thompson at
Google. Go is expressive, concise, clean, and efficient. Its
concurrency mechanisms make it easy to write programs that get
the most out of multicore and networked machines, while its novel
type system enables flexible and modular program construction. Go
compiles quickly to machine code yet has the convenience of garbage
collection and the power of run-time reflection. It's a fast,
statically typed, compiled language that feels like a dynamically
typed, interpreted language.
%track
prog go-bootstrap = {
version = %{version}
url = http://golang.org/dl/
regex = go(1\.4\.\d+)\.src\.tar\.gz
}
%prep
%setup -q -n go
%patch -p0
%build
# patch the patch
%{l_shtool} subst %{l_value -s -a} \
src/crypto/x509/root_unix.go
# configure package
export GOROOT="`pwd`"
export GOBIN="`pwd`/bin"
export GOROOT_FINAL="%{l_prefix}/lib/go-bootstrap"
export GOOS=""
export GOARCH=""
export CGO_ENABLED=0
case "%{l_platform -t}" in
*-freebsd* ) GOOS="freebsd" ;;
*-linux* ) GOOS="linux" ;;
*-macosx* ) GOOS="darwin" ;;
esac
case "%{l_platform -t}" in
ix86-* ) GOARCH="386" ;;
amd64-* ) GOARCH="amd64" ;;
esac
if [ ".$GOOS" = . -o ".$GOARCH" = . ]; then
echo "ERROR: platform not supported" 1>&2
exit 1
fi
# provide the dedicated C compiler wrapper
# (which is also available later for Go to compile)
export CC="%{l_prefix}/bin/go-cc"
# build program
%{l_shtool} mkdir -f -p -m 755 $GOBIN
cd src
%{l_bash} make.bash
%install
# cleanup source tree
rm -rf bin-tmp
rm -f [A-R]* favicon.ico robots.txt
rm -rf doc misc test
# create installation hierarchy
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/bin \
$RPM_BUILD_ROOT%{l_prefix}/lib/go-bootstrap
# install program
cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/go-bootstrap/
# install wrapper executables
for prg in go gofmt; do
( echo "#!/bin/sh"
echo "exec %{l_prefix}/lib/go-bootstrap/bin/$prg \${1+\"\$@\"}"
) >$prg
%{l_shtool} install -c -m 755 \
$prg $RPM_BUILD_ROOT%{l_prefix}/bin/${prg}-bootstrap
done
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%files -f files
%clean