chiark / gitweb /
Revert "Fix publish version"
[hippotat.git] / Makefile
index 5a02fea96138f6a2bd83093e76d0509095187eb0..3219c50e9bf7074f01622f805fc34fe79f9eafc4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-# Copyright 2020-2021 Ian Jackson and contributors to Otter
-# SPDX-License-Identifier: GPL-3.0-or-later
+# Copyright 2020-2022 Ian Jackson and contributors to Hippotat
+# SPDX-License-Identifier: GPL-3.0-or-later WITH LicenseRef-Hippotat-OpenSSL-Exception
 # There is NO WARRANTY.
 
 SHELL=/bin/bash
@@ -63,16 +63,36 @@ docs/html/index.html: docs/conf.py $(wildcard docs/*.md docs/*.rst docs/*.png)
        rm -rf docs/html
        $(SPHINXBUILD) -M html docs docs $(SPHINXOPTS)
 
+doch=/usr/share/doc/hippotat/
+
 install: all
-       $(INSTALL) -d $(DESTDIR)/usr/{bin,sbin,share/doc/hippotat}
+       $(INSTALL) -d $(DESTDIR)/usr/{bin,sbin} $(DESTDIR)$(doch)
        $(INSTALL) -m 755 $(TARGET_RELEASE_DIR)/hippotat $(DESTDIR)/usr/bin/.
        $(INSTALL) -m 755 $(TARGET_RELEASE_DIR)/hippotatd $(DESTDIR)/usr/sbin/.
-       cp -r docs/html $(DESTDIR)/usr/share/doc/hippotat/
+       cp -r docs/html $(DESTDIR)$(doch)
+       $(INSTALL) -m 644 PROTOCOL.txt $(DESTDIR)$(doch)/
 
 clean:
        rm -rf stamp/* doc/html
 
 very-clean: clean
-       $(NAILING_CARGO) clean
+       $(CARGO) clean
+
+#---------- docs publication ----------
+
+PUBLISHED_BRANCH=published
+PUBLISH_VERSION=unreleased
+PUBLISH_USER=ianmdlvl@login.chiark.greenend.org.uk
+PUBLISH_DOC_SPHINX_BASE=public-html/hippotat
+PUBLISH_DOC_SPHINX_TAIL=$(PUBLISH_VERSION)/docs
+PUBLISH_DOC_SPHINX=$(PUBLISH_USER):$(PUBLISH_DOC_SPHINX_BASE)/$(PUBLISH_DOC_SPHINX_TAIL)
+
+publish: doc
+       ssh $(PUBLISH_USER) 'cd $(PUBLISH_DOC_SPHINX_BASE) && mkdir -p $(PUBLISH_DOC_SPHINX_TAIL)'
+       rsync -r --delete-delay docs/html/. $(PUBLISH_DOC_SPHINX)/.
+       git branch -f $(PUBLISHED_BRANCH)
+
+publish-make-current:
+       ssh $(PUBLISH_USER) 'set -e; cd $(PUBLISH_DOC_SPHINX_BASE); rm -f current.tmp; ln -s $(PUBLISH_VERSION) current.tmp; mv -T current.tmp current'
 
 .PHONY: cargo-build all doc clean