]> git.proxmox.com Git - libjs-qrcodejs.git/blob - Makefile
buildsys: derive upload dist automatically
[libjs-qrcodejs.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 PACKAGE=libjs-qrcodejs
4 BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION)
5 ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz
6
7 DEB=$(PACKAGE)_$(DEB_VERSION)_all.deb
8 DSC=$(PACKAGE)_$(DEB_VERSION).dsc
9
10 GITVERSION:=$(shell git rev-parse HEAD)
11
12 all:
13 true
14
15 $(BUILDDIR):
16 rm -rf $(BUILDDIR).tmp
17 cp -a src $(BUILDDIR).tmp
18 cp -a debian $(BUILDDIR).tmp/
19 echo "git clone git://git.proxmox.com/git/libjs-qrcodejs.git\\ngit checkout $(GITVERSION)" > $(BUILDDIR).tmp/debian/SOURCE
20 mv $(BUILDDIR).tmp/ $(BUILDDIR)
21
22 $(ORIG_SRC_TAR): $(BUILDDIR)
23 tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
24
25 .PHONY: deb
26 deb: $(DEB)
27 $(DEB): $(BUILDDIR)
28 cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
29 lintian $(DEB)
30
31 .PHONY: dsc
32 dsc: $(DSC)
33 $(MAKE) clean
34 $(MAKE) $(DSC)
35 lintian $(DSC)
36
37 $(DSC): $(BUILDDIR) $(ORIG_SRC_TAR)
38 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
39
40 sbuild: $(DSC)
41 sbuild $(DSC)
42
43 # HACK, but this is a *very* seldom bumped package and normally 1:1 the same in all our dists
44 -include /etc/os-release
45
46 .PHONY: upload
47 upload: UPLOAD_DIST ?= $(VERSION_CODENAME)
48 upload: $(DEB)
49 tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist $(UPLOAD_DIST)
50
51 distclean: clean
52 clean:
53 $(MAKE) -C src clean
54 rm -rf $(PACKAGE)-[0-9]*/ $(PACKAGE)*tar* *.dsc *.deb *.changes *.build *.buildinfo
55
56 .PHONY: dinstall
57 dinstall: $(DEB)
58 dpkg -i $(DEB)