mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-25 10:22:59 +02:00
Package the official Go compiler
Since Go has a horrible build system which requires a Go compiler to build the Go compiler and takes a very long time to compile, we are following Rust and are using the "official" pre-compiled release tarball. We no longer ship the Go runtime, which mitigates the risk of shipping any malware. Because we currently only have one package using this and which is only being compiled for x86_64, we are only making Go available on this architecture. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
eed179acdc
commit
d2315d00c2
10268
config/rootfiles/common/x86_64/go
Normal file
10268
config/rootfiles/common/x86_64/go
Normal file
File diff suppressed because it is too large
Load Diff
90
lfs/go
Normal file
90
lfs/go
Normal file
@@ -0,0 +1,90 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation, either version 3 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# Definitions
|
||||
###############################################################################
|
||||
|
||||
include Config
|
||||
|
||||
VER = 1.14.2
|
||||
|
||||
THISAPP = go-$(VER)
|
||||
DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz
|
||||
DL_FROM = $(URL_IPFIRE)
|
||||
DIR_APP = $(DIR_SRC)/go
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||
SUP_ARCH = x86_64
|
||||
|
||||
###############################################################################
|
||||
# Top-level Rules
|
||||
###############################################################################
|
||||
|
||||
objects = $(DL_FILE)
|
||||
|
||||
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
||||
|
||||
$(DL_FILE)_MD5 = 856d248e3ea8a287d13e5f6afd086282
|
||||
|
||||
install : $(TARGET)
|
||||
|
||||
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
|
||||
|
||||
download :$(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
|
||||
md5 : $(subst %,%_MD5,$(objects))
|
||||
|
||||
###############################################################################
|
||||
# Downloading, checking, md5sum
|
||||
###############################################################################
|
||||
|
||||
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
|
||||
@$(CHECK)
|
||||
|
||||
$(patsubst %,$(DIR_DL)/%,$(objects)) :
|
||||
@$(LOAD)
|
||||
|
||||
$(subst %,%_MD5,$(objects)) :
|
||||
@$(MD5)
|
||||
|
||||
###############################################################################
|
||||
# Installation Details
|
||||
###############################################################################
|
||||
|
||||
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@$(PREBUILD)
|
||||
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
|
||||
|
||||
-mkdir -pv /usr/lib/go
|
||||
cd $(DIR_APP) && cp -av bin pkg src lib misc api test /usr/lib/go
|
||||
|
||||
ln -svf /usr/lib/go/bin/go /usr/bin/go
|
||||
ln -svf /usr/lib/go/bin/gofmt /usr/bin/gofmt
|
||||
|
||||
cd $(DIR_APP) && install -v -m 644 VERSION /usr/lib/go/VERSION
|
||||
|
||||
# Remove some stuff not needed for production
|
||||
rm -rvf \
|
||||
/usr/lib/go/pkg/bootstrap \
|
||||
/usr/lib/go/pkg/tool/*/api \
|
||||
/usr/lib/go/pkg/obj/go-build/*
|
||||
|
||||
@rm -rf $(DIR_APP)
|
||||
@$(POSTBUILD)
|
||||
Reference in New Issue
Block a user