build: add dsc target
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 19 Dec 2018 12:28:42 +0000 (13:28 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 19 Dec 2018 13:01:40 +0000 (14:01 +0100)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Makefile

index 041c16a..32ad46f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,10 +7,14 @@ BUILDDIR=${SRCDIR}.tmp
 
 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
 
-DEBS=                                                  \
+MAIN_DEB=iproute2_${VERSION}-${PKGREL}_${ARCH}.deb
+OTHER_DEBS=\
        iproute2-doc_${VERSION}-${PKGREL}_all.deb       \
        iproute2-dbgsym_${VERSION}-${PKGREL}_all.deb    \
-       iproute2_${VERSION}-${PKGREL}_${ARCH}.deb
+
+DEBS=${MAIN_DEB} ${OTHER_DEBS}
+
+DSC=${PACKAGE}_${VER}-${PKGREL}.dsc
 
 all: ${DEBS}
        echo ${DEBS}
@@ -19,13 +23,24 @@ all: ${DEBS}
 submodule:
        test -f "${SRCDIR}/README" || git submodule update --init
 
-.PHONY: deb
-${DEBS} deb: | submodule
+${BUILDDIR}: | submodule
        rm -rf $(BUILDDIR)
        cp -a $(SRCDIR) $(BUILDDIR)
        cp -a debian $(BUILDDIR)/debian
+
+.PHONY: deb
+deb: ${DEBS}
+${OTHER_DEBS}: ${MAIN_DEBS}
+${MAIN_DEB}: ${BUILDDIR}
        cd ${BUILDDIR}; dpkg-buildpackage -rfakeroot -b -uc -us
 
+.PHONY: dsc
+dsc: ${DSC}
+${DSC}: ${BUILDDIR}
+       cd ${BUILDDIR}; tar czf ../${PACKAGE}_${VER}.orig.tar.gz *
+       cd ${BUILDDIR}; dpkg-buildpackage -S -uc -us -d
+       lintian $@
+
 .PHONY: upload
 upload: ${DEBS}
        tar cf - ${DEBS} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}
@@ -33,7 +48,7 @@ upload: ${DEBS}
 .PHONY: clean distclean
 distclean: clean
 clean:
-       rm -rf ${BUILDDIR} *.deb *.changes *.dsc *.buildinfo
+       rm -rf ${BUILDDIR} *.deb *.changes *.dsc *.buildinfo *.orig.tar.* *.debian.tar.*
 
 .PHONY: dinstall
 dinstall: deb