GNUmakefile in raindrops-0.1.0 vs GNUmakefile in raindrops-0.2.0
- old
+ new
@@ -1,9 +1,10 @@
# use GNU Make to run tests in parallel, and without depending on RubyGems
all::
RUBY = ruby
RAKE = rake
+RSYNC = rsync
GIT_URL = git://git.bogomips.org/raindrops.git
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
@./GIT-VERSION-GEN
-include GIT-VERSION-FILE
@@ -47,11 +48,14 @@
NEWS: GIT-VERSION-FILE
$(RAKE) -s news_rdoc > $@+
mv $@+ $@
-SINCE =
+latest: NEWS
+ @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' $<
+
+SINCE = 0.1.0
ChangeLog: LOG_VERSION = \
$(shell git rev-parse -q "$(GIT_VERSION)" >/dev/null 2>&1 && \
echo $(GIT_VERSION) || git describe)
ifneq ($(SINCE),)
ChangeLog: log_range = v$(SINCE)..$(LOG_VERSION)
@@ -65,14 +69,14 @@
news_atom := http://raindrops.bogomips.org/NEWS.atom.xml
cgit_atom := http://git.bogomips.org/cgit/raindrops.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
for i in $(man1_bins); do > $$i; done
- 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/
cd doc && for i in $(base_bins); do \
html=$$(echo $$i | sed 's/\.rb/_rb/')_1.html; \
sed -e '/"documentation">/r man1/'$$i'.1.html' \
@@ -166,7 +170,28 @@
test_units := $(wildcard test/test_*.rb)
test: test-unit
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)