]> granicus.if.org Git - docbook-dsssl/commitdiff
Support freshmeat target
authorNorman Walsh <ndw@nwalsh.com>
Sun, 21 Dec 2003 18:36:42 +0000 (18:36 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sun, 21 Dec 2003 18:36:42 +0000 (18:36 +0000)
docbook/xml/Makefile
docbook/xml/freshmeat.xsl [new file with mode: 0644]

index 1690f570382683e1bf91b2e81dff73f5ea38d389..21ed69bc263c0a0f90a9616b618cf2d51c0ed284 100644 (file)
@@ -2,11 +2,20 @@ include ../../cvstools/Makefile.incl
 
 OLDVER=
 NEWVER=
+FMGO=-N
 
 distrib:
        $(MAKE) -C ../spec SPECVER=$(NEWVER)
        $(DTDDISTRIB) -d -v $(OLDVER) -n $(NEWVER)
 
+freshmeat:
+ifeq ($(NEWVER),)
+       @echo "You must specify the version (NEWVER)"
+else
+       $(XSLT) freshmeat.xsl freshmeat.xsl /tmp/fm-docbook-dtd version=$(NEWVER)
+       grep -v "<?xml" /tmp/fm-docbook-dtd | freshmeat-submit $(FMGO)
+endif
+
 doc:
 ifeq ($(NEWVER),)
        @echo "You must specify the version (NEWVER)"
diff --git a/docbook/xml/freshmeat.xsl b/docbook/xml/freshmeat.xsl
new file mode 100644 (file)
index 0000000..f9a5b47
--- /dev/null
@@ -0,0 +1,128 @@
+<?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">
+  <xsl:choose>
+    <xsl:when test="contains($version,'b') or contains($version,'CR')">
+      <xsl:value-of select="'DTD (unofficial)'"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="'DTD (official)'"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+
+<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/{VERSION}/</fm:Home-Page-URL>
+  <fm:Zipped-Tar-URL>http://docbook.org/xml/{VERSION}/docbook-xml-{VERSION}.zip</fm:Zipped-Tar-URL>
+  <fm:Changelog-URL>http://docbook.org/xml/{VERSION}/ChangeLog</fm:Changelog-URL>
+  <fm:CVS-URL>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/docbook/docbook/xml/</fm:CVS-URL>
+  <fm:Mailing-List-URL>http://lists.oasis-open.org/archives/docbook/</fm:Mailing-List-URL>
+  <fm:Changes>There are no backwards-incompatible changes in this release.
+
+If HTML tables are allowed, make sure that caption gets all of the HTML attributes.
+
+Refactored parameter entities for informaltable so that the initial textobject is allowed when (and only when) the CALS table model is used.
+  </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:choose>
+    <xsl:when test="$branch = 'DTD (official)'"/>
+    <xsl:when test="$branch = 'DTD (unofficial)'"/>
+    <xsl:otherwise>
+      <xsl:message terminate="yes">
+       <xsl:text>You must specify the branch.</xsl:text>
+      </xsl:message>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <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>