]> git.proxmox.com Git - pve-xtermjs.git/blobdiff - Makefile
buildsys: switch upload dist over to buster
[pve-xtermjs.git] / Makefile
index f16e4649fee7c43c2e92713599de798192ddfc15..6e2f25cea45ace7e849499fc0ba0d1b753d4085a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,46 +1,59 @@
-include defines.mk
+include /usr/share/dpkg/pkg-info.mk
 
-XTERMJSDIR=xtermjs
-SRCDIR=src
+PACKAGE=pve-xtermjs
+
+export VERSION=${DEB_VERSION_UPSTREAM_REVISION}
+
+XTERMJSVER=3.13.2
+XTERMJSTGZ=xterm-${XTERMJSVER}.tgz
 
-ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+SRCDIR=src
+BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
 GITVERSION:=$(shell cat .git/refs/heads/master)
 
-DEB=${PACKAGE}_${VERSION}_${ARCH}.deb
+DEB=${PACKAGE}_${VERSION}_all.deb
+DSC=${PACKAGE}_${VERSION}.dsc
 
 all: ${DEB}
        @echo ${DEB}
 
+${BUILDDIR}: ${SRCDIR} debian
+       rm -rf ${BUILDDIR}
+       rsync -a ${SRCDIR}/ debian ${BUILDDIR}
+       echo "git clone git://git.proxmox.com/git/pve-xtermjs.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE
+
 .PHONY: deb
 deb: ${DEB}
-${DEB}: | submodule
-       rm -rf ${SRCDIR}.tmp
-       cp -rpa ${SRCDIR} ${SRCDIR}.tmp
-       cp -a debian ${SRCDIR}.tmp/
-       cp -ar ${XTERMJSDIR}/dist/* ${SRCDIR}.tmp/www
-       echo "git clone git://git.proxmox.com/git/pve-xtermjs.git\\ngit checkout ${GITVERSION}" > ${SRCDIR}.tmp/debian/SOURCE
-       cd ${SRCDIR}.tmp; dpkg-buildpackage -rfakeroot -b -uc -us
+${DEB}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -b -uc -us
        lintian ${DEB}
        @echo ${DEB}
 
-.PHONY: submodule
-submodule:
-       test -f "${XTERMJSDIR}/README.md" || git submodule update --init
+.PHONY: dsc
+dsc: ${DSC}
+${DSC}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d
+       lintian ${DSC}
 
+X_EXCLUSIONS=--exclude=addons/attach --exclude=addons/fullscreen --exclude=addons/search \
+  --exclude=addons/terminado --exclude=addons/webLinks --exclude=addons/zmodem
 .PHONY: download
-download ${SRCDIR}:
-       git submodule foreach 'git pull --ff-only origin master'
+download:
+       wget https://registry.npmjs.org/xterm/-/${XTERMJSTGZ} -O ${XTERMJSTGZ}.tmp
+       mv ${XTERMJSTGZ}.tmp ${XTERMJSTGZ}
+       tar -C $(SRCDIR)/www -xf ${XTERMJSTGZ} package/dist --strip-components=2 ${X_EXCLUSIONS}
+       rm ${XTERMJSTGZ}
 
 .PHONY: upload
 upload: ${DEB}
-       tar cf - ${DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve --dist stretch
+       tar cf - ${DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve --dist buster
 
 .PHONY: distclean
 distclean: clean
 
 .PHONY: clean
 clean:
-       rm -rf *~ debian/*~ *_${ARCH}.deb ${SRCDIR}.tmp *_all.deb *.changes *.dsc *.buildinfo
+       rm -rf *~ debian/*~ ${PACKAGE}-*/ *.deb *.changes *.dsc *.tar.gz *.buildinfo
 
 .PHONY: dinstall
 dinstall: deb