diff --git a/.gitignore b/.gitignore index 693206f..8e8e79c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/go.mod +/go.sum debian/aptly.debhelper.log debian/aptly.substvars debian/aptly/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index c0c66f3..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "src/github.com/aptly-dev/aptly"] - path = src/github.com/aptly-dev/aptly - url = https://github.com/molior-dbs/aptly.git diff --git a/debian/compat b/debian/compat index ec63514..b4de394 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -9 +11 diff --git a/debian/control b/debian/control index fe55cf0..d41b819 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: aptly Section: utils Priority: extra Maintainer: Sebastien Delafond -Build-Depends: debhelper (>= 9.0.0), golang (>= 2:1.7~5~bpo8+1), bash-completion, dh-systemd (>= 1.5) +Build-Depends: debhelper (>= 9.20160709), golang (>= 2:1.7~5~bpo8+1), bash-completion Standards-Version: 3.9.6 Homepage: http://www.aptly.info Vcs-Git: git://anonscm.debian.org/collab-maint/aptly.git diff --git a/debian/manpages b/debian/manpages index 6bde59c..c261d74 100644 --- a/debian/manpages +++ b/debian/manpages @@ -1 +1 @@ -src/github.com/aptly-dev/aptly/man/aptly.1 +man/aptly.1 diff --git a/debian/rules b/debian/rules index 79d7a27..a85559b 100755 --- a/debian/rules +++ b/debian/rules @@ -4,19 +4,26 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -SOURCE_DIR := $(CURDIR)/src/github.com/aptly-dev/aptly DEST_DIR := $(CURDIR)/debian/aptly +VERSION := $(shell dpkg-parsechangelog -S Version) +APTLY_VERSION := 814d4dbb %: - dh $@ --with systemd + dh $@ override_dh_auto_clean: rm -f aptly override_dh_auto_build: - GOPATH=$(CURDIR) go build -o aptly $(SOURCE_DIR)/main.go + rm -f go.mod + go mod init local/build + go mod edit -require github.com/aptly-dev/aptly@${APTLY_VERSION} + go build -o aptly -ldflags "-X main.Version=$(VERSION)" github.com/aptly-dev/aptly override_dh_auto_install: dh_bash-completion mkdir -p $(DEST_DIR)/usr/bin mv aptly $(DEST_DIR)/usr/bin/ + +override_dh_installman: + dh_installman --sourcedir=$(shell go env GOPATH)/pkg/mod/github.com/aptly-dev/aptly@$(shell go mod edit -print | grep aptly-dev | cut -d ' ' -f 3)/ diff --git a/src/github.com/aptly-dev/aptly b/src/github.com/aptly-dev/aptly deleted file mode 160000 index 3d2ccf1..0000000 --- a/src/github.com/aptly-dev/aptly +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3d2ccf1b2a02ea45eb0fa4fa7180b1809cb4590d