]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - lfs/go
Run ./make.sh update-contributors
[people/pmueller/ipfire-2.x.git] / lfs / go
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 VER = 1.15.4
28
29 THISAPP = go-$(VER)
30 DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz
31 DL_FROM = $(URL_IPFIRE)
32 DIR_APP = $(DIR_SRC)/go
33 TARGET = $(DIR_INFO)/$(THISAPP)
34 SUP_ARCH = aarch64 x86_64
35
36 ###############################################################################
37 # Top-level Rules
38 ###############################################################################
39
40 objects = $(DL_FILE)
41
42 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
43
44 go$(VER).$(GOOS)-arm64.tar.gz_BLAKE2 = ef1708965bcd415fdad498e27729d0259f83e16a542f37dae1fb70f71127dfa0cb8570e4896474e6a94bb461e16ff8000e8072bc731c637fce5f384227359e14
45 go$(VER).$(GOOS)-amd64.tar.gz_BLAKE2 = d200046147e31fac1a754fc34ac4a5043414a1d6e90aa3387c933c395acede0b8d5b797affaa85c2188af4d15566b4fcd08108350fe73ed90b1c305600c655c9
46
47 install : $(TARGET)
48
49 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
50
51 download :$(patsubst %,$(DIR_DL)/%,$(objects))
52
53 b2 : $(subst %,%_BLAKE2,$(objects))
54
55 ###############################################################################
56 # Downloading, checking, b2sum
57 ###############################################################################
58
59 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
60 @$(CHECK)
61
62 $(patsubst %,$(DIR_DL)/%,$(objects)) :
63 @$(LOAD)
64
65 $(subst %,%_BLAKE2,$(objects)) :
66 @$(B2SUM)
67
68 ###############################################################################
69 # Installation Details
70 ###############################################################################
71
72 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
73 @$(PREBUILD)
74 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
75
76 -mkdir -pv /usr/lib/go
77 cd $(DIR_APP) && cp -av bin pkg src lib misc api test /usr/lib/go
78
79 ln -svf /usr/lib/go/bin/go /usr/bin/go
80 ln -svf /usr/lib/go/bin/gofmt /usr/bin/gofmt
81
82 cd $(DIR_APP) && install -v -m 644 VERSION /usr/lib/go/VERSION
83
84 # Remove some stuff not needed for production
85 rm -rvf \
86 /usr/lib/go/pkg/bootstrap \
87 /usr/lib/go/pkg/tool/*/api \
88 /usr/lib/go/pkg/obj/go-build/*
89
90 @rm -rf $(DIR_APP)
91 @$(POSTBUILD)