From 73cdb9dc1499765ad01ac54a5802ce8c1971b4ff Mon Sep 17 00:00:00 2001 From: Bernd Ahlers Date: Wed, 11 Oct 2023 15:53:16 +0200 Subject: [PATCH] Add ARM64 binary and package builds --- Makefile | 14 ++++++++++++-- dist/recipearm64.rb | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 dist/recipearm64.rb diff --git a/Makefile b/Makefile index 0eab6ec..97a9195 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ test: ## Run tests build: ## Build sidecar binary for local target system $(GO) build $(BUILD_OPTS) -v -o graylog-sidecar -build-all: build-linux-armv7 build-linux build-linux32 build-windows build-windows32 build-darwin build-darwin-arm64 build-freebsd +build-all: build-linux-armv7 build-linux-arm64 build-linux build-linux32 build-windows build-windows32 build-darwin build-darwin-arm64 build-freebsd build-linux: ## Build sidecar binary for Linux @mkdir -p build/$(COLLECTOR_VERSION)/linux/amd64 @@ -55,6 +55,10 @@ build-linux-armv7: ## Build sidecar binary for linux-armv7 @mkdir -p build/$(COLLECTOR_VERSION)/linux/armv7 GOOS=linux GOARCH=arm GOARM=7 $(GO) build $(BUILD_OPTS) -pkgdir $(GOPATH)/go_linux-armv7 -v -o build/$(COLLECTOR_VERSION)/linux/armv7/graylog-sidecar +build-linux-arm64: ## Build sidecar binary for linux-arm64 + @mkdir -p build/$(COLLECTOR_VERSION)/linux/arm64 + GOOS=linux GOARCH=arm64 $(GO) build $(BUILD_OPTS) -pkgdir $(GOPATH)/go_linux-arm64 -v -o build/$(COLLECTOR_VERSION)/linux/arm64/graylog-sidecar + build-solaris: solaris-sigar-patch ## Build sidecar binary for Solaris/OmniOS/Illumos @mkdir -p build/$(COLLECTOR_VERSION)/solaris/amd64 GOOS=solaris GOARCH=amd64 $(GO) build $(BUILD_OPTS) -v -o build/$(COLLECTOR_VERSION)/solaris/amd64/graylog-sidecar @@ -99,7 +103,7 @@ sign-binary-windows-386: install-goversioninfo: go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest -package-all: prepare-package package-linux-armv7 package-linux package-linux32 package-windows package-tar +package-all: prepare-package package-linux-armv7 package-linux-arm64 package-linux package-linux32 package-windows package-tar prepare-package: dist/fetch_collectors.sh @@ -110,6 +114,12 @@ package-linux-armv7: ## Create Linux ARMv7 system package fpm-cook -t deb package dist/recipearmv7.rb fpm-cook -t rpm package dist/recipearmv7.rb +package-linux-arm64: ## Create Linux ARM64 system package + fpm-cook clean dist/recipearm64.rb + rm -rf dist/cache dist/tmp-build dist/tmp-dest + fpm-cook -t deb package dist/recipearm64.rb + fpm-cook -t rpm package dist/recipearm64.rb + package-linux: ## Create Linux amd64 system package fpm-cook clean dist/recipe.rb rm -rf dist/cache dist/tmp-build dist/tmp-dest diff --git a/dist/recipearm64.rb b/dist/recipearm64.rb new file mode 100644 index 0000000..eb7eb92 --- /dev/null +++ b/dist/recipearm64.rb @@ -0,0 +1,32 @@ +require_relative 'tools' + +class GraylogSidecar < FPM::Cookery::Recipe + description 'Graylog collector sidecar' + + name 'graylog-sidecar' + version data.version + revision data.revision + homepage 'https://graylog.org' + arch 'arm64' + + source "file:../../build/#{version}/linux/arm64/graylog-sidecar" + + maintainer 'Graylog, Inc. ' + vendor 'graylog' + license 'SSPL' + + config_files '/etc/graylog/sidecar/sidecar.yml' + + fpm_attributes rpm_os: 'linux' + + def build + end + + def install + bin.install 'graylog-sidecar' + etc('graylog/sidecar').install '../../../sidecar-example.yml', 'sidecar.yml' + var('lib/graylog-sidecar/generated').mkdir + var('log/graylog-sidecar').mkdir + var('run/graylog-sidecar').mkdir + end +end