]> git.proxmox.com Git - pve-omping.git/blobdiff - Makefile
buildsys: improve clean
[pve-omping.git] / Makefile
index 3c7aa6487ae94c5b9f43f1b9f0b3ef1e71727343..3e534204f55b77b79387dcd0e819c87200bf90a8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,36 +1,52 @@
-RELEASE=4.0
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/architecture.mk
 
-PKGVERSION=0.0.4
-PKGRELEASE=2
 PACKAGE=omping
-PKGDIR=${PACKAGE}-${PKGVERSION}
-PKGSRC=${PACKAGE}_${PKGVERSION}.orig.tar.gz
+PKGDIR=${PACKAGE}-${DEB_VERSION_UPSTREAM}
+PKGSRC=${PACKAGE}_${DEB_VERSION_UPSTREAM}.orig.tar.gz
 
-ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
 GITVERSION:=$(shell cat .git/refs/heads/master)
 
-DEBS= ${PACKAGE}_${PKGVERSION}-${PKGRELEASE}_${ARCH}.deb
+DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb
+DBGDEB=${PACKAGE}-dbgsym_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb
+
+DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
+
+DEBS=${DEB} ${DBGDEB}
 
 all: ${DEBS}
 
-${DEBS}: ${PKGSRC}
+.PHONY: ${PKGDIR}
+${PKGDIR}: ${PKGSRC}
        rm -rf ${PKGDIR}
        tar xf ${PKGSRC}
        rm -rf ${PKGDIR}/debian
        cp -a debian ${PKGDIR}/debian
        echo "git clone git://git.proxmox.com/git/pve-omping.git\\ngit checkout ${GITVERSION}" > ${PKGDIR}/debian/SOURCE
+
+.PHONY: deb
+deb: ${DEBS}
+${DBGDEB}: ${DEB}
+${DEB}: ${PKGDIR}
        cd ${PKGDIR}; dpkg-buildpackage -b -us -uc
+       lintian ${DEB}
+
+.PHONY: dsc
+dsc: ${DSC}
+${DSC}: ${PKGDIR}
+       cd ${PKGDIR}; dpkg-buildpackage -S -us -uc -d
+       lintian ${DSC}
 
 .PHONY: upload
 upload: ${DEBS}
-       tar -cf - ${DEBS} | ssh repoman@repo.proxmox.com upload
+       tar cf - ${DEBS} | ssh repoman@repo.proxmox.com -- upload --product pve --dist buster --arch ${DEB_BUILD_ARCH}
 
 distclean: clean
 
 .PHONY: clean
 clean:
-       rm -rf *~ *_${ARCH}.deb *.changes *.dsc ${PKGDIR} 
+       rm -rf *~ *_${DEB_BUILD_ARCH}.deb *.changes *.dsc *.diff.gz *.buildinfo ${PKGDIR}
 
 .PHONY: dinstall
-dinstall: ${DEBS}
-       dpkg -i ${DEBS}
+dinstall: ${DEB}
+       dpkg -i ${DEB}