From 93cbdc0ca88d46454b96043d8baf4b231e91474a Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 3 May 2018 10:03:25 +0300 Subject: [PATCH] Add debian packaging and some build scripts --- .gitignore | 5 ++++- deb/DEBIAN/control | 7 +++++++ scripts/build | 2 ++ scripts/coverage | 8 ++++++++ scripts/lint | 2 ++ scripts/package | 6 ++++++ 6 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 deb/DEBIAN/control create mode 100755 scripts/build create mode 100755 scripts/coverage create mode 100755 scripts/lint create mode 100755 scripts/package diff --git a/.gitignore b/.gitignore index 915ccf5..9458a59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ .idea/ +target/ gomuks -gomuks.exe +*.exe +*.deb coverage.out coverage.html +deb/usr diff --git a/deb/DEBIAN/control b/deb/DEBIAN/control new file mode 100644 index 0000000..0af23c6 --- /dev/null +++ b/deb/DEBIAN/control @@ -0,0 +1,7 @@ +Package: gomuks +Version: 0.0.0-1 +Section: net +Priority: optional +Architecture: amd64 +Maintainer: Tulir Asokan +Description: A terminal based Matrix client written in Go. diff --git a/scripts/build b/scripts/build new file mode 100755 index 0000000..832ca13 --- /dev/null +++ b/scripts/build @@ -0,0 +1,2 @@ +#!/bin/bash +go build -o target/gomuks diff --git a/scripts/coverage b/scripts/coverage new file mode 100755 index 0000000..c52d4a6 --- /dev/null +++ b/scripts/coverage @@ -0,0 +1,8 @@ +#!/bin/bash +mkdir -p target/ +go test ./... -coverprofile=target/coverage.out +if [ ! -z $1 ]; then + go tool cover -html=coverage.out -o $1 +else + go tool cover -html=coverage.out +fi diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 0000000..06957b8 --- /dev/null +++ b/scripts/lint @@ -0,0 +1,2 @@ +#!/bin/bash +golint ./... | grep -v "should have comment" | grep -v "vendor/" diff --git a/scripts/package b/scripts/package new file mode 100755 index 0000000..158439f --- /dev/null +++ b/scripts/package @@ -0,0 +1,6 @@ +#!/bin/bash +mkdir -p deb/usr/bin/ +mkdir -p target/ +go build -o deb/usr/bin/gomuks +version=$(cat deb/DEBIAN/control | grep Version | awk '{ print $2 }') +dpkg-deb --build deb target/gomuks-$version.deb