packages java-jawk.spec
      Pages: < 1 >  DOWNLOAD      
Name:          java-jawk
Version:       1.02
Release:       1mamba
Summary:       AWK for Java
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
Source0:       jawk_src.%{version}.tar.gz
Source1:       java-jawk-%{version}.pom
Source2:       java-jawk-jrt-%{version}.pom
License:       GPL
BuildRequires: apache-ant
BuildRequires: jakarta-bcel
BuildRequires: jpackage-utils
Requires:      jakarta-bcel
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

Jawk is the implementation of AWK in Java. Jawk parses, analyzes, and
interprets and/or compiles AWK scripts. Compilation is targetted for the

%package javadoc
Group:          Documentation
Summary:        Javadoc for %{name}

%description javadoc
Jawk - AWK for Java.

This package contains javadoc for %{name}.

%setup -q -n jawk_src.1_02
mkdir -p target/classes
mkdir -p target/apidocs
mkdir -p src
mv *.java src/

export JAVA_HOME=/usr/lib/jvm/jdk-sun
export CLASSPATH=target/classes:$(build-classpath bcel)
$JAVA_HOME/bin/javac -d target/classes `find src -name '*.java'`
for c in $(find target/classes/ -name "*.class" | grep -v '\$'); do
   d=$(dirname $c)
   s=$(echo $d | sed -e 's/\/classes\//\/apisrc\//')
   mkdir -p $s
   f=$(basename $c)
   j=$(echo $f | sed -e 's/\.class/\.java/')
   [ -f src/$j ] && cp src/$j $s

$JAVA_HOME/bin/javadoc -d target/apidocs \
  -encoding iso-8859-1 \
  -sourcepath target/apisrc org.jawk org.jawk.backend org.jawk.ext org.jawk.frontend org.jawk.intermediate org.jawk.jrt org.jawk.util

pushd target/classes
  $JAVA_HOME/bin/jar cf ../jawk-%{version}.jar *
  $JAVA_HOME/bin/jar cf ../jawk-jrt-%{version}.jar org/jawk/ext/* org/jawk/jrt/* org/jawk/util/AwkParameters.class

[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

mkdir -p %{buildroot}%{_javadir}/
mkdir -p %{buildroot}%{_datadir}/maven2/poms

install -pm 644 target/jawk-%{version}.jar \

install -pm 644 target/jawk-jrt-%{version}.jar \

%add_to_maven_depmap jawk jawk %{version} JPP jawk
%add_to_maven_depmap jawk jrt %{ext_version} JPP jawk-jrt
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/maven2/poms/JPP-jawk.pom
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/maven2/poms/JPP-jawk-jrt.pom

	cd %{buildroot}%{_javadir}/
	for jar in *-%{version}*; do
		ln -sf ${jar} ${jar/-%{version}/}

mkdir -p %{buildroot}%{_javadocdir}/jawk-%{version}
cp -pr target/apidocs/* %{buildroot}%{_javadocdir}/jawk-%{version}
ln -sf jawk-%{version} %{buildroot}%{_javadocdir}/jawk

[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"




%files javadoc

* Fri Dec 10 2010 gil <puntogil@...> 1.02-1mamba
- package created by autospec