summaryrefslogtreecommitdiff
path: root/Makefile
blob: b7fa8eaddc0ed711192ce4992407b518b28d2fce (plain)
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
define script
(read _ v _; v=$${v%)}; echo $${v##*:})
endef

arch := $(shell dpkg-architecture -q DEB_HOST_ARCH)
version := $(shell head -n1 debian/changelog | $(script))

build-stamp:
	mk-build-deps ./debian/control --install --root-cmd sudo --remove
	dpkg-buildpackage -us -uc -nc
	touch $@

packages = openssh-client openssh-server openssh-sftp-server

package_files = $(addsuffix _$(version)_$(arch).deb,$(addprefix ../,$(packages)))

$(package_files): build-stamp

install: install-stamp

install-stamp: $(package_files)
	sudo dpkg -i $(package_files)
	touch $@

list:
	@echo $(package_files)

cp:
	[ "$(dest)" ]
	cp --reflink $(package_files) '$(dest)'/