]> granicus.if.org Git - docbook-dsssl/commitdiff
Added support for freshmeat target
authorNorman Walsh <ndw@nwalsh.com>
Sun, 21 Dec 2003 20:55:57 +0000 (20:55 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sun, 21 Dec 2003 20:55:57 +0000 (20:55 +0000)
docbook/simple/Makefile
docbook/simple/freshmeat.xsl [new file with mode: 0644]

index 637dd5f40832cd7e83865d8ac69fd44027643d58..4a0dc8fb99df5401bbde062b5be7936da07da2dc 100644 (file)
@@ -1,7 +1,8 @@
 include ../../cvstools/Makefile.incl
 
 MODULES=sdbcent.mod sdbhier.mod sdbpool.mod sinclist.mod
-VERSION=1.1CR1
+VERSION=
+FMGO=-N
 
 all: sdocbook.dtd sdocbookref.dtd
 
@@ -11,6 +12,14 @@ test:
        $(XJPARSE) test.xml
        $(XJPARSE) testcss.xml
 
+freshmeat:
+ifeq ($(VERSION),)
+       @echo "You must specify the version (VERSION)"
+else
+       $(XSLT) freshmeat.xsl freshmeat.xsl /tmp/fm-docbook-simple version=$(VERSION)
+       grep -v "<?xml" /tmp/fm-docbook-simple | freshmeat-submit $(FMGO)
+endif
+
 sdocbook.dtd: sdocbook-custom.dtd $(MODULES)
        $(XJPARSE) tests/testcust.xml
        $(FLATTEN) sdocbook-custom.dtd > sdocbook.dtd
diff --git a/docbook/simple/freshmeat.xsl b/docbook/simple/freshmeat.xsl
new file mode 100644 (file)
index 0000000..582ee0b
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version='1.0'?> <!-- -*- nxml -*- -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
+               xmlns:sf="http://sourceforge.net/"
+               exclude-result-prefixes="fm sf"
+                version='1.0'>
+
+<xsl:param name="version" select="''"/>
+<xsl:param name="branch" select="'Simplified DocBook'"/>
+
+<xsl:strip-space elements="fm:*"/>
+
+<fm:project>
+  <fm:Project>DocBook</fm:Project>
+  <fm:Branch>{BRANCH}</fm:Branch>
+  <fm:Version>{VERSION}</fm:Version>
+  <fm:Release-Focus>
+  <!-- initial freshmeat announcement -->
+  <!-- documentation -->
+  <!-- code cleanup -->
+  minor feature enhancements
+  <!-- major feature enhancements -->
+  <!-- minor bugfixes -->
+  <!-- major bugfixes -->
+  <!-- minor security fixes -->
+  <!-- major security fixes -->
+  </fm:Release-Focus>
+  <fm:Home-Page-URL>http://docbook.org/xml/simple/{VERSION}/</fm:Home-Page-URL>
+  <fm:Zipped-Tar-URL>http://docbook.org/xml/simple/{VERSION}/docbook-simple-{VERSION}.zip</fm:Zipped-Tar-URL>
+  <fm:Changelog-URL>http://docbook.org/xml/simple/{VERSION}/ChangeLog</fm:Changelog-URL>
+  <fm:CVS-URL>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/docbook/docbook/xml/simple/</fm:CVS-URL>
+  <fm:Mailing-List-URL>http://lists.oasis-open.org/archives/docbook/</fm:Mailing-List-URL>
+  <fm:Changes>Simplified DocBook V1.1 is based on DocBook XML V4.3. It
+includes support for HTML tables.
+  </fm:Changes>  
+</fm:project>
+
+<xsl:template match="/" priority="-100">
+  <xsl:if test="$version = ''">
+    <xsl:message terminate="yes">
+      <xsl:text>You must specify the version.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:apply-templates select="//fm:project"/>
+</xsl:template>
+
+<xsl:template match="fm:project">
+  <xsl:text>&#10;</xsl:text>
+  <xsl:apply-templates/>
+  <xsl:text>&#10;</xsl:text>
+  <xsl:apply-templates select="fm:Changes" mode="text"/>
+</xsl:template>
+
+<xsl:template match="fm:Changes"/>
+
+<xsl:template match="fm:*">
+  <xsl:value-of select="local-name(.)"/>
+  <xsl:text>: </xsl:text>
+  <xsl:call-template name="value">
+    <xsl:with-param name="text" select="normalize-space(.)"/>
+  </xsl:call-template>
+  <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template name="value">
+  <xsl:param name="text"/>
+
+  <xsl:variable name="sub-version">
+    <xsl:call-template name="string.subst">
+      <xsl:with-param name="string" select="$text"/>
+      <xsl:with-param name="target" select="'{VERSION}'"/>
+      <xsl:with-param name="replacement" select="$version"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:call-template name="string.subst">
+    <xsl:with-param name="string" select="$sub-version"/>
+    <xsl:with-param name="target" select="'{BRANCH}'"/>
+    <xsl:with-param name="replacement" select="$branch"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="string.subst">
+  <xsl:param name="string"/>
+  <xsl:param name="target"/>
+  <xsl:param name="replacement"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($string, $target)">
+      <xsl:variable name="rest">
+        <xsl:call-template name="string.subst">
+          <xsl:with-param name="string" select="substring-after($string, $target)"/>
+          <xsl:with-param name="target" select="$target"/>
+          <xsl:with-param name="replacement" select="$replacement"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:value-of select="concat(substring-before($string, $target),                                    $replacement,                                    $rest)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$string"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>