]> git.proxmox.com Git - proxmox-kernel-helper.git/blobdiff - Makefile
bump version to 8.1.0
[proxmox-kernel-helper.git] / Makefile
index cb5cb99dd6d68828e935f46551f444e5d58f2c60..4df21388010a5132535cab00b3a35909dce59dd3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,41 +1,42 @@
-RELEASE=5.4
-PKGREL=1
+include /usr/share/dpkg/pkg-info.mk
 
-export KERNEL_VER=4.15
-export KERNEL_ABI=4.15.18-13-pve
+PACKAGE=proxmox-kernel-helper
+BUILDDIR=$(PACKAGE)-$(DEB_VERSION_UPSTREAM)
 
-PACKAGE=pve-kernel-${KERNEL_VER}
+DSC=$(PACKAGE)_$(DEB_VERSION).dsc
+DEB=$(PACKAGE)_$(DEB_VERSION)_all.deb
 
-GITVERSION:=$(shell git rev-parse HEAD)
+.PHONY: deb
+deb: $(DEB)
 
-KERNEL_DEB=pve-kernel-${KERNEL_VER}_${RELEASE}-${PKGREL}_all.deb
-HEADERS_DEB=pve-headers-${KERNEL_VER}_${RELEASE}-${PKGREL}_all.deb
+$(BUILDDIR): debian src
+       rm -rf $@ $@.tmp
+       cp -a src $@.tmp
+       cp -a debian $@.tmp/
+       echo "git clone git://git.proxmox.com/git/proxmox-kernel-helper.git\\ngit checkout $$(git rev-parse HEAD)" > $@.tmp/debian/SOURCE
+       mv $@.tmp $@
 
-BUILD_DIR=build
+$(DEB): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -b -uc -us
+       lintian $(DEB)
 
-DEBS=${KERNEL_DEB} ${HEADERS_DEB}
+dsc: clean
+       $(MAKE) $(DSC)
+       lintian $(DSC)
 
-all: deb
-deb: ${DEBS}
+$(DSC): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -S -uc -us -d
 
-${HEADERS_DEB}: ${KERNEL_DEB}
-${KERNEL_DEB}: debian
-       rm -rf ${BUILD_DIR}
-       mkdir -p ${BUILD_DIR}/debian
-       cp -ar debian/* ${BUILD_DIR}/debian/
-       cd ${BUILD_DIR}; debian/rules debian/control
-       echo "git clone git://git.proxmox.com/git/pve-kernel-meta.git\\ngit checkout ${GITVERSION}" > ${BUILD_DIR}/debian/SOURCE
-       cd ${BUILD_DIR}; dpkg-buildpackage -b -uc -us
-       lintian ${KERNEL_DEB}
-       lintian ${HEADERS_DEB}
+sbuild: $(DSC)
+       sbuild $<
 
 .PHONY: upload
-upload: ${DEBS}
-       tar cf - ${DEBS}|ssh repoman@repo.proxmox.com -- upload --product pve,pmg --dist stretch --arch ${ARCH}
+upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
+upload: $(DEB)
+       tar cf - $(DEB)|ssh repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist $(UPLOAD_DIST)
 
-.PHONY: distclean
+.PHONY: clean distclean
 distclean: clean
-
-.PHONY: clean
 clean:
-       rm -rf *~ ${BUILD_DIR} *.deb *.dsc *.changes *.buildinfo
+       $(MAKE) -C src $@
+       rm -rf *~ $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.deb *.dsc *.changes *.build *.buildinfo