%global pkgname ST Name: stringtemplate4 Version: 4.0.4 Release: 1%{?dist} Summary: A Java template engine URL: http://www.stringtemplate.org/ Source0: http://www.stringtemplate.org/download/%{pkgname}-%{version}-src.zip Source1: https://raw.github.com/antlr/stringtemplate4/master/src/org/stringtemplate/v4/compiler/STLexer.tokens Source2: https://raw.github.com/antlr/antlr/revision-3.4/runtime/Java/src/main/java/org/antlr/runtime/misc/DoubleKeyMap.java Source3: https://raw.github.com/antlr/stringtemplate4/master/pom.xml License: BSD Group: Development/Libraries BuildArch: noarch BuildRequires: ant-antlr3, ant-junit BuildRequires: antlr3 BuildRequires: stringtemplate # Standard deps BuildRequires: java-devel >= 1:1.6.0 BuildRequires: jpackage-utils Requires: java >= 1:1.6.0 Requires: jpackage-utils %description StringTemplate is a java template engine (with ports for C# and Python) for generating source code, web pages, emails, or any other formatted text output. StringTemplate is particularly good at multi-targeted code generators, multiple site skins, and internationalization/localization. %package javadoc Group: Documentation Summary: API documentation for %{name} Requires: jpackage-utils %description javadoc %{summary}. %prep %setup -q -n %{pkgname}-%{version} # copy sources missing in source archive into places cp %{SOURCE1} src/org/stringtemplate/v4/compiler/STLexer.tokens mkdir -p src/org/antlr/runtime/misc # this is temporary until we build new antlr3 properly cp %{SOURCE2} src/org/antlr/runtime/misc/DoubleKeyMap.java cp %{SOURCE3} pom.xml rm -rf lib/* target ln -sf $(build-classpath antlr3) lib/antlr-3.3-complete.jar ln -sf $(build-classpath ant/ant-antlr3) lib/ant-antlr3.jar #sed -i "s:antlr3.jar=.*:antlr3.jar=`build-classpath antlr3`:" \ # build.properties #sed -i "s:ant-antlr3.jar=.*:antlr3.jar=`build-classpath ant/ant-antlr3`:" \ # build.properties #sed -i '/build.sysclasspath/{d}' build.properties sed -i \ 's:location="${ant-antlr3.jar}":location="/usr/share/java/antlr3-runtime.jar":' build.xml %build export CLASSPATH="`build-classpath ant/ant-antlr3 antlr3 antlr3-runtime antlr stringtemplate`" ant build-jar %javadoc -d javadoc -public `find build/src build/gen -name '*.java'` %install install -D dist/ST-%{version}.jar \ %{buildroot}%{_datadir}/java/%{name}.jar install -Dpm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom %add_maven_depmap JPP-%{name}.pom %{name}.jar mkdir -p %{buildroot}%{_javadocdir}/%{name} cp -pr javadoc/* %{buildroot}%{_javadocdir}/%{name}/ %files %doc LICENSE.txt README.txt %{_datadir}/java/%{name}.jar %{_mavenpomdir}/JPP-%{name}.pom %{_mavendepmapfragdir}/%{name} %files javadoc %doc LICENSE.txt %{_javadocdir}/%{name} %changelog * Fri Jan 13 2012 Stanislav Ochotnicky - 4.0.4-1 - Initial version of the package