]> git.proxmox.com Git - pmg-docs.git/blobdiff - Makefile
admin: system-booting: replace pve with pmg automatically
[pmg-docs.git] / Makefile
index ccca1887f3bc4cab676a479695eabd772b2aaec0..443138e1df94b10096c69f181eeb857bc8771df7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,18 +4,12 @@ DGDIR=.
 ASCIIDOC_PMG=./asciidoc-pmg
 
 BUILDDIR ?= $(DEB_SOURCE)-$(DEB_VERSION)
+DSC=$(DEB_SOURCE)_$(DEB_VERSION).dsc
 
 GEN_PACKAGE=pmg-doc-generator
 DOC_PACKAGE=pmg-docs
 
-# also update debian/changelog
-PKGREL=1
-
-GITVERSION:=$(shell git rev-parse HEAD)
-
-ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
-
-GEN_DEB=$(GEN_PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(ARCH).deb
+GEN_DEB=$(GEN_PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
 DOC_DEB=$(DOC_PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
 
 export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
@@ -151,14 +145,22 @@ api-viewer/apidoc.js: $(API_VIEWER_FILES)
 $(BUILDDIR):
        rm -rf $@ $@.tmp
        rsync -a * $@.tmp
-       echo "git clone git://git.proxmox.com/git/pmg-docs.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
+       echo "git clone git://git.proxmox.com/git/pmg-docs.git\\ngit checkout $(shell git rev-parse HEAD)" > $@.tmp/debian/SOURCE
        mv $@.tmp $@
 
 .PHONY: dinstall
 dinstall: $(GEN_DEB) $(DOC_DEB)
        dpkg -i $(GEN_DEB) $(DOC_DEB)
 
-.PHONY: deb
+.PHONY: dsc deb
+dsc: $(DSC)
+$(DSC): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
+       lintian $(DSC)
+
+sbuild: $(DSC)
+       sbuild $(DSC)
+
 deb: $(DOC_DEB)
        rm -f $(GEN_DEB) $(DOC_DEB)
        rm -rf $(BUILDDIR)
@@ -204,8 +206,9 @@ doc-install: index.html $(API_VIEWER_SOURCES) verify-images
        install -m 0644 $(API_VIEWER_SOURCES) $(DESTDIR)/usr/share/$(DOC_PACKAGE)/api-viewer
 
 .PHONY: upload
+upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
 upload: $(GEN_DEB) $(DOC_DEB)
-       tar cf - $(GEN_DEB) $(DOC_DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist bullseye
+       tar cf - $(GEN_DEB) $(DOC_DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist $(UPLOAD_DIST)
 
 .PHONY: update
 update: clean
@@ -216,7 +219,7 @@ update: clean
 clean:
        find . -name '*~' -exec rm {} ';'
        rm -rf *.html *.pdf *.epub *.tmp *.1 *.5 *.8
-       rm -f *.deb *.changes *.buildinfo
+       rm -f *.deb *dsc *.tar.* *.changes *.buildinfo *.build
        rm -f api-viewer/apidoc.js chapter-*.html *-plain.html chapter-*.html pmg-admin-guide.chunked asciidoc-pmg link-refs.json .asciidoc-pmg-tmp_* pmg-smtp-filter.8-synopsis.adoc pmgpolicy.8-synopsis.adoc pmgsh.1-synopsis.adoc
        rm -rf .pmg-doc-depends 
        rm -f pmg-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc pmg-admin-guide-docinfo.xml pmg-copyright.adoc