On Mon, 1 Jun 2009 14:30:55 +0200
Pierre Ossman <oss...@cendio.se> wrote:

> On Mon, 01 Jun 2009 13:17:17 +0200
> Peter Rosin <p...@lysator.liu.se> wrote:
> 
> > 
> > Those are spelled rst2newlatex.py and rst2html.py on my system.
> > What are their canonical names?
> > 
> 
> Upstream uses the .py suffix. Annoying...
> 
> I guess we need to do something clever here.
> 

How about this:

Index: rsttool
===================================================================
--- rsttool     (revision 0)
+++ rsttool     (revision 0)
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# This is a small wrapper to work around the fact that the
+# docutils tools are named differently in different distributions.
+#
+
+if [ $# -lt 1 ]; then
+  echo "Syntax:"
+  echo "    $0 <tool name> [args...]"
+  exit 1
+fi
+
+TOOL="$1"
+shift
+
+# Upstream name
+if type -t "$TOOL.py" > /dev/null; then
+  exec "$TOOL.py" "$@"
+fi
+
+# "Santised" name
+if type -t "$TOOL" > /dev/null; then
+  exec "$TOOL" "$@"
+fi
+
+echo docutils tool $TOOL could not be found
+exit 1
+

Property changes on: rsttool
___________________________________________________________________
Added: svn:executable
   + *

Index: Makefile
===================================================================
--- Makefile    (revision 0)
+++ Makefile    (revision 0)
@@ -0,0 +1,14 @@
+all: rfbproto.pdf rfbproto.html
+
+.SUFFIXES : .rst .pdf .html
+
+.rst.pdf:
+       mkdir -p tmp
+       ./rsttool rst2newlatex "$<" tmp/tmp.tex
+       (cd tmp; pdflatex tmp.tex)
+       # We need to run it twice for links and TOC to work
+       (cd tmp; pdflatex tmp.tex)
+       mv tmp/tmp.pdf "$@"
+
+.rst.html:
+       ./rsttool rst2html "$<" "$@"


-- 
Pierre Ossman            OpenSource-based Thin Client Technology
System Developer         Telephone: +46-13-21 46 00
Cendio AB                Web: http://www.cendio.com

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
tigervnc-rfbproto mailing list
tigervnc-rfbproto@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-rfbproto

Reply via email to