summaryrefslogtreecommitdiffstatshomepage
path: root/debian/Makefile
blob: 72be2021a7a421e6ed8267ee94f427f9ded3c05e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
include ../prelude.mk

PPA_OWNER ?= egor-tensin
PPA_NAME  ?= config-links
GPG_KEY   ?= 09AEA2BAD52882A1AF9D6042F218DB829A9905B5
DIST      ?= focal

$(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: docker
docker:
	uid="$$( stat -c '%u' . )" && \
	gid="$$( stat -c '%g' . )" && \
	docker compose build --build-arg UID="$$uid" --build-arg GID="$$gid"
	docker compose run --rm builder
	docker compose down -v

.PHONY: deps
deps:
	apt update
	DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
		build-essential \
		cowbuilder \
		devscripts \
		dh-make \
		dput \
		fakeroot \
		git-buildpackage \
		openssh-client \
		sudo

.PHONY: dch
dch:
	gbp dch --distribution=unstable --commit

.PHONY: changelog
changelog: dch

.PHONY: tag
tag:
	gbp tag

.PHONY: push
push:
	env GIT_SSH_COMMAND='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' gbp push

.PHONY: src/test
src/test:
	cd -- '$(call escape,$(root))' && gbp buildpackage -S --no-sign --git-ignore-new

.PHONY: src
src:
	cd -- '$(call escape,$(root))' && gbp buildpackage -S '-k0x$(call escape,$(GPG_KEY))' --changes-option=-sa

.PHONY: bin/test
bin/test:
	cd -- '$(call escape,$(root))' && gbp buildpackage -b --no-sign --git-ignore-new

.PHONY: bin
bin:
	cd -- '$(call escape,$(root))' && gbp buildpackage -b '-k0x$(call escape,$(GPG_KEY))'

.PHONY: dist/create
dist/create:
	cd -- '$(call escape,$(root))' && env 'DIST=$(call escape,$(DIST))' git-pbuilder create

.PHONY: dist/update
dist/update:
	cd -- '$(call escape,$(root))' && env 'DIST=$(call escape,$(DIST))' git-pbuilder update

.PHONY: dist/test
dist/test:
	cd -- '$(call escape,$(root))' && gbp buildpackage --git-pbuilder '--git-dist=$(call escape,$(DIST))' --git-ignore-new

.PHONY: dist
dist:
	cd -- '$(call escape,$(root))' && gbp buildpackage --git-pbuilder '--git-dist=$(call escape,$(DIST))'
	cd -- '$(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 '$(call escape,ppa:$(PPA_OWNER)/$(PPA_NAME)/ubuntu/$(DIST))' {} ';'

.PHONY: clean
clean:
	rm -rf -- '$(call escape,$(build_area))'