GNUmakefile in io_splice-0.1.0 vs GNUmakefile in io_splice-1.0.0
- old
+ new
@@ -1,10 +1,11 @@
# use GNU Make to run tests in parallel, and without depending on RubyGems
all::
RUBY = ruby
RAKE = rake
GIT_URL = git://git.bogomips.org/ruby_io_splice.git
+RSYNC = rsync
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
@./GIT-VERSION-GEN
-include GIT-VERSION-FILE
-include local.mk
@@ -38,11 +39,11 @@
$(RM) .manifest
$(MAKE) .manifest
.manifest:
(git ls-files && \
- for i in $@ $(pkg_extra) $(man1_paths); \
+ for i in $@ $(pkg_extra); \
do echo $$i; done) | LC_ALL=C sort > $@+
cmp $@+ $@ || mv $@+ $@
$(RM) $@+
NEWS: GIT-VERSION-FILE
@@ -65,14 +66,14 @@
news_atom := http://bogomips.org/ruby_io_splice/NEWS.atom.xml
cgit_atom := http://git.bogomips.org/cgit/ruby_io_splice.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 + workaround patch here:
+# rubyforge.org/tracker/index.php?func=detail&aid=28230&group_id=627&atid=2472
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' \
@@ -83,10 +84,34 @@
$(RUBY) -i -p -e \
'$$_.gsub!("</title>",%q{\&$(call atom,$(news_atom))})' \
doc/NEWS.html doc/README.html
$(RAKE) -s news_atom > doc/NEWS.atom.xml
cd doc && ln README.html tmp && mv tmp index.html
- $(RM) $(man1_bins)
+
+latest: NEWS
+ @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' $<
+
+# publishes docs to http://bogomips.org/ruby_io_splice/,
+publish_doc:
+ -git set-file-times
+ $(RM) -r doc ChangeLog NEWS
+ $(MAKE) doc LOG_VERSION=$(shell git tag -l | tail -1)
+ awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' \
+ NEWS > doc/LATEST
+ find doc/images doc/js -type f | \
+ TZ=UTC xargs touch -d '1970-01-01 00:00:01' doc/rdoc.css
+ $(MAKE) doc_gz
+ chmod 644 $$(find doc -type f)
+ $(RSYNC) -av doc/ bogomips.org:/srv/bogomips/ruby_io_splice/
+ 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
ifneq ($(VERSION),)
rfproject := qrp
rfpackage := io_splice
pkggem := pkg/$(rfpackage)-$(VERSION).gem