[clapham/el6/master] Initial import (#668240).

Eric Smith brouhaha at fedoraproject.org
Fri Apr 29 08:25:44 UTC 2011


commit d668e806acbadecf4196d633c065468caf4f1c40
Author: Eric Smith <eric at brouhaha.com>
Date:   Fri Apr 29 01:25:36 2011 -0700

    Initial import (#668240).

 .gitignore           |    1 +
 clapham-libdir.patch |   64 ++++++++++++++++++++++++++++++
 clapham-msword.patch |   21 ++++++++++
 clapham-noivy.patch  |   89 ++++++++++++++++++++++++++++++++++++++++++
 clapham.sh           |   17 ++++++++
 clapham.spec         |  106 ++++++++++++++++++++++++++++++++++++++++++++++++++
 sources              |    1 +
 7 files changed, 299 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..5b17b72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/clapham-0.1.003-src.zip
diff --git a/clapham-libdir.patch b/clapham-libdir.patch
new file mode 100644
index 0000000..5046ae5
--- /dev/null
+++ b/clapham-libdir.patch
@@ -0,0 +1,64 @@
+diff -up clapham-0.1.003/build.xml.libdir clapham-0.1.003/build.xml
+--- clapham-0.1.003/build.xml.libdir	2011-01-09 01:15:39.000000000 -0800
++++ clapham-0.1.003/build.xml	2011-01-09 01:18:40.000000000 -0800
+@@ -20,6 +20,9 @@
+ <!--
+   == Changes by <eric at brouhaha.com> for Fedora RPM build:
+   ==   All references to Ivy removed
++  ==   added javacc.dir and batik.dir properties and used in classpath
++  ==   javacchome set to javacc.dir
++  ==   jar build in top directory rather than lib.dir
+ -->
+ <project name="clapham" default="compile">
+     <property environment="env"/>
+@@ -37,6 +40,8 @@
+     <property name="testclasses.dir" location="${basedir}/testclasses"/>
+     <property name="javadoc.dir" value="doc/api"/>
+     <property name="javadoc.location" value="${project.location}/doc/api"/>
++    <property name="javacc.dir" value="/usr/share/java"/>
++    <property name="batik.dir" value="/usr/share/java/batik"/>
+     <property name="lib.dir" value="lib"/>
+     <property name="lib.location" location="${project.location}/lib"/>
+     <property name="testlib.dir" value="testlib"/>
+@@ -46,11 +51,11 @@
+     <property name="project.build.debug" value="on"/>
+ 
+     <path id="project.classpath">
+-        <pathelement location="${lib.dir}/javacc.jar"/>
+-        <pathelement location="${lib.dir}/batik-svggen.jar"/>
+-        <pathelement location="${lib.dir}/batik-awt-util.jar"/>
+-        <pathelement location="${lib.dir}/batik-transcoder.jar"/>
+-        <pathelement location="${lib.dir}/batik-util.jar"/>
++        <pathelement location="${javacc.dir}/javacc.jar"/>
++        <pathelement location="${batik.dir}/batik-svggen.jar"/>
++        <pathelement location="${batik.dir}/batik-awt-util.jar"/>
++        <pathelement location="${batik.dir}/batik-transcoder.jar"/>
++        <pathelement location="${batik.dir}/batik-util.jar"/>
+         <pathelement location="${ant.home}/lib/ant.jar"/>
+         <pathelement location="${ant.home}/lib/optional.jar"/>
+     </path>
+@@ -67,13 +72,13 @@
+     <target name="wirth-parser">
+         <javacc
+                 target="src/net/hydromatic/clapham/parser/wirth/WirthParser.jj"
+-                javacchome="${basedir}/lib"/>
++                javacchome="${javacc.dir}"/>
+     </target>
+ 
+     <target name="bnf-parser">
+         <javacc
+                 target="src/net/hydromatic/clapham/parser/bnf/BnfParser.jj"
+-                javacchome="${basedir}/lib"/>
++                javacchome="${javacc.dir}"/>
+     </target>
+ 
+     <target name="prepare">
+@@ -109,7 +114,7 @@ Vendor: ${vendor}
+ 
+     <target name="jar" depends="compile,version"
+             description="Jars up the bin directory after a compile">
+-        <jar destfile="${lib.dir}/${project.name}.jar">
++        <jar destfile="${project.name}.jar">
+             <zipfileset dir="${classes.dir}" prefix="" includes="**/*"/>
+             <zipfileset dir="${basedir}" prefix=""
+                         includes="
diff --git a/clapham-msword.patch b/clapham-msword.patch
new file mode 100644
index 0000000..b51eed0
--- /dev/null
+++ b/clapham-msword.patch
@@ -0,0 +1,21 @@
+diff -up clapham-0.1.003/testsrc/net/hydromatic/clapham/test/ClaphamTest.java.msword clapham-0.1.003/testsrc/net/hydromatic/clapham/test/ClaphamTest.java
+--- clapham-0.1.003/testsrc/net/hydromatic/clapham/test/ClaphamTest.java.msword	2009-05-11 01:12:10.000000000 -0700
++++ clapham-0.1.003/testsrc/net/hydromatic/clapham/test/ClaphamTest.java	2011-01-09 02:30:38.000000000 -0800
+@@ -82,7 +82,7 @@ public class ClaphamTest extends TestCas
+         + "LITERAL    ::= <QUOT> <CHARACTER>+ <QUOT>";
+ 
+     //    BNF (not supported yet)
+-    // See http://en.wikipedia.org/wiki/Backus–Naur_Form
++    // See http://en.wikipedia.org/wiki/Backus-Naur_Form
+     //
+     // <syntax> ::= <rule> | <rule> <syntax>
+     // <rule>   ::= <opt-whitespace> "<" <rule-name> ">" <opt-whitespace> "::="
+@@ -95,7 +95,7 @@ public class ClaphamTest extends TestCas
+     // <literal> ::= '"' <text> '"' | "'" <text> "'" <!-- actually, the original BNF did not use quotes -->
+ 
+     // Augmented BNF (not supported yet)
+-    // See http://en.wikipedia.org/wiki/Augmented_Backus–Naur_Form
++    // See http://en.wikipedia.org/wiki/Augmented_Backus-Naur_Form
+     //
+     // As BNF, but:
+     // rule = definition ; comment CR LF
diff --git a/clapham-noivy.patch b/clapham-noivy.patch
new file mode 100644
index 0000000..2acbfa4
--- /dev/null
+++ b/clapham-noivy.patch
@@ -0,0 +1,89 @@
+diff -up clapham-0.1.003/build.xml.noivy clapham-0.1.003/build.xml
+--- clapham-0.1.003/build.xml.noivy	2009-05-11 01:16:38.000000000 -0700
++++ clapham-0.1.003/build.xml	2011-01-09 00:57:47.000000000 -0800
+@@ -17,7 +17,11 @@
+   == along with this program; if not, write to the Free Software
+   == Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ -->
+-<project name="clapham" default="compile" xmlns:ivy="antlib:org.apache.ivy.ant">
++<!--
++  == Changes by <eric at brouhaha.com> for Fedora RPM build:
++  ==   All references to Ivy removed
++-->
++<project name="clapham" default="compile">
+     <property environment="env"/>
+     <property file="build.properties"/>
+ 
+@@ -26,11 +30,6 @@
+     <property name="version" value="${project.revision}"/>
+     <property name="vendor" value="${project.vendor}"/>
+ 
+-    <!-- Define desired ivy version and location. -->
+-    <property name="ivy.install.version" value="2.0.0-rc2"/>
+-    <property name="ivy.jar.dir" value="${basedir}/ivy"/>
+-    <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
+-
+     <property name="project.location" location="${basedir}"/>
+     <property name="src.dir" location="${basedir}/src"/>
+     <property name="testsrc.dir" location="${basedir}/testsrc"/>
+@@ -65,43 +64,6 @@
+         <path refid="project.build.classpath"/>
+     </path>
+ 
+-    <!-- Bootstrap Ivy from web site so that it can be used without any special
+-         installation. Then of course it will load all of the other jars we
+-         need. -->
+-    <target name="download-ivy" unless="skip.download">
+-        <mkdir dir="${ivy.jar.dir}"/>
+-        <get
+-                src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
+-                dest="${ivy.jar.file}"
+-                usetimestamp="true"/>
+-    </target>
+-
+-    <!-- Define ivy tasks. If you put ivy.jar in your ant lib directory, this
+-         task is not necessary. -->
+-    <target name="install-ivy" depends="download-ivy">
+-        <!-- Try to load ivy here from local ivy dir, in case the user has not
+-             already dropped it into ant's lib dir. (Note that the latter copy
+-             will always take precedence.) We will not fail as long as local
+-             lib dir exists (it may be empty) and ivy is in at least one of
+-             ant's lib dir or the local lib dir. -->
+-        <path id="ivy.lib.path">
+-            <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
+-        </path>
+-        <taskdef
+-                resource="org/apache/ivy/ant/antlib.xml"
+-                uri="antlib:org.apache.ivy.ant"
+-                classpathref="ivy.lib.path"/>
+-        <ivy:settings file="${basedir}/ivysettings.xml"/>
+-    </target>
+-
+-    <target name="clean-ivy">
+-        <delete dir="${ivy.jar.dir}"/>
+-    </target>
+-
+-    <target name="clean-cache" depends="install-ivy">
+-        <ivy:cleancache/>
+-    </target>
+-
+     <target name="wirth-parser">
+         <javacc
+                 target="src/net/hydromatic/clapham/parser/wirth/WirthParser.jj"
+@@ -114,15 +76,10 @@
+                 javacchome="${basedir}/lib"/>
+     </target>
+ 
+-    <target name="prepare" depends="download-ivy,install-ivy,resolve">
++    <target name="prepare">
+         <mkdir dir="${classes.dir}"/>
+     </target>
+ 
+-    <target name="resolve" unless="skip.download">
+-        <ivy:resolve file="ivy.xml"/>
+-        <ivy:retrieve pattern="${lib.dir}/[module].[ext]"/>
+-    </target>
+-
+     <target name="all" depends="prepare,wirth-parser,bnf-parser,compile"/>
+ 
+     <target name="compile" depends="
diff --git a/clapham.sh b/clapham.sh
new file mode 100644
index 0000000..f69db15
--- /dev/null
+++ b/clapham.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+if [ -f /usr/share/java-utils/java-functions ] ;
+then 
+  . /usr/share/java-utils/java-functions
+else
+  echo "Can't find functions library, aborting"
+  exit 1
+fi
+
+# Configuration
+MAIN_CLASS=net.hydromatic.clapham.Clapham
+
+# Set parameters
+set_classpath "clapham batik xml-commons-apis-ext"
+
+# Let's start
+run "$@"
diff --git a/clapham.spec b/clapham.spec
new file mode 100644
index 0000000..a4305bf
--- /dev/null
+++ b/clapham.spec
@@ -0,0 +1,106 @@
+Name:           clapham
+Version:        0.1.003
+Release:        4%{?dist}
+Summary:        Railroad diagram generator for computer languages
+URL:            http://clapham.hydromatic.net/
+License:        GPLv2
+# NOTE: Clapham is not under a GPLv2+ license, because it only allows
+# use of later versions if they are "approved by The Eigenbase Project".
+Group:          Applications/Engineering
+
+Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}-src.zip
+Source1:        %{name}.sh
+
+# Remove use of Apache Ivy, unnecessary to build Fedora RPM:
+Patch0:         %{name}-noivy.patch
+
+# Set library paths for Fedora:
+Patch1:         %{name}-libdir.patch
+
+# Replace gratuitous use of Microsoft Word (non-Unicode) character codes in
+# a source file:
+Patch2:         %{name}-msword.patch
+
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch:      noarch
+
+BuildRequires:  dos2unix
+BuildRequires:  batik javacc
+BuildRequires:  ant ant-nodeps java-devel >= 1:1.6.0 jpackage-utils
+
+Requires:       batik xml-commons-apis
+Requires:       java >= 1:1.6.0 jpackage-utils
+
+
+%description
+Clapham is an open-source railroad diagram generator.
+Railroad diagrams are a graphical way of representing the grammar of a
+computer language. When a computer language is large, even people who
+use the language day-to-day have trouble remembering its nuances. A
+railroad diagram represents the grammar visually, and is easier to
+understand by non- or semi-technical users.
+
+%package javadoc
+Summary:        Javadocs for clapham
+Requires:       %{name} = %{version}-%{release}
+
+%description javadoc
+This package contains the API documentation for the Clapham railroad
+diagram generator.
+
+%prep
+%setup -q
+%patch0 -p1 -b .noivy
+%patch1 -p1 -b .libdir
+%patch2 -p1 -b .msword
+rm ivy.xml ivysettings.xml
+find -name '*.class' -exec rm -f '{}' \;
+find -name '*.jar' -exec rm -f '{}' \;
+dos2unix README.txt
+
+%build
+ant jar javadoc
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_javadir}
+install -m644 %{name}.jar %{buildroot}%{_javadir}/
+mkdir -p %{buildroot}%{_bindir}
+install -m644 %{SOURCE1} %{buildroot}%{_bindir}/%{name}
+mkdir -p %{buildroot}%{_javadocdir}
+cp -a doc/api %{buildroot}%{_javadocdir}/%{name}
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{_javadir}/%{name}.jar
+%attr(755, root, root) %{_bindir}/%{name}
+%doc README.txt
+%doc VERSION.txt
+# example input files:
+%doc testsrc/net/hydromatic/%{name}/example/*.bnf
+%doc testsrc/net/hydromatic/%{name}/example/*.java
+# example code:
+%doc testsrc/net/hydromatic/%{name}/test/*.java
+
+%files javadoc
+%defattr(-,root,root,-)
+%{_javadocdir}/%{name}
+
+%changelog
+* Wed Apr 27 2011 Eric Smith <eric at brouhaha.com> - 0.1.003-4
+- added javadoc subpackage dependency on main package
+- changed javadoc subpackage summary for consistency with other Java packages
+
+* Mon Apr 11 2011 Eric Smith <eric at brouhaha.com> - 0.1.003-3
+- changed license from GPLv2+ to GPLv2, with comment explaining.
+- added comments explaining purpose of patches.
+
+* Thu Apr  7 2011 Eric Smith <eric at brouhaha.com> - 0.1.003-2
+- minor spec file changes based on package review comments by
+  Mario Blättermann.
+
+* Sun Jan  9 2011 Eric Smith <eric at brouhaha.com> - 0.1.003-1
+- initial version
diff --git a/sources b/sources
index e69de29..ce992e0 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+97a38474095b142936d6bb922a178773  clapham-0.1.003-src.zip


More information about the scm-commits mailing list