Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #63 from chiefy/feature/nfpm
Browse files Browse the repository at this point in the history
deb/rpm builds with nfpm
  • Loading branch information
cjbassi committed Oct 22, 2018
2 parents 32e257d + 4bcf8a4 commit 0609656
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
gotop*
dist/
build/gotop
pkg/
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

VERSION=$(shell awk '/([0-9]{1}.?){3}/ {print $$4;}' main.go)

.PHONY: all
all: pkg/gotop.rpm pkg/gotop.deb

build/gotop:
@GOOS=linux GOARCH=amd64 go build -o $@

pkg:
@mkdir $@

pkg/gotop.rpm: pkg build/gotop
@docker run --rm \
-v "$(PWD)/build:/tmp/pkg" \
-e "VERSION=$(VERSION)" \
goreleaser/nfpm pkg \
--config /tmp/pkg/gotop-nfpm.yaml \
--target /tmp/pkg/gotop.rpm \
&& mv ./build/gotop.rpm $@

pkg/gotop.deb: pkg build/gotop
@docker run --rm \
-v "$(PWD)/build:/tmp/pkg" \
-e "VERSION=$(VERSION)" \
goreleaser/nfpm pkg \
--config /tmp/pkg/gotop-nfpm.yaml \
--target /tmp/pkg/gotop.deb \
&& mv ./build/gotop.deb $@

.PHONY: clean
clean:
@-rm -f build/gotop
@-rm -rf pkg
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ To make a custom colorscheme, check out the [template](https://github.com/cjbass
`-p`, `--percpu` Show each CPU in the CPU widget.
`-a`, `--averagecpu` Show average CPU in the CPU widget.


## Building deb/rpms

To build dep/rpms using [nfpm](https://github.com/goreleaser/nfpm):

```bash
make all
```

This will place the built packages into the `pkg` folder.

## Credits

- [mdnazmulhasan27771](https://github.com/mdnazmulhasan27771) for the [logo](https://github.com/cjbassi/gotop/blob/master/assets/logo.png)
Expand Down
15 changes: 15 additions & 0 deletions build/gotop-nfpm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "gotop"
arch: "amd64"
platform: "linux"
version: "v${VERSION}"
section: "default"
priority: "extra"
maintainer: "Caleb Bassi <[email protected]>"
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:
/tmp/pkg/gotop: "/usr/local/bin/gotop"

0 comments on commit 0609656

Please sign in to comment.