blockbook/build/templates/backend/Makefile
kevin d6aaa09e06
Add Arbitrum One and Arbitrum Nova Support (#1112)
* add arbitrum one and arbitrum nova support

* fix archive parent chain ports

* fix exec script config

* update nitro-node version
2024-11-25 21:36:07 +01:00

40 lines
1.3 KiB
Makefile

{{define "main" -}}
ARCHIVE := $(shell basename {{.Backend.BinaryURL}})
all:
mkdir backend
{{- if ne .Backend.DockerImage "" }}
docker container inspect extract > /dev/null 2>&1 && docker rm extract || true
docker create --name extract {{.Backend.DockerImage}}
{{- if eq .Backend.VerificationType "docker"}}
[ "$$(docker inspect --format='{{`{{index .RepoDigests 0}}`}}' {{.Backend.DockerImage}} | sed 's/.*@sha256://')" = "{{.Backend.VerificationSource}}" ]
{{- end}}
{{.Backend.ExtractCommand}}
docker rm extract
{{- else }}
wget {{.Backend.BinaryURL}}
{{- if eq .Backend.VerificationType "gpg"}}
wget {{.Backend.VerificationSource}} -O checksum
gpg --verify checksum ${ARCHIVE}
{{- else if eq .Backend.VerificationType "gpg-sha256"}}
wget {{.Backend.VerificationSource}} -O checksum
gpg --verify checksum
sha256sum -c --ignore-missing checksum
{{- else if eq .Backend.VerificationType "sha256"}}
[ "$$(sha256sum ${ARCHIVE} | cut -d ' ' -f 1)" = "{{.Backend.VerificationSource}}" ]
{{- end}}
{{.Backend.ExtractCommand}} ${ARCHIVE}
{{- end}}
{{- if .Backend.ExcludeFiles}}
# generated from exclude_files
{{- range $index, $name := .Backend.ExcludeFiles}}
rm backend/{{$name}}
{{- end}}
{{- end}}
clean:
rm -rf backend
rm -f ${ARCHIVE}
rm -f checksum
{{end}}