]> git.proxmox.com Git - frr.git/blob - Makefile
buildsys: add DSC & sbuild convenience target
[frr.git] / Makefile
1 include /usr/share/dpkg/default.mk
2
3 PACKAGE=frr
4
5 SRCDIR=frr
6 BUILDDIR=$(PACKAGE)-$(DEB_VERSION_UPSTREAM)
7
8 ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz
9 DSC=$(PACKAGE)_$(DEB_VERSION).dsc
10
11 MAIN_DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
12 OTHER_DEBS=\
13 frr-doc_$(DEB_VERSION)_all.deb \
14 frr-pythontools_$(DEB_VERSION)_all.deb \
15 frr-snmp_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb \
16
17 DBG_DEBS=\
18 frr-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb \
19 frr-snmp-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb \
20
21 DEBS=$(MAIN_DEB) $(OTHER_DEBS) $(DBG_DEBS)
22
23 all: $(DEBS)
24 @echo $(DEBS)
25
26 .PHONY: submodule
27 submodule:
28 test -f "$(SRCDIR)/debian/changelog" || git submodule update --init
29
30 $(BUILDDIR): submodule debian/changelog
31 rm -rf $@ $@.tmp
32 cp -a $(SRCDIR) $@.tmp
33 rm $@.tmp/debian/changelog
34 cp -a debian/* $@.tmp/debian/
35 mv $@.tmp $@
36
37 $(ORIG_SRC_TAR): $(BUILDDIR)
38 tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
39
40 .PHONY: deb
41 deb: $(DEBS)
42 $(OTHER_DEBS) $(DBG_DEBS): $(MAIN_DEB)
43 $(MAIN_DEB): $(BUILDDIR)
44 cd $(BUILDDIR); dpkg-buildpackage -b -uc -us --build-profiles="pkg.frr.nortrlib"
45 lintian $(DEBS)
46
47 .PHONY: dsc
48 dsc:
49 rm -rf $(BUILDDIR) $(ORIG_SRC_TAR) $(DSC)
50 $(MAKE) $(DSC)
51 lintian $(DSC)
52
53 $(DSC): $(BUILDDIR) $(ORIG_SRC_TAR)
54 cd $(BUILDDIR); dpkg-buildpackage -S -uc -us --build-profiles="pkg.frr.nortrlib" -d
55
56 sbuild: $(DSC)
57 sbuild --profiles="pkg.frr.nortrlib" $<
58
59 .PHONY: upload
60 upload: $(DEBS)
61 tar cf - $(DEBS)|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist bullseye
62
63 .PHONY: distclean
64 distclean: clean
65
66 .PHONY: clean
67 clean:
68 rm -rf $(PACKAGE)-[0-9]*/
69 rm -rf $(PACKAGE)*.tar* *.deb *.dsc *.changes *.dsc *.buildinfo *.build
70
71 .PHONY: dinstall
72 dinstall: deb
73 dpkg -i $(DEBS)