]> git.proxmox.com Git - pve-cluster.git/blobdiff - Makefile
makefile: convert to use simple parenthesis
[pve-cluster.git] / Makefile
index 6e1161e5e6782a35fde795cd78f78d0f8c428811..9c200d5927c48edebaf04daed5d88d375b25d80d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,41 +1,44 @@
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/architecture.mk
+
 PACKAGE=pve-cluster
-PKGVER=4.0
-PKGREL=48
 
-ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
-GITVERSION:=$(shell cat .git/refs/heads/master)
+GITVERSION:=$(shell git rev-parse HEAD)
 
-DEB=${PACKAGE}_${PKGVER}-${PKGREL}_${ARCH}.deb
-DBG_DEB=${PACKAGE}-dbg_${PKGVER}-${PKGREL}_${ARCH}.deb
+DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
+LIB_DEB  = libpve-cluster-perl_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
+LIB_DEB += libpve-cluster-api-perl_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
+DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
 
+DEBS = $(DEB) $(DBG_DEB) $(LIB_DEB)
 
+PERL_APIVER := `perl -MConfig -e 'print $$Config(debian_abi)//$$Config(version);'`
 
-all: ${DEB} ${DBG_DEB}
+all: $(DEB) $(DBG_DEB)
 
 cpgtest: cpgtest.c
        gcc -Wall cpgtest.c $(shell pkg-config --cflags --libs libcpg libqb) -o cpgtest
 
 .PHONY: dinstall
-dinstall: ${DEB}
-       dpkg -i ${DEB} 
+dinstall: $(DEB) $(LIB_DEB)
+       dpkg -i $^
 
 .PHONY: deb
-deb ${DBG_DEB}: ${DEB}
-${DEB}:
+deb $(DBG_DEB) $(LIB_DEB): $(DEB)
+$(DEB):
        rm -f *.deb
        rm -rf build
        cp -a data build
        cp -a debian build/debian
-       echo "git clone git://git.proxmox.com/git/pve-cluster.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
-       cd build; ./autogen.sh
+       echo "git clone git://git.proxmox.com/git/pve-cluster.git\\ngit checkout $(GITVERSION)" > build/debian/SOURCE
        cd build; dpkg-buildpackage -rfakeroot -b -us -uc
-       lintian ${DEB}
+       lintian $(DEB)
 
 
 .PHONY: upload
-upload: ${DEB} ${DBG_DEB}
-       tar cf - ${DEB} ${DBG_DEB}| ssh repoman@repo.proxmox.com upload
+upload: $(DEBS)
+       tar cf - $(DEBS) | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist bullseye --arch $(DEB_BUILD_ARCH)
 
 .PHONY: clean
 clean:
-       rm -rf *~ build *_${ARCH}.deb *.changes *.dsc ${CSDIR}
+       rm -rf *~ build *.deb *.changes *.dsc *.buildinfo