summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Bassi <calebjbassi@gmail.com>2018-10-22 19:18:06 -0700
committerCaleb Bassi <calebjbassi@gmail.com>2018-10-22 19:18:06 -0700
commit69e35642681740364c5b01aff18895c326f8f263 (patch)
tree9fcd4001b9801df5f036e15188ba779b0e10ce90
parent0609656e22a3d403b7d0d1073f83d7661041c93e (diff)
Cleanup merge from chiefy:feature/nfpm
-rw-r--r--.gitignore3
-rw-r--r--Makefile32
-rw-r--r--README.md7
-rw-r--r--build/gotop-nfpm.yml (renamed from build/gotop-nfpm.yaml)2
4 files changed, 20 insertions, 24 deletions
diff --git a/.gitignore b/.gitignore
index 0e27b06..9b11b36 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,2 @@
dist/
-build/gotop
-pkg/ \ No newline at end of file
+gotop
diff --git a/Makefile b/Makefile
index 7ddce40..9a31df0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,34 +1,32 @@
-
VERSION=$(shell awk '/([0-9]{1}.?){3}/ {print $$4;}' main.go)
-.PHONY: all
-all: pkg/gotop.rpm pkg/gotop.deb
+.PHONY: default
+default: dist/gotop.rpm dist/gotop.deb
-build/gotop:
+dist/gotop:
@GOOS=linux GOARCH=amd64 go build -o $@
-pkg:
+dist:
@mkdir $@
-pkg/gotop.rpm: pkg build/gotop
+dist/gotop.rpm: dist dist/gotop
@docker run --rm \
- -v "$(PWD)/build:/tmp/pkg" \
+ -v "$(PWD)/build:/tmp/build" \
+ -v "$(PWD)/dist:/tmp/dist" \
-e "VERSION=$(VERSION)" \
goreleaser/nfpm pkg \
- --config /tmp/pkg/gotop-nfpm.yaml \
- --target /tmp/pkg/gotop.rpm \
- && mv ./build/gotop.rpm $@
+ --config /tmp/build/gotop-nfpm.yml \
+ --target /tmp/dist/gotop.rpm
-pkg/gotop.deb: pkg build/gotop
+dist/gotop.deb: dist dist/gotop
@docker run --rm \
- -v "$(PWD)/build:/tmp/pkg" \
+ -v "$(PWD)/build:/tmp/build" \
+ -v "$(PWD)/dist:/tmp/dist" \
-e "VERSION=$(VERSION)" \
goreleaser/nfpm pkg \
- --config /tmp/pkg/gotop-nfpm.yaml \
- --target /tmp/pkg/gotop.deb \
- && mv ./build/gotop.deb $@
+ --config /tmp/build/gotop-nfpm.yml \
+ --target /tmp/dist/gotop.deb
.PHONY: clean
clean:
- @-rm -f build/gotop
- @-rm -rf pkg \ No newline at end of file
+ @-rm -rf dist
diff --git a/README.md b/README.md
index 0cb6b6d..7021e93 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ Working and tested on Linux and OSX. Windows support is planned.
Clone the repo and then run [scripts/download.sh](https://github.com/cjbassi/gotop/blob/master/scripts/download.sh) to download the correct binary for your system from the [releases tab](https://github.com/cjbassi/gotop/releases):
-```sh
+```bash
git clone --depth 1 https://github.com/cjbassi/gotop /tmp/gotop
/tmp/gotop/scripts/download.sh
```
@@ -38,7 +38,7 @@ brew install gotop
### Source
-```sh
+```bash
go get github.com/cjbassi/gotop
```
@@ -81,7 +81,6 @@ 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):
@@ -90,7 +89,7 @@ To build dep/rpms using [nfpm](https://github.com/goreleaser/nfpm):
make all
```
-This will place the built packages into the `pkg` folder.
+This will place the built packages into the `dist` folder.
## Credits
diff --git a/build/gotop-nfpm.yaml b/build/gotop-nfpm.yml
index a15824a..1e9501a 100644
--- a/build/gotop-nfpm.yaml
+++ b/build/gotop-nfpm.yml
@@ -12,4 +12,4 @@ 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"
+ /tmp/dist/gotop: "/usr/local/bin/gotop"