From 823702fb40ab6283fdb9375bb2e3dc6ea680c3ec Mon Sep 17 00:00:00 2001
From: mstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>
Date: Sun, 1 Dec 2013 21:45:29 +0000
Subject: tex: tweak generated output file names

Tweak output to match oasis requirements.
Make it possible to specify output name through
environment, and set draft stage and version
automatically.

Add script to export all files in a zip archive.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@142 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
---
 specvars.tex | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)

(limited to 'specvars.tex')

diff --git a/specvars.tex b/specvars.tex
index 44e9383..accfc66 100644
--- a/specvars.tex
+++ b/specvars.tex
@@ -1,10 +1,34 @@
 % define VIRTIO Working Draft number and date
 \newcommand{\virtiorev}{1.0}
-\newcommand{\virtiodraftstage}{csd}
-\newcommand{\virtiodraftstagename}{Committee Specification Draft}
-\newcommand{\virtioversion}{Virtual I/O Device (VIRTIO) Version \virtiorev}
-\newcommand{\virtioworkingdraft}{01}
 \newcommand{\virtioworkingdraftdate}{05 Nov 2013}
+\newcommand{\virtioworkingdraft}{01}
+\newcommand{\virtiodraftstage}{wd}
+\newcommand{\virtiodraftstagename}{Working Draft}
+% Detect current stage and version based on document name
+\IfSubStr{\jobname}{-wd}{
+\renewcommand{\virtioworkingdraft}{\StrBehind{\jobname}{-wd}}
+}
+\IfSubStr{\jobname}{-os}{
+\renewcommand{\virtiodraftstage}{os}
+\renewcommand{\virtiodraftstagename}{OASIS Standard}
+\newcommand{\virtioworkingdraft}{}
+}
+\IfSubStr{\jobname}{-cs}{
+\renewcommand{\virtiodraftstage}{cs}
+\renewcommand{\virtiodraftstagename}{Committee Specification}
+\renewcommand{\virtioworkingdraft}{}
+}
+\IfSubStr{\jobname}{-csd}{
+\renewcommand{\virtiodraftstage}{csd}
+\renewcommand{\virtiodraftstagename}{Committee Specification Draft}
+\renewcommand{\virtioworkingdraft}{\StrBehind{\jobname}{-csd}}
+}
+\IfSubStr{\jobname}{-csprd}{
+\renewcommand{\virtiodraftstage}{csprd}
+\renewcommand{\virtiodraftstagename}{Committee Specification Public Review Draft}
+\renewcommand{\virtioworkingdraft}{\StrBehind{\jobname}{-csprd}}
+}
+\newcommand{\virtioversion}{Virtual I/O Device (VIRTIO) Version \virtiorev}
 \newcommand{\virtiospecfile}{virtio-v\virtiorev-\virtiodraftstage\virtioworkingdraft}
 \newcommand{\virtiourlbase}{http://docs.oasis-open.org/virtio/virtio/\virtiorev/\virtiodraftstage\virtioworkingdraft}
 \newcommand{\virtioworkproduct}{Standards Track Work Product}
-- 
cgit v1.2.3

