summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2011-10-19 17:16:52 +0200
committerPatrick Ohly <patrick.ohly@intel.com>2011-10-24 20:05:16 +0200
commit774a9f26d8e2adfd3e4851e149302a2fe2976de8 (patch)
treee8497f48ee12b408a32ba46c4cd4ed991219b535 /Makefile.am
parent13b89e2224a1ccef38a70b6e87de1d2cb8e6b8f5 (diff)
documentation: embedd property definitions in man page, README and README.html
Mangle the README.rst once into a README.patched.rst and use that to produce the three different flavors of the documentation.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am31
1 files changed, 23 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am
index dbfd322d..2608842c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -232,22 +232,37 @@ installcheck-local:
done
endif
-# patch README.rst properties on-the-fly with sed expressions
-PATCH_README = -e "s/^:Version: .*/:Version: $(VERSION)/" -e "s/:Date: .*/:Date: `date +%Y-%m-%d`/"
+
+# patch README.rst properties on-the-fly
+README.patched.rst: README.rst src/syncevolution
+ perl -e '$$syncfound=0; $$sourcefound=0; $$res=0;' \
+ -e 'sub run { $$cmd = shift; $$buffer = `$$cmd`; die if $$?; return $$buffer; }' \
+ -e 'while (<>) {' \
+ -e 's/^:Version: .*/:Version: $(VERSION)/;' \
+ -e 's/:Date: .*/":Date: " . `date +%Y-%m-%d`/e;' \
+ -e 'if (s;<<insert sync-property>>\n;run("src/syncevolution --daemon=no --sync-property ?");e) { $$syncfound=1; }' \
+ -e 'if (s;<<insert source-property>>\n;run("src/syncevolution --daemon=no --source-property ?");e) { $$sourcefound=1; }' \
+ -e 'print;' \
+ -e '}' \
+ -e 'die "<<insert sync-property>> not in README.rst?!" unless $$syncfound;' \
+ -e 'die "<<insert source-property>> not in README.rst?!" unless $$sourcefound;' \
+ -e 'exit $$res;' \
+ $< >$@
+CLEANFILES += README.patched.rst
# produce man pages
-syncevolution.1: README.rst
- sed $(PATCH_README) $< | $(RST2MAN) --exit-status=3 - >$@
+syncevolution.1: README.patched.rst
+ $(RST2MAN) --exit-status=3 $< >$@
CLEANFILES += syncevolution.1
# README is the traditional name in the distribution,
# continue using it instead of README.rst.
-README: README.rst
- sed $(PATCH_README) $< >$@
+README: README.patched.rst
+ cp $< $@
CLEANFILES += README
# The README.html is also used on syncevolution.org as "Usage" page,
# therefore we must use <h3> headers and lower to fit into the page.
-README.html: README.rst
- sed $(PATCH_README) $< | $(RST2HTML) --initial-header-level=3 --exit-status=3 - >$@
+README.html: README.patched.rst
+ $(RST2HTML) --initial-header-level=3 --exit-status=3 $< >$@
CLEANFILES += README.html