objectweb-asm2/objectweb-asm2.spec

277 lines
8.5 KiB
RPMSpec

%define javahome %{_jvmdir}/jdk
Name: objectweb-asm2
Version: 2.2.3
Release: 3mamba
Summary: a code manipulation tool to implement adaptable systems
Group: Development/Libraries/Java
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://asm.objectweb.org/
Source0: http://download.forge.objectweb.org/asm/asm-%{version}.tar.gz
Source1: http://asm.objectweb.org/current/asm-eng.pdf
Source2: http://asm.objectweb.org/current/asm-transformations.pdf
Source3: http://download.forge.objectweb.org/asm/asm-guide.pdf
Source4: http://asm.objectweb.org/doc/faq.html
# http://mirrors.ibiblio.org/pub/mirrors/maven2/asm
Source5: objectweb-asm-parent-2.2.3,pom
Source6: objectweb-asm-2.2.3,pom
Source7: objectweb-asm-all-2.2.3,pom
Source8: objectweb-asm-analysis-2.2.3,pom
Source9: objectweb-asm-attrs-2.2.3,pom
Source10: objectweb-asm-commons-2.2.3,pom
Source11: objectweb-asm-tree-2.2.3,pom
Source12: objectweb-asm-util-2.2.3,pom
Source13: objectweb-asm-xml-2.2.3,pom
Patch0: objectweb-asm2-2.2.3-noclasspathinmanifest.patch
Patch1: objectweb-asm2-2.2.3-build_xml.patch
Patch2: objectweb-asm2-2.2.3-SerialVersionUIDAdder.patch
Patch3: objectweb-asm2-2.2.3-test-build_xml.patch
Patch4: objectweb-asm2-2.2.3-ALLPerfTest.patch
Patch5: objectweb-asm2-2.2.3-test-heap.patch
License: BSD
BuildRequires: apache-ant
BuildRequires: apache-log4j
BuildRequires: jakarta-bcel
%if "%{stage1}" != "1"
BuildRequires: jakarta-oro
BuildRequires: java-serp
BuildRequires: janino
BuildRequires: javassist
%endif
BuildRequires: objectweb-anttask
BuildRequires: jpackage-utils
BuildRequires: zip
BuildRequires: xml-commons-apis
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
ASM is an all purpose Java bytecode manipulation and analysis framework. It can be used to modify existing classes or dynamically generate classes, directly in binary form. Provided common transformations and analysis algorithms allow to easily assemble custom complex transformations and code analysis tools.
ASM offer similar functionality as other bytecode frameworks, but it is focused on simplicity of use and performance. Because it was designed and implemented to be as small and as fast as possible, it makes it very attractive for using in dynamic systems*.
(*) ASM can of course be used in a static way too.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
ASM is an all purpose Java bytecode manipulation and analysis framework
This package contains javadoc for %{name}.
%package manual
Group: Documentation
Summary: Documents for %{name}
%description manual
ASM is an all purpose Java bytecode manipulation and analysis framework
This package contains documentation for %{name}.
%package demo
Group: Documentation
Summary: Examples for %{name}
Requires: %{name} = %{version}
%description demo
ASM is an all purpose Java bytecode manipulation and analysis framework
This package contains documentation and samples for %{name}.
%prep
%setup -q -n asm-%{version}
%patch0 -p1
for j in $(find . -name "*.jar"); do
mv $j ${j}.no
done
mkdir test/lib
#tests
#pushd test/lib
# ln -sf $(build-classpath asm2/asm2)
# ln -sf $(build-classpath cobertura)
# ln -sf $(build-classpath log4j)
# ln -sf $(build-classpath jakarta-oro)
# ln -sf $(build-classpath ccl-util) ccl.jar
# ln -sf $(build-classpath javancss)
#popd
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
rm test/perf/org/objectweb/asm/SERPPerfTest.java
rm test/conform/adviceadapter2.xml
%build
# tests
# export CLASSPATH=$(build-classpath asm2/asm2 asm2/asm2-tree)
ant \
-Dbcel.path=$(build-classpath bcel-5.2) \
-Dobjectweb.ant.tasks.path=$(build-classpath objectweb-anttask-1.3.2) \
%if "%{stage1}" != "1"
-Djanino.path=$(build-classpath janino-2.5.15) \
-Djavassist.path=$(build-classpath javassist-3.9.0) \
-Dserp.jar=$(build-classpath serp) \
%endif
jar \
jdoc \
examples
# tests
# coverage \
# test \
# coverage.report \
# test.report \
# compile
# compile-debug
# coverage
# coverage.report
# dist
# dist.init
# dist.version
# example
# examples
# jar
# jdoc
# noshrink
# properties
# shrink
# test
# test.report
sed -i 's/\r//g' README.txt LICENSE.txt
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_javadir}/asm2
for jar in output/dist/lib/*.jar; do
newjar=${jar/asm-/asm2-}
install -m 644 ${jar} \
%{buildroot}%{_javadir}/asm2/`basename ${newjar}`
done
install -m 644 output/dist/lib/all/asm-all-%{version}.jar \
%{buildroot}%{_javadir}/asm2-all-%{version}.jar
(
cd %{buildroot}%{_javadir}
for jar in *-%{version}*; do
ln -sf ${jar} ${jar/-%{version}/}
done
)
(
cd %{buildroot}%{_javadir}/asm2
for jar in *-%{version}* ; do
ln -sf ${jar} ${jar/-%{version}/}
done
)
mkdir -p %{buildroot}%{_datadir}/maven2/poms
install -m 644 %{SOURCE5} %{buildroot}%{_datadir}/maven2/poms/JPP.objectweb-asm2-asm-parent.pom
%add_to_maven_depmap asm asm-parent %{version} JPP/asm2 asm-parent
install -m 644 %{SOURCE6} %{buildroot}%{_datadir}/maven2/poms/JPP.objectweb-asm2-asm2.pom
%add_to_maven_depmap asm asm %{version} JPP/asm2 asm2
install -m 644 %{SOURCE7} %{buildroot}%{_datadir}/maven2/poms/JPP.objectweb-asm2-asm2-all.pom
%add_to_maven_depmap asm asm-all %{version} JPP/asm2 asm2-all
install -m 644 %{SOURCE8} %{buildroot}%{_datadir}/maven2/poms/JPP.objectweb-asm2-asm2-analysis.pom
%add_to_maven_depmap asm asm-analysis %{version} JPP/asm2 asm2-analysis
install -m 644 %{SOURCE9} %{buildroot}%{_datadir}/maven2/poms/JPP.objectweb-asm2-asm2-attrs.pom
%add_to_maven_depmap asm asm-attrs %{version} JPP/asm2 asm2-attrs
install -m 644 %{SOURCE10} %{buildroot}%{_datadir}/maven2/poms/JPP.objectweb-asm2-asm2-commons.pom
%add_to_maven_depmap asm asm-commons %{version} JPP/asm2 asm2-commons
install -m 644 %{SOURCE11} %{buildroot}%{_datadir}/maven2/poms/JPP.objectweb-asm2-asm2-tree.pom
%add_to_maven_depmap asm asm-tree %{version} JPP/asm2 asm2-tree
install -m 644 %{SOURCE12} %{buildroot}%{_datadir}/maven2/poms/JPP.objectweb-asm2-asm2-util.pom
%add_to_maven_depmap asm asm-util %{version} JPP/asm2 asm2-util
install -m 644 %{SOURCE13} %{buildroot}%{_datadir}/maven2/poms/JPP.objectweb-asm2-asm2-xml.pom
%add_to_maven_depmap asm asm-xml %{version} JPP/asm2 asm2-xml
mkdir -p %{buildroot}%{_javadocdir}/asm2-%{version}
cp -pr output/dist/doc/javadoc/user/* %{buildroot}%{_javadocdir}/asm2-%{version}
(
cd %{buildroot}%{_javadocdir}
ln -sf asm2-%{version} asm2
)
mkdir -p %{buildroot}%{_docdir}/asm2-%{version}
install -m 644 README.txt %{buildroot}%{_docdir}/asm2-%{version}
install -m 644 LICENSE.txt %{buildroot}%{_docdir}/asm2-%{version}
install -m 644 %{S:1} %{buildroot}%{_docdir}/asm2-%{version}
install -m 644 %{S:2} %{buildroot}%{_docdir}/asm2-%{version}
install -m 644 %{S:3} %{buildroot}%{_docdir}/asm2-%{version}
install -m 644 %{S:4} %{buildroot}%{_docdir}/asm2-%{version}
mkdir -p %{buildroot}%{_datadir}/asm2-%{version}
cp -pr output/dist/examples %{buildroot}%{_datadir}/asm2-%{version}
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
%update_maven_depmap
%postun
%update_maven_depmap
%files
%defattr(-,root,root)
%{_javadir}/asm2-all-%{version}.jar
%{_javadir}/asm2-all.jar
%dir %{_javadir}/asm2
%{_javadir}/asm2/asm2-%{version}.jar
%{_javadir}/asm2/asm2.jar
%{_javadir}/asm2/asm2-analysis-%{version}.jar
%{_javadir}/asm2/asm2-analysis.jar
%{_javadir}/asm2/asm2-attrs-%{version}.jar
%{_javadir}/asm2/asm2-attrs.jar
%{_javadir}/asm2/asm2-commons-%{version}.jar
%{_javadir}/asm2/asm2-commons.jar
%{_javadir}/asm2/asm2-tree-%{version}.jar
%{_javadir}/asm2/asm2-tree.jar
%{_javadir}/asm2/asm2-util-%{version}.jar
%{_javadir}/asm2/asm2-util.jar
%{_javadir}/asm2/asm2-xml-%{version}.jar
%{_javadir}/asm2/asm2-xml.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
%doc LICENSE.txt README.txt
%files demo
%defattr(-,root,root)
%{_datadir}/asm2-%{version}
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/asm2-%{version}
%{_javadocdir}/asm2
%files manual
%defattr(-,root,root)
%{_docdir}/asm2-%{version}
%changelog
* Sat Mar 26 2011 gil <puntogil@libero.it> 2.2.3-3mamba
- rebuilt with java-gcj-compat support
* Sat Jan 09 2010 gil <puntogil@libero.it> 2.2.3-2mamba
- rebuilt with java-serp support
- added maven poms
* Sun Mar 01 2009 gil <puntogil@libero.it> 2.2.3-1mamba
- package created by autospec