From 16c469d714ee8b38f605afd353e4e95d0be87085 Mon Sep 17 00:00:00 2001 From: Christopher Najewicz Date: Fri, 12 Oct 2018 10:03:00 -0400 Subject: [PATCH] Work-in-progress adding nfpm --- Makefile | 13 +++++++++++++ build/nfpm.yaml | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Makefile create mode 100644 build/nfpm.yaml diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..7eec9d0d --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ + +VERSION=$(shell awk '/([0-9]{1}.?){3}/ {print $$4;}' main.go) + +build/gotop: + @go build + +build/nfpm.rpm: + @docker run --rm \ + -v "$(PWD)/build:/tmp/pkg" \ + -e "VERSION=$(VERSION)" \ + goreleaser/nfpm pkg \ + --config /tmp/pkg/nfpm.yaml \ + --target /tmp/pkg/nfpm.rpm diff --git a/build/nfpm.yaml b/build/nfpm.yaml new file mode 100644 index 00000000..14801080 --- /dev/null +++ b/build/nfpm.yaml @@ -0,0 +1,24 @@ +name: "gotop" +arch: "amd64" +platform: "linux" +version: "v${VERSION}" +section: "default" +priority: "extra" +maintainer: "Caleb Bassi " +description: | + A terminal based graphical activity monitor inspired by gtop and vtop +vendor: "Caleb Bassi" +homepage: "https://github.com/cjbassi/gotop" +license: "GNU Affero General Public License v3.0" +bindir: "/usr/local/bin" +files: + ./gotop: "/usr/local/bin/gotop" +overrides: + rpm: + scripts: + preinstall: ./scripts/preinstall.sh + postremove: ./scripts/postremove.sh + deb: + scripts: + postinstall: ./scripts/postinstall.sh + preremove: ./scripts/preremove.sh