aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-03-08 01:34:50 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-03-08 01:34:50 +0300
commit1e8772a04041dd512e9ee1ff922758db6b3a6116 (patch)
treec68c2860756bbc64309cb95ed7ef71aa7b7a1d5b
parentdebian: add Vagrantfile for building packages (diff)
downloadlinux-status-1e8772a04041dd512e9ee1ff922758db6b3a6116.tar.gz
linux-status-1e8772a04041dd512e9ee1ff922758db6b3a6116.zip
debian: more one-liners in Makefile
-rw-r--r--debian/Makefile83
-rw-r--r--debian/gbp.conf1
2 files changed, 70 insertions, 14 deletions
diff --git a/debian/Makefile b/debian/Makefile
index 74a8a18..254b9df 100644
--- a/debian/Makefile
+++ b/debian/Makefile
@@ -7,22 +7,79 @@ SHELL := bash
escape = $(subst ','\'',$(1))
-makefile_dir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
-repo_dir := $(makefile_dir)/..
-build_area_dir := $(makefile_dir)/build-area
+# Don't expand parameters:
+define escape_arg
+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
-.PHONY: build/src
-build/src:
- pushd '$(call escape,$(repo_dir))' && gbp buildpackage -S
+PPA_OWNER ?= egor-tensin
+PPA_NAME ?= linux-status
+GPG_KEY ?= 3B3EF1235420917E0DB0723991D679FB92B036CB
+DIST ?= focal
-.PHONY: build/bin
-build/bin:
- pushd '$(call escape,$(repo_dir))' && gbp buildpackage
+$(eval $(call escape_arg,PPA_OWNER))
+$(eval $(call escape_arg,PPA_NAME))
+$(eval $(call escape_arg,GPG_KEY))
+$(eval $(call escape_arg,DIST))
-.PHONY: build/pbuilder
-build/pbuilder:
- pushd '$(call escape,$(repo_dir))' && gbp buildpackage --git-pbuilder --git-dist=focal --git-arch=amd64
+this_dir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+root := $(this_dir)/..
+build_area := $(this_dir)/build-area
+
+.PHONY: DO
+DO:
+
+.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)' {} ';'
+
+upload/%: DO
+ find '$(call escape,$(build_area))' -type f -name '*.changes' -exec dput 'ppa:$(call escape,$(PPA_OWNER))/$(call escape,$(PPA_NAME))/ubuntu/$*' {} ';'
+
+.PHONY: upload-all
+upload-all: upload/bionic upload/focal upload/groovy
.PHONY: clean
clean:
- rm -rf -- '$(call escape,$(build_area_dir))'
+ rm -rf -- '$(call escape,$(build_area))'
diff --git a/debian/gbp.conf b/debian/gbp.conf
index 51b688e..a32554f 100644
--- a/debian/gbp.conf
+++ b/debian/gbp.conf
@@ -4,4 +4,3 @@ debian-branch = debian
debian-tag = debian/v%(version)s
pristine-tar = False
export-dir = debian/build-area/
-builder = debuild -i -I -k3B3EF1235420917E0DB0723991D679FB92B036CB