about summary refs log tree commit homepage
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile28
1 files changed, 26 insertions, 2 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 59b3a73..f880f26 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -51,6 +51,9 @@ NEWS: GIT-VERSION-FILE
         $(RAKE) -s news_rdoc > $@+
         mv $@+ $@
 
+latest: NEWS
+        @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' $<
+
 SINCE =
 ChangeLog: LOG_VERSION = \
   $(shell git rev-parse -q "$(GIT_VERSION)" >/dev/null 2>&1 && \
@@ -69,9 +72,9 @@ cgit_atom := http://git.bogomips.org/cgit/kcar.git/atom/?h=master
 atom = <link rel="alternate" title="Atom feed" href="$(1)" \
              type="application/atom+xml"/>
 
-# using rdoc 2.4.1+
+# using rdoc 2.5.x
 doc: .document NEWS ChangeLog
-        rdoc -Na -t "$(shell sed -ne '1s/^= //p' README)"
+        rdoc -a -t "$(shell sed -ne '1s/^= //p' README)"
         install -m644 COPYING doc/COPYING
         install -m644 $(shell grep '^[A-Z]' .document) doc/
         $(RUBY) -i -p -e \
@@ -170,4 +173,25 @@ test-unit: $(test_units)
 $(test_units): build
         $(RUBY) -w -I lib:ext/kcar $@
 
+# this requires GNU coreutils variants
+publish_doc:
+        -git set-file-times
+        $(RM) -r doc ChangeLog NEWS
+        $(MAKE) doc LOG_VERSION=$(shell git tag -l | tail -1)
+        $(MAKE) -s latest > doc/LATEST
+        find doc/images doc/js -type f | \
+                TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
+        $(MAKE) doc_gz
+        chmod 644 $$(find doc -type f)
+        rsync -av doc/ dcvr:/srv/bogomips/kcar/
+        git ls-files | xargs touch
+
+# Create gzip variants of the same timestamp as the original so nginx
+# "gzip_static on" can serve the gzipped versions directly.
+doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
+doc_gz:
+        touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
+        for i in $(docs); do \
+          gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
+
 .PHONY: .FORCE-GIT-VERSION-FILE doc manifest man test $(test_units)