--- a/Makefile Thu Jan 12 23:39:07 2012 +0200
+++ b/Makefile Thu Jan 12 23:53:35 2012 +0200
@@ -110,12 +110,56 @@
DISTSRC_HELPER_FILES = VERSION Makefile rst.css .dir-locals.el
DISTSRC_FILES = $(HTML_FILES) $(RST_FILES) $(DISTSRC_HELPER_FILES)
+DIST_TARBALLS = $(DIST_DIR).tar.gz $(DIST_DIR).tar.bz2
+DISTSRC_TARBALLS = $(DISTSRC_DIR).tar.gz $(DISTSRC_DIR).tar.bz2
+
+################################################################
+# Deploy targets.
+
+.PHONY: deploy
+deploy: deploy2sf
+
+SFTP_PATH = gavenkoa,$(name)@frs.sourceforge.net
+
+# First time you deploy to SourceForge (sf) you need manually login to:
+# $ sftp $(SFTP_PATH)
+# as it may require interactive input for accepting server public key.
+# Next time any action fully automated.
+
+.PHONY: deploy2sf
+deploy2sf: deploy2sf-doc deploy2sf-release deploy2sf-src
+
+# Will be accessed via http://$(name).sourceforge.net
+.PHONY: deploy2sf-doc
+deploy2sf-doc: $(HTML_FILES)
+ ( echo 'cd htdocs'; \
+for f in $(HTML_FILES); do \
+ echo "put $$f"; \
+ echo "chmod 644 $$f"; \
+done; \
+echo 'quit'; \
+) | sftp -b - $(SFTP_PATH)
+
+.PHONY: deploy2sf-release
+deploy2sf-release: $(DIST_TARBALLS) $(DISTSRC_TARBALLS)
+ ( echo 'cd /home/frs/project/g/ga/gadict'; \
+echo "put CHANGES.rst README.rst"; \
+echo "mkdir v$(vmajor).$(vminor)"; \
+echo "cd v$(vmajor).$(vminor)"; \
+for f in $^; do \
+ echo "put $$f"; \
+ echo "chmod 644 $$f"; \
+done; \
+echo 'quit'; \
+) | sftp -b - $(SFTP_PATH)
+
+.PHONY: deploy2sf-src
+deploy2sf-src:
+ hg push ssh://gavenkoa@hg.code.sf.net/p/$(name)/code
+
################################################################
# Dist targets.
-DIST_TARBALLS = $(DIST_DIR).tar.gz $(DIST_DIR).tar.bz2
-DISTSRC_TARBALLS = $(DISTSRC_DIR).tar.gz $(DISTSRC_DIR).tar.bz2
-
.PHONY: dist
dist: dist-dictd dist-src