fix Debian build

This commit is contained in:
Vasilii Alferov 2020-07-28 17:37:54 +01:00
parent 07cd3d4b8b
commit 79b3733241
No known key found for this signature in database
GPG Key ID: A00A34348063C211
3 changed files with 8 additions and 7 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
yq (3.3-0) focal; urgency=medium
yq (3.3.0) focal; urgency=medium
* You can control string styles (quotes) using the new --style flag
* String values now always have quotes when outputting to json

2
debian/control vendored
View File

@ -4,7 +4,7 @@ Priority: optional
Maintainer: Roberto Mier Escandón <rmescandon@gmail.com>
Build-Depends: debhelper (>=10),
dh-golang (>=1.34),
golang-1.13,
golang-go (>=1.13) | go (>=1.13) | go1.13,
rsync
Standards-Version: 4.1.4
Homepage: https://github.com/mikefarah/yq.git

11
debian/rules vendored
View File

@ -17,16 +17,17 @@
PROJECT := yq
OWNER := mikefarah
REPO := github.com
GOVERSION := 1.13
GO := $(shell which go)
export DH_OPTIONS
export DH_GOPKG := ${REPO}/${OWNER}/${PROJECT}
export GOROOT := /usr/lib/go-${GOVERSION}
export GOROOT := $($(GO) env GOROOT)
export GOPATH := ${CURDIR}/_build
export GOBIN := ${GOPATH}/bin
export PATH := ${GOROOT}/bin:${GOBIN}:${PATH}
export GOCACHE := /tmp/gocache
export GOFLAGS := -mod=vendor
export GOFLAGS := -mod=vendor -modcacherw
export CGO_ENABLED := 0
SRCDIR := ${GOPATH}/src/${DH_GOPKG}
DESTDIR := ${CURDIR}/debian/${PROJECT}
@ -42,10 +43,10 @@ override_dh_auto_build:
# copy project to local srcdir to build from there
rsync -avz --progress --exclude=_build --exclude=debian --exclude=tmp. --exclude=go.mod --exclude=docs . $(SRCDIR)
# build go code
(cd ${SRCDIR} && go install -buildmode=pie ./...)
(cd ${SRCDIR} && $(GO) mod vendor && $(GO) install -buildmode=pie ./...)
override_dh_auto_test:
(cd ${SRCDIR} && go test -v ./...)
(cd ${SRCDIR} && $(GO) test -v ./...)
override_dh_auto_install:
cp ${GOBIN}/yq ${DESTDIR}/${BINDIR}