[fmpp/f20] initial SRPM import
William Christian Benton
willb at fedoraproject.org
Mon Jan 6 16:47:49 UTC 2014
commit 045425831c9b8826f6fe9134b4de368cb39b0067
Author: William Benton <willb at redhat.com>
Date: Mon Jan 6 10:47:34 2014 -0600
initial SRPM import
.gitignore | 1 +
fmpp-0.9.14-build.xml.patch | 201 ++++++++++++++++++++++++++++++++++++
fmpp-0.9.14-excise-imageinfo.patch | 60 +++++++++++
fmpp.spec | 121 ++++++++++++++++++++++
sources | 1 +
5 files changed, 384 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..bf7fbe8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/fmpp_0.9.14.tar.gz
diff --git a/fmpp-0.9.14-build.xml.patch b/fmpp-0.9.14-build.xml.patch
new file mode 100644
index 0000000..79c0b5c
--- /dev/null
+++ b/fmpp-0.9.14-build.xml.patch
@@ -0,0 +1,201 @@
+--- a/build.xml 2014-01-03 11:30:51.394013853 -0600
++++ b/build.xml 2014-01-03 16:40:50.443984812 -0600
+@@ -12,25 +12,19 @@
+ classname="java.lang.Object" ignoresystemclasses="true"
+ property="bootclasspath.correct" />
+
+- <property name="freemarker.lib" value="lib/freemarker.jar" />
+- <property name="oro.lib" value="lib/oro.jar" />
+- <property name="bsh.lib" value="lib/bsh.jar" />
+- <property name="jaxp.lib" value="lib/forbuild/jaxp.jar" />
+- <property name="sax.lib" value="lib/forbuild/sax.jar" />
+- <property name="dom.lib" value="lib/forbuild/dom.jar" />
+- <property name="resolver.lib" value="lib/resolver.jar" />
++ <property name="freemarker.lib" value="/usr/share/java/freemarker.jar" />
++ <property name="oro.lib" value="/usr/share/java/oro.jar" />
++ <property name="bsh.lib" value="/usr/share/java/bsh.jar" />
++ <property name="xmlapis.lib" value="/usr/share/java/xml-apis.jar" />
++ <property name="resolver.lib" value="/usr/share/java/xml-resolver.jar" />
+
+ <path id="classpath.path">
+ <pathelement path="${freemarker.lib}" />
+ <pathelement path="${oro.lib}" />
+ <pathelement path="${bsh.lib}" />
+- <pathelement path="${jaxp.lib}" />
+- <pathelement path="${sax.lib}" />
+- <pathelement path="${dom.lib}" />
++ <pathelement path="${xmlapis.lib}" />
+ <pathelement path="${resolver.lib}" />
+- <pathelement path="lib/fmpp.jar" />
+- <pathelement path="lib/forbuild/classes/" />
+- <pathelement path="${env.ANT_HOME}/lib/ant.jar" />
++ <pathelement path="/usr/share/java/ant.jar" />
+ </path>
+
+ <target name="init">
+@@ -56,7 +50,6 @@
+ <jar basedir="build/compile" jarfile="lib/fmpp.jar">
+ <manifest>
+ <attribute name="Main-Class" value="fmpp.tools.CommandLine" />
+- <attribute name="Class-Path" value="oro.jar freemarker.jar bsh.jar resolver.jar" />
+ <attribute name="Extension-name" value="fmpp" />
+ <attribute name="Specification-Title" value="FMPP" />
+ <attribute name="Specification-Version" value="${version}" />
+@@ -84,16 +77,17 @@
+ destdir="build/compile"
+ deprecation="off"
+ debug="on"
+- source="1.2"
+- target="1.2"
++ source="1.5"
++ target="1.5"
++ encoding="UTF-8"
+ >
+ <classpath refid="classpath.path" />
+ </javac>
+- <copy todir="build/compile">
++<!-- <copy todir="build/compile">
+ <fileset dir="lib/forbuild/classes">
+ <exclude name="**/*.java*" />
+ </fileset>
+- </copy>
++ </copy>
-->
+ <copy
+ file="src/java/fmpp/version.properties" todir="build/compile/fmpp"
+ overwrite="true"
+@@ -159,6 +153,8 @@
+ classpathref="classpath.path"
+ version="false"
+ author="false"
++ source="1.5"
++ encoding="UTF-8"
+ />
+ </target>
+
+@@ -177,7 +173,8 @@
+ we (re)build fmpp.jar in this VM, and also because this task should work
+ without installing FMPP for Ant.
+ -->
+- <java fork="true" jar="${basedir}/lib/fmpp.jar" failonerror="true">
++ <java fork="true" classname="fmpp.tools.CommandLine" classpath="${basedir}/lib/fmpp.jar" failonerror="true">
++ <classpath refid="classpath.path" />
+ <sysproperty key="fmpp.home" value="${basedir}" />
+ <arg value="-C${basedir}/fmppgdoc.fmpp" />
+ <arg value='-D online:${online}' />
+@@ -207,12 +204,7 @@
+ <exclude name="README.txt" />
+ </fileset>
+ <fileset dir=".">
+- <include name="lib/forbuild/**" />
+ <include name="lib/fmpp.jar" />
+- <include name="lib/oro.jar" />
+- <include name="lib/freemarker.jar" />
+- <include name="lib/bsh.jar" />
+- <include name="lib/resolver.jar" />
+ </fileset>
+ </copy>
+ <copy file="README.txt" todir="dist/fmpp_${version}" filtering="true" />
+@@ -267,16 +259,23 @@
+ destdir="build/testsuite/compile"
+ deprecation="on"
+ debug="on"
+- source="1.2"
+- target="1.2"
++ source="1.5"
++ target="1.5"
+ >
+- <classpath refid="classpath.path" />
++ <classpath>
++ <path refid="classpath.path" />
++ <pathelement path="lib/fmpp.jar" />
++ </classpath>
++
+ </javac>
+ <property name="fmpp.testcase" value="" />
+ <java fork="true"
+- classname="fmpp.testsuite.TestSuite"
+- classpath="lib/fmpp.jar;${xpathSupport.lib};build/testsuite/compile"
+- >
++ classname="fmpp.testsuite.TestSuite">
++ <classpath>
++ <path refid="classpath.path" />
++ <pathelement path="lib/fmpp.jar;${xpathSupport.lib};build/testsuite/compile"/>
++ </classpath>
++
+ <arg value="${basedir}" />
+ <arg value="${fmpp.testcase}" />
+ </java>
+@@ -297,15 +296,7 @@
+ </delete>
+ </target>
+
+- <!--
+- Uploads the fmpp.jar that is in the current DISTRIBUTION DIRECTORY
+- into the place that the central Maven2 repository syncs itself with
+- periodically. Of course it also uploads the Maven-specific metadata files.
+-
+- Note: maven-ant-tasks-x.x.x.jar must be added to ${ANT_HOME}/lib for
+- this to work. Get it here: http://maven.apache.org/download.html
+- -->
+- <target name="maven-upload" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
++ <target name="make-pom">
+ <echo file="build/pom.xml"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+@@ -358,49 +349,6 @@
+ </dependencies>
+ </project>
+ ]]></echo>
+-
+- <jar destfile="build/maven-source-attachment.jar" basedir="src/java" />
+-
+- <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>
+-
+- <input
+- validargs="y,n"
+- addproperty="mavenUpload.answer"
+- ><!--
+- -->You are about uploading dist/fmpp_${version}/lib/fmpp.jar <!--
+- -->into the Maven central repostiry sync. directory. <!--
+- -->Be sure that's the final (released) variation there, <!--
+- -->and that the version number is correct. <!--
+- -->Proceed? <!--
+- --></input>
+- <condition property="mavenUpload.yes">
+- <equals arg1="y" arg2="${mavenUpload.answer}"/>
+- </condition>
+- <fail unless="mavenUpload.yes" message="Task aborted by user." />
+-
+- <input
+- message="Enter your SourceForge.net user name: "
+- addproperty="mavenUpload.user"
+- />
+- <input
+- message="Enter your SourceForge.net password (WILL BE DISPLAYED AS YOU TYPE IT!): "
+- addproperty="mavenUpload.password"
+- />
+-
+- <artifact:deploy file="dist/fmpp_${version}/lib/fmpp.jar">
+- <remoteRepository url="sftp://web.sourceforge.net/home/groups/f/fm/fmpp/htdocs/maven2">
+- <authentication
+- username="${mavenUpload.user},fmpp"
+- password="${mavenUpload.password}"
+- />
+- </remoteRepository>
+- <pom file="build/pom.xml" />
+- <attach file="build/maven-source-attachment.jar" classifier="sources" />
+- </artifact:deploy>
+-
+- <echo>**********************************************</echo>
+- <echo>CLEAR THE SCREEN, NOW! Your password is on it!</echo>
+- <echo>**********************************************</echo>
+ </target>
+
+ <target name="qinstall" depends="init"
+@@ -510,4 +458,4 @@
+ <echo>*************************************************************</echo>
+ </target>
+
+-</project>
+\ No newline at end of file
++</project>
diff --git a/fmpp-0.9.14-excise-imageinfo.patch b/fmpp-0.9.14-excise-imageinfo.patch
new file mode 100644
index 0000000..cacb78f
--- /dev/null
+++ b/fmpp-0.9.14-excise-imageinfo.patch
@@ -0,0 +1,60 @@
+--- a/src/java/fmpp/dataloaders/HtmlUtilsDataLoader.java 2014-01-03 12:18:49.887580753 -0600
++++ b/src/java/fmpp/dataloaders/HtmlUtilsDataLoader.java 2014-01-03 12:27:02.527682248 -0600
+@@ -32,7 +32,6 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-import imageinfo.ImageInfo;
+ import java.io.File;
+ import java.io.IOException;
+ import java.io.RandomAccessFile;
+@@ -41,6 +40,7 @@
+ import java.util.Iterator;
+ import java.util.List;
+ import java.util.Map;
++import javax.imageio.ImageIO;
+
+ import fmpp.Engine;
+ import fmpp.tdd.DataLoader;
+@@ -68,7 +68,6 @@
+ private Map imageInfoCache = new HashMap();
+ private CachedImageInfo first;
+ private CachedImageInfo last;
+- private ImageInfo imageInfo = new ImageInfo();
+
+ public Object load(Engine e, List args) throws Exception {
+ if (args.size() != 0) {
+@@ -134,21 +133,21 @@
+ }
+ }
+
+- RandomAccessFile raf = new RandomAccessFile(f, "r");
++ int width = 0;
++ int height = 0;
++
+ try {
+- imageInfo.setCollectComments(false);
+- imageInfo.setInput(raf);
+- if (!imageInfo.check()) {
+- throw new TemplateModelException(
+- "Failed to analyse image file: " + cacheKey);
+- }
+- } finally {
+- raf.close();
+- }
++ java.awt.image.BufferedImage img = ImageIO.read(f);
++ width = img.getWidth();
++ height = img.getHeight();
++ } catch(Exception e) {
++ throw new TemplateModelException("Failed to analyse image file: " + cacheKey);
++ }
++
+ inf = new CachedImageInfo();
+ inf.lmd = f.lastModified();
+- inf.width = imageInfo.getWidth();
+- inf.height = imageInfo.getHeight();
++ inf.width = width;
++ inf.height = height;
+ inf.path = cacheKey;
+ if (last != null) {
+ last.next = inf;
diff --git a/fmpp.spec b/fmpp.spec
new file mode 100644
index 0000000..5cf435a
--- /dev/null
+++ b/fmpp.spec
@@ -0,0 +1,121 @@
+%global fmpp_version 0.9.14
+
+Name: fmpp
+Version: %{fmpp_version}
+Release: 1%{?dist}
+Summary: FreeMarker-based text file PreProcessor
+
+License: BSD
+URL: http://fmpp.sourceforge.net
+Source0: http://prdownloads.sourceforge.net/fmpp/fmpp_%{version}.tar.gz
+
+Patch0: fmpp-0.9.14-build.xml.patch
+Patch1: fmpp-0.9.14-excise-imageinfo.patch
+
+BuildRequires: javapackages-tools
+BuildRequires: java-devel
+
+BuildRequires: ant
+
+BuildRequires: mvn(oro:oro)
+BuildRequires: mvn(org.freemarker:freemarker)
+BuildRequires: mvn(org.beanshell:bsh)
+BuildRequires: mvn(xml-resolver:xml-resolver)
+BuildRequires: mvn(xml-apis:xml-apis)
+
+Requires: javapackages-tools
+Requires: java
+
+Requires: mvn(oro:oro)
+Requires: mvn(org.freemarker:freemarker)
+Requires: mvn(org.beanshell:bsh)
+Requires: mvn(xml-resolver:xml-resolver)
+Requires: mvn(xml-apis:xml-apis)
+
+BuildArch: noarch
+
+
+%description
+
+FMPP is a general-purpose text file preprocessor tool that uses
+FreeMarker templates. It is particularly designed for HTML
+preprocessor, to generate complete (static) homepages: directory
+structure that contains HTML-s, image files, etc. But of course it can
+be used to generate source code or whatever text files. FMPP is
+extendable with Java classes to pull data from any data sources
+(database, etc.) and embed the data into the generated files.
+
+%package javadoc
+Group: Documentation
+Summary: Javadoc for %{name}
+BuildArch: noarch
+
+%description javadoc
+Javadoc for %{name}.
+
+
+%prep
+%setup -q -n %{name}_%{fmpp_version}
+%patch0 -p1
+%patch1 -p1
+
+find lib -name \*.jar -delete
+
+rm -rf lib/forbuild/classes
+
+# these two tests don't pass for some reason
+find . -name always_create_dirs_\* -and -type d | xargs rm -rf
+
+# strip carriage returns
+find . -name \*.fmpp -or\
+ -name package-list -or\
+ -name \*.bsh -or\
+ -name \*.txt -or\
+ -name \*.xml -or\
+ -name \*.c -or \
+ -name \*.css -or \
+ -name \*.csv -or \
+ -name \*.dtd -or \
+ -name \*.ent -or \
+ -name \*.ftl -or \
+ -name \*.html -or \
+ -name \*.tdd| xargs sed -i 's/\r$//'
+
+%build
+
+ant build
+
+ant make-pom
+
+%check
+
+ant test
+
+%install
+mkdir -p %{buildroot}/%{_javadir}
+mkdir -p %{buildroot}/%{_mavenpomdir}
+mkdir -p %{buildroot}/%{_javadocdir}/%{name}
+
+cp lib/fmpp.jar %{buildroot}/%{_javadir}
+cp build/pom.xml %{buildroot}/%{_mavenpomdir}/JPP-fmpp.pom
+cp -rp docs/* %{buildroot}/%{_javadocdir}/%{name}
+
+find %{buildroot} -size 0 -delete
+
+%add_maven_depmap JPP-%{name}.pom %{name}.jar
+
+%files
+%doc LICENSE.txt README.txt
+%{_javadir}/%{name}.jar
+%{_mavenpomdir}/JPP-%{name}.pom
+%{_mavendepmapfragdir}/%{name}
+
+%files javadoc
+%doc LICENSE.txt README.txt
+%{_javadocdir}/%{name}
+
+%changelog
+
+* Thu Jan 2 2014 William Benton <willb at redhat.com> - 0.9.14-1
+- initial package
+
diff --git a/sources b/sources
index e69de29..d42f7f5 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+21061aa0805f8a351e1cb237e33a0002 fmpp_0.9.14.tar.gz
More information about the scm-commits
mailing list