]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - Makefile
add proxmox-widget-toolkit-dev package
[proxmox-widget-toolkit.git] / Makefile
index 54b1cac0d34f176a8cc2e804213e5b0619d3c9d5..0060296534805ef7beefb320fd1095138348e8ed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,87 +1,49 @@
-PACKAGE=proxmox-widget-toolkit
-PKGVER=1.0
-PKGREL=3
+include /usr/share/dpkg/pkg-info.mk
+export DEB_VERSION_UPSTREAM_REVISION
 
-DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb
+export PACKAGE=proxmox-widget-toolkit
+BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
+WT_DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
+WT_DEV_DEB=${PACKAGE}-dev_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
+DEBS=${WT_DEB} ${WT_DEV_DEB}
+DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
 
-DESTDIR=
+GITVERSION:=$(shell git rev-parse HEAD)
 
-DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
-
-WWWBASEDIR=${DESTDIR}/usr/share/javascript/${PACKAGE}
-
-JSSRC=                                 \
-       Utils.js                        \
-       Toolkit.js                      \
-       mixin/CBind.js                  \
-       data/reader/JsonObject.js       \
-       data/ProxmoxProxy.js            \
-       data/UpdateQueue.js             \
-       data/UpdateStore.js             \
-       data/DiffStore.js               \
-       data/ObjectStore.js             \
-       data/RRDStore.js                \
-       data/TimezoneStore.js           \
-       form/IntegerField.js            \
-       form/TextField.js               \
-       form/DateTimeField.js           \
-       form/Checkbox.js                \
-       form/KVComboBox.js              \
-       form/LanguageSelector.js        \
-       form/ComboGrid.js               \
-       form/RRDTypeSelector.js         \
-       button/Button.js                \
-       button/HelpButton.js            \
-       grid/ObjectGrid.js              \
-       grid/PendingObjectGrid.js       \
-       panel/InputPanel.js             \
-       panel/LogView.js                \
-       panel/RRDChart.js               \
-       panel/GaugeWidget.js            \
-       window/Edit.js                  \
-       window/PasswordEdit.js          \
-       window/TaskViewer.js            \
-       node/APT.js                     \
-       node/NetworkEdit.js             \
-       node/NetworkView.js             \
-       node/DNSEdit.js                 \
-       node/DNSView.js                 \
-       node/Tasks.js                   \
-       node/ServiceView.js             \
-       node/TimeEdit.js                \
-       node/TimeView.js
-
-all:
+${BUILDDIR}:
+       rm -rf ${BUILDDIR} ${BUILDDIR}.tmp
+       cp -a src/ ${BUILDDIR}.tmp
+       cp -a debian ${BUILDDIR}.tmp/
+       echo "git clone git://git.proxmox.com/git/proxmox-widget-toolkit.git\\ngit checkout ${GITVERSION}" >  ${BUILDDIR}.tmp/debian/SOURCE
+       mv ${BUILDDIR}.tmp/ ${BUILDDIR}
 
 .PHONY: deb
-deb ${DEB}:
-       rm -rf build
-       rsync -a * build
-       cd build; dpkg-buildpackage -b -us -uc
-       lintian ${DEB}
+deb: ${DEBS}
+${DEBS}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
+       lintian ${DEBS}
+
+.PHONY: dsc
+dsc: ${DSC}
+${DSC}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d
+       lintian ${DSC}
 
 .PHONY: lint
 lint: ${JSSRC}
-       jslint ${JSSRC}
-
-proxmoxlib.js: ${JSSRC}
-       cat ${JSSRC} >$@.tmp
-       mv $@.tmp $@
-
-install: proxmoxlib.js
-       install -d -m 755 ${WWWBASEDIR}
-       install -m 0644 proxmoxlib.js ${WWWBASEDIR}
+       ${MAKE} -C src lint
 
 .PHONY: upload
-upload: ${DEB}
-       tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg --dist stretch
+upload: ${DEBS}
+       tar cf - ${WT_DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist buster
+       tar cf - ${WT_DEV_DEB} | ssh -X repoman@repo.proxmox.com -- upload --product devel --dist buster
 
 distclean: clean
-
 clean:
-       rm -rf ./build *.deb *.changes *.buildinfo
+       $(MAKE) -C src clean
+       rm -rf ${BUILDDIR} ${BUILDDIR}.tmp *.tar.gz *.dsc *.deb *.changes *.buildinfo
        find . -name '*~' -exec rm {} ';'
 
 .PHONY: dinstall
-dinstall: ${DEB}
-       dpkg -i ${DEB}
+dinstall: ${DEBS}
+       dpkg -i ${DEBS}