about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--Documentation/GNUmakefile10
-rw-r--r--Rakefile15
2 files changed, 18 insertions, 7 deletions
diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile
index 783cc82..dc6a266 100644
--- a/Documentation/GNUmakefile
+++ b/Documentation/GNUmakefile
@@ -61,12 +61,16 @@ install-man: man
 %.7 : %.pod
         $(pod2man) -s 7 $< $@+ && mv $@+ $@
 
-all :: $(mantxt)
-
 mantxt = $(addsuffix .txt, $(m1) $(m7))
 
+txt :: $(mantxt)
+
+all :: txt
+
 %.txt : %.pod
-        $(pod2text) $< $@+ && mv $@+ $@
+        $(pod2text) $< $@+
+        touch -r $< $@+ 2>/dev/null || true # GNU-ism
+        mv $@+ $@
 
 clean::
         $(RM) $(man1) $(man7)
diff --git a/Rakefile b/Rakefile
index 075260b..c710c7a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -101,19 +101,26 @@ task rsync_docs: %w(NEWS NEWS.atom) do
   # Also available at: http://yhbt.net/git-set-file-times
   # on Debian systems: /usr/share/doc/rsync/scripts/git-set-file-times.gz
   sh("git", "set-file-times", "Documentation", "examples", *top)
+  make = ENV['MAKE'] || 'make'
+  sh(%Q(#{make} -C Documentation))
+  examples = `git ls-files examples`.split("\n")
 
-  `git ls-files Documentation/*.txt`.split(/\n/).concat(top).each do |txt|
+  gzip_touch = lambda do |txt|
     gz = "#{txt}.gz"
     tmp = "#{gz}.#$$"
-    sh("gzip -9 < #{txt} > #{tmp}")
+    sh("gzip -9 <#{txt} >#{tmp}")
     st = File.stat(txt)
     File.utime(st.atime, st.mtime, tmp) # make nginx gzip_static happy
     File.rename(tmp, gz)
+    gz
+  end
+
+  Dir['Documentation/*.txt'].to_a.concat(top).each do |txt|
     files << txt
-    files << gz
+    files << gzip_touch[txt]
   end
   sh("rsync --chmod=Fugo=r -av #{files.join(' ')} #{dest}")
 
-  examples = `git ls-files examples`.split("\n")
+  examples = examples.map { |txt| [ txt, gzip_touch[txt] ] }
   sh("rsync --chmod=Fugo=r -av #{examples.join(' ')} #{dest}/examples/")
 end