From c48b2ce337bddd5f0e7f0a6a21dfd7fc925f1e42 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 2 May 2010 16:57:58 -0700 Subject: [PATCH] GNUmakefile: add publish_doc target --- GNUmakefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/GNUmakefile b/GNUmakefile index bf1a02a..416b87f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -2,6 +2,7 @@ all:: RUBY = ruby RAKE = rake +RSYNC = rsync GIT_URL = git://git.bogomips.org/raindrops.git GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE @@ -49,6 +50,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 && \ @@ -169,4 +173,25 @@ test-unit: $(test_units) $(test_units): build $(RUBY) -I lib:ext/raindrops $@ +# 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/ raindrops.bogomips.org:/srv/raindrops/ + 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) -- 2.11.4.GIT