aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/debian/Makefile
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-04-28 21:31:54 +0000
committerEgor Tensin <Egor.Tensin@gmail.com>2021-04-29 01:42:02 +0300
commit44001e1f1fb81601827b8212f81f5b1760ae9231 (patch)
treede9204b6191fb05592f43015989f4bcaaef13d75 /debian/Makefile
parentREADME update (diff)
downloadconfig-links-debian/v0.1-1.tar.gz
config-links-debian/v0.1-1.zip
add Debian packaging filesdebian/v0.1-1
Basically copied them from my other project linux-status.
Diffstat (limited to 'debian/Makefile')
-rw-r--r--debian/Makefile93
1 files changed, 93 insertions, 0 deletions
diff --git a/debian/Makefile b/debian/Makefile
new file mode 100644
index 0000000..4ea98d5
--- /dev/null
+++ b/debian/Makefile
@@ -0,0 +1,93 @@
+MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables
+unexport MAKEFLAGS
+.DEFAULT_GOAL := all
+.DELETE_ON_ERROR:
+.SUFFIXES:
+SHELL := bash
+# Careful: nounset breaks things, as per usual.
+.SHELLFLAGS := -e -o pipefail -c
+
+.PHONY: DO
+DO:
+
+escape = $(subst ','\'',$(1))
+
+define noexpand
+ifeq ($$(origin $(1)),environment)
+ $(1) := $$(value $(1))
+endif
+ifeq ($$(origin $(1)),environment override)
+ $(1) := $$(value $(1))
+endif
+ifeq ($$(origin $(1)),command line)
+ override $(1) := $$(value $(1))
+endif
+endef
+
+PPA_OWNER ?= egor-tensin
+PPA_NAME ?= config-links
+GPG_KEY ?= 3B3EF1235420917E0DB0723991D679FB92B036CB
+DIST ?= bionic
+
+$(eval $(call noexpand,PPA_OWNER))
+$(eval $(call noexpand,PPA_NAME))
+$(eval $(call noexpand,GPG_KEY))
+$(eval $(call noexpand,DIST))
+
+this_dir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+root := $(this_dir)/..
+build_area := $(this_dir)/build-area
+
+.PHONY: deps
+deps:
+ apt-get update
+ apt-get install -y build-essential devscripts dh-make git-buildpackage
+
+.PHONY: dch
+dch:
+ gbp dch --distribution=unstable
+
+.PHONY: tag
+tag:
+ pushd '$(call escape,$(root))' && gbp buildpackage --git-tag-only
+
+.PHONY: src/test
+src/test:
+ pushd '$(call escape,$(root))' && gbp buildpackage --git-ignore-new -S -us -uc
+
+.PHONY: src
+src:
+ pushd '$(call escape,$(root))' && gbp buildpackage -S '-k0x$(call escape,$(GPG_KEY))'
+
+.PHONY: bin/test
+bin/test:
+ pushd '$(call escape,$(root))' && gbp buildpackage --git-ignore-new -b -us -uc
+
+.PHONY: bin
+bin:
+ pushd '$(call escape,$(root))' && gbp buildpackage -b '-k0x$(call escape,$(GPG_KEY))'
+
+.PHONY: dist/create
+dist/create:
+ pushd '$(call escape,$(root))' && env 'DIST=$(call escape,$(DIST))' git-pbuilder create
+
+.PHONY: dist/update
+dist/update:
+ pushd '$(call escape,$(root))' && env 'DIST=$(call escape,$(DIST))' git-pbuilder update
+
+.PHONY: dist/test
+dist/test:
+ pushd '$(call escape,$(root))' && gbp buildpackage --git-ignore-new --git-pbuilder '--git-dist=$(call escape,$(DIST))'
+
+.PHONY: dist
+dist:
+ pushd '$(call escape,$(root))' && gbp buildpackage --git-pbuilder '--git-dist=$(call escape,$(DIST))'
+ pushd '$(call escape,$(root))' && debsign '-k0x$(call escape,$(GPG_KEY))' --debs-dir '$(call escape,$(build_area))'
+
+.PHONY: upload
+upload:
+ find '$(call escape,$(build_area))' -type f -name '*.changes' -exec dput 'ppa:$(call escape,$(PPA_OWNER))/$(call escape,$(PPA_NAME))/ubuntu/$(DIST)' {} ';'
+
+.PHONY: clean
+clean:
+ rm -rf -- '$(call escape,$(build_area))'