packages java-aspectwerkz.spec
      Pages: < 1 >  DOWNLOAD      
Name:          java-aspectwerkz
Version:       2.0
Release:       5mamba
Summary:       Simple, high-performant, dynamic, lightweight and powerful AOP for Java
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      Silvan Calarco <silvan.calarco@...>
URL:           http://aspectwerkz.codehaus.org/
Source0:       http://dist.codehaus.org/aspectwerkz/distributions/aspectwerkz-%{version}.zip
Source1:       http://mirrors.ibiblio.org/pub/mirrors/maven2/aspectwerkz/aspectwerkz/%{version}/aspectwerkz-%{version}.pom
Source2:       http://mirrors.ibiblio.org/pub/mirrors/maven2/aspectwerkz/aspectwerkz-core/%{version}/aspectwerkz-core-%{version}.pom
Source3:       http://mirrors.ibiblio.org/pub/mirrors/maven2/aspectwerkz/aspectwerkz-extensions/%{version}/aspectwerkz-extensions-%{version}.pom
Source4:       http://mirrors.ibiblio.org/pub/mirrors/maven2/aspectwerkz/aspectwerkz-jdk5/%{version}/aspectwerkz-jdk5-%{version}.pom
Source5:       http://mirrors.ibiblio.org/pub/mirrors/maven2/aspectwerkz/aspectwerkz-nodeps-jdk5/%{version}/aspectwerkz-nodeps-jdk5-%{version}.pom
Source6:       http://mirrors.ibiblio.org/pub/mirrors/maven2/aspectwerkz/aspectwerkz-jdk14/%{version}/aspectwerkz-jdk14-%{version}.pom
Source7:       http://mirrors.ibiblio.org/pub/mirrors/maven2/aspectwerkz/aspectwerkz-nodeps-jdk14/%{version}/aspectwerkz-nodeps-jdk14-%{version}.pom
Patch0:        java-aspectwerkz-2.0-build_xml.patch
Patch1:        java-aspectwerkz-2.0-script.patch
Patch2:        java-aspectwerkz-2.0-script2.patch
Patch3:        java-aspectwerkz-2.0-fixgnutrove.patch
Patch4:        java-aspectwerkz-2.0-build_xml2.patch
License:       LGPL, BSD
BuildRequires: apache-ant
%if "%{stage1}" != "1"
BuildRequires: apache-geronimo-1.2-specs
BuildRequires: eclipse-aspectj = 1.6.5
BuildRequires: java-cglib
BuildRequires: java-junitperf
%endif
BuildRequires: java-piccolo
BuildRequires: java-concurrent
BuildRequires: java-jrexx
BuildRequires: javassist
BuildRequires: java-aopalliance
BuildRequires: java-gnu-trove
BuildRequires: java-dom4j
BuildRequires: gcc
BuildRequires: javacc
BuildRequires: java-jarjar
BuildRequires: java-junit3
BuildRequires: jpackage-utils
BuildRequires: java-qdox16
BuildRequires: objectweb-asm1
Requires:      apache-ant
Requires:      java-aopalliance
Requires:      java-piccolo
Requires:      java-concurrent
Requires:      java-jrexx
Requires:      javassist
Requires:      java-gnu-trove
Requires:      java-dom4j
Requires:      java-qdox16
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
AspectWerkz is a dynamic, lightweight and high-performant AOP/AOSD framework for Java.
AspectWerkz utilizes runtime bytecode modification to weave your classes at runtime.
It hooks in and weaves classes loaded by any class loader except the bootstrap class loader.
It has a rich join point model. Aspects, advices and introductions are written in plain Java and your target classes can be regular POJOs. You have the possibility to add, remove and re-structure advices as well as swapping the implementation of your introductions at runtime.
Your aspects can be defined using either an XML definition file or using Runtime Attributes.

%package demo
Group:          Documentation
Summary:        Samples for %{name}
Requires:       %{name} = %{version}-%{release}

%description demo
AspectWerkz is a dynamic, lightweight and high-performant AOP/AOSD framework for Java.

This package contains samples for %{name}.

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

%description javadoc
AspectWerkz is a dynamic, lightweight and high-performant AOP/AOSD framework for Java.

This package contains javadoc for %{name}.

%package manual
Group:          Documentation
Summary:        Manual for %{name}

%description manual
AspectWerkz is a dynamic, lightweight and high-performant AOP/AOSD framework for Java.

This package contains documentation for %{name}.

#%package native
#Group:         Development/Libraries
#Summary:       Libraries and headers for %{name}
#Requires:      %{name} = %{version}-%{release}
#Requires:      sun-java-5

#%description native
#AspectWerkz is a dynamic, lightweight and high-performant AOP/AOSD framework for Java.

#This package contains %{name} libraries and header files.

%prep
%setup -q -n aspectwerkz-%{version}
for j in $(find . -name "*.jar"); do
	mv $j $j.no
done
for j in $(find . -name "*.class"); do
	mv $j $j.no
done


mv src/testdata/test/withinstaticref/TargetA.class.no src/testdata/test/withinstaticref/TargetA.class
chmod +x bin/aspectwerkz

%patch0 -p1
%patch1 -p1
%patch2
%patch3
%patch4 -p1

# TODO Remove the BEA JRockit specific code or it will only build on BEA JDK
rm -fr src/extensions/org/codehaus/aspectwerkz/extension/jrockit

%build
export ASPECTWERKZ_HOME=%{_builddir}/aspectwerkz-%{version}

pushd src/compiler-extensions/aspectj/lib
#  mv aspectjtools.jar.no aspectjtools.jar
  ln -sf $(build-classpath aspectjtools) aspectjtools.jar
#  mv aspectjrt.jar.no aspectjrt.jar
  ln -sf $(build-classpath aspectjrt) aspectjrt.jar
popd

pushd src/compiler-extensions/aop-alliance/lib
  ln -sf $(build-classpath aopalliance) aopalliance-1.0.jar
popd

pushd src/compiler-extensions/spring/lib
# http://www.springsource.org/
  ln -sf $(build-classpath aopalliance) aopalliance-1.0.jar
# TODO circular dependency
# mv spring-aop-1.1.1.jar.no spring-aop-1.1.1.jar 
# mv aw-ext-aopalliance-0.1.jar.no aw-ext-aopalliance-0.1.jar
popd

pushd src/cglib-ext/lib
  ln -sf $(build-classpath asm2/asm2) asm.jar
  ln -sf $(build-classpath asm2/asm2-attrs-2.2.3) asm-attrs.jar
  ln -sf $(build-classpath asm2/asm2-util) asm-util.jar
%if "%{stage1}" != "1"  
  ln -sf $(build-classpath cglib) cglib-2.0.2.jar
%endif
# circular dependency
# mv cglib-2.0.2.jar.no cglib-2.0.2.jar
popd

pushd lib
  ln -sf $(build-classpath qdox16) qdox-1.4.jar
  ln -sf $(build-classpath ant-1.7.1) ant-1.5.2.jar
  ln -sf $(build-classpath dom4j) dom4j-1.4.jar
  ln -sf $(build-classpath junit-3.8.2) junit-3.8.1.jar
  ln -sf $(build-classpath asm1/asm) asm-1.5.4-snapshot.jar
  ln -sf $(build-classpath asm1/asm-attrs) asm-attrs-1.5.4-snapshot.jar
  ln -sf $(build-classpath asm1/asm-util) asm-util-1.5.4-snapshot.jar
  ln -sf $(build-classpath jarjar) .
  ln -sf $(build-classpath gnu.trove) trove-1.0.2.jar
  ln -sf $(build-classpath concurrent) concurrent-1.3.1.jar
%if "%{stage1}" != "1"
  ln -sf $(build-classpath junitperf) junitperf.jar
%endif
  ln -sf $(build-classpath jrexx) jrexx-1.1.1.jar
  ln -sf $(build-classpath piccolo) .
  ln -sf $(build-classpath javassist) .
  ln -sf $(build-classpath asm1/asm) asm_asm.jar
  ln -sf $(build-classpath asm1/asm-attrs) asm_asm-attrs.jar
  ln -sf $(build-classpath asm1/asm) aasm_asm.jar
  ln -sf $(build-classpath asm1/asm-attrs) asm_asm-attrs.jar
  ln -sf $(build-classpath qdox16) qdox.jar
popd

export CLASSPATH=$(build-classpath junit-3.8.2 asm1/asm asm1/asm-attrs \
  geronimo/j2ee-management-1.0-api \
  javacc gnu.trove):target/classes:target/test-classes:target/extensions-classes:target/jdk14:target/jdk15:target/samples-classes
export JAVA_HOME=%{_jvmdir}/jdk
ant -Djdk15=%{_jvmdir}/jdk test cleandist samples

#pushd src/native/ require sun-java-5
#  gcc -I/src/ -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -shared -o libaspectwerkz.so src/aspectwerkz.cc
#popd src/aspectwerkz.cc:14:19: fatal error: jvmdi.h: No such file or directory

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

mkdir -p %{buildroot}%{_javadir}
install -pm 644 target/aspectwerkz-%{version}.jar \
  %{buildroot}%{_javadir}/aspectwerkz-%{version}.jar
install -pm 644 target/aspectwerkz-core-%{version}.jar \
  %{buildroot}%{_javadir}/aspectwerkz-core-%{version}.jar
install -pm 644 target/aspectwerkz-extensions-%{version}.jar \
  %{buildroot}%{_javadir}/aspectwerkz-extensions-%{version}.jar
install -pm 644 target/aspectwerkz-jdk5-%{version}.jar \
  %{buildroot}%{_javadir}/aspectwerkz-jdk5-%{version}.jar
install -pm 644 target/aspectwerkz-nodeps-jdk5-%{version}.jar \
  %{buildroot}%{_javadir}/aspectwerkz-nodeps-jdk5-%{version}.jar
install -pm 644 target/aspectwerkz-jdk14-%{version}.jar \
  %{buildroot}%{_javadir}/aspectwerkz-jdk14-%{version}.jar
install -pm 644 target/aspectwerkz-nodeps-%{version}.jar \
  %{buildroot}%{_javadir}/aspectwerkz-nodeps-%{version}.jar
install -pm 644 target/aspectwerkz-nodeps-jdk14-%{version}.jar \
  %{buildroot}%{_javadir}/aspectwerkz-nodeps-jdk14-%{version}.jar

(
  cd %{buildroot}%{_javadir}
  for jar in *-%{version}.jar; do
    ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`
  done
)

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

install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/maven2/poms/JPP-aspectwerkz.pom
%add_to_maven_depmap aspectwerkz aspectwerkz %{version} JPP aspectwerkz
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/maven2/poms/JPP-aspectwerkz-core.pom
%add_to_maven_depmap aspectwerkz aspectwerkz-core %{version} JPP aspectwerkz-core
install -m 644 %{SOURCE3} %{buildroot}%{_datadir}/maven2/poms/JPP-aspectwerkz-extensions.pom
%add_to_maven_depmap aspectwerkz aspectwerkz-extensions %{version} JPP aspectwerkz-extensions
install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/maven2/poms/JPP-aspectwerkz-jdk5.pom
%add_to_maven_depmap aspectwerkz aspectwerkz-jdk5 %{version} JPP aspectwerkz-jdk5
install -m 644 %{SOURCE5} %{buildroot}%{_datadir}/maven2/poms/JPP-aspectwerkz-nodeps-jdk5.pom
%add_to_maven_depmap aspectwerkz aspectwerkz-nodeps-jdk5 %{version} JPP aspectwerkz-nodeps-jdk5
install -m 644 %{SOURCE6} %{buildroot}%{_datadir}/maven2/poms/JPP-aspectwerkz-jdk14.pom
%add_to_maven_depmap aspectwerkz aspectwerkz-jdk14 %{version} JPP aspectwerkz-jdk14
install -m 644 %{SOURCE7} %{buildroot}%{_datadir}/maven2/poms/JPP-aspectwerkz-nodeps-jdk14.pom
%add_to_maven_depmap aspectwerkz aspectwerkz-nodeps-jdk14 %{version} JPP aspectwerkz-nodeps-jdk14

mkdir -p %{buildroot}%{_bindir}
install -pm 755 bin/aspectwerkz %{buildroot}%{_bindir}

#mkdir -p %{buildroot}%{_jnidir}
#mkdir -p %{buildroot}%{_includedir}/aspectwerkz
#install -pm 755 src/native/libaspectwerkz.so %{buildroot}%{_jnidir}
#install -pm 644 src/native/src/org_codehaus_aspectwerkz_extension_hotswap_HotSwapClient.h %{buildroot}%{_includedir}/aspectwerkz

mkdir -p %{buildroot}%{_javadocdir}/aspectwerkz-%{version}
cp -pr docs/apidocs/* %{buildroot}%{_javadocdir}/aspectwerkz-%{version}
ln -s aspectwerkz-%{version} %{buildroot}%{_javadocdir}/aspectwerkz
rm -rf docs/apidocs

mkdir -p %{buildroot}%{_datadir}/aspectwerkz-%{version}/bin
mkdir -p %{buildroot}%{_datadir}/aspectwerkz-%{version}/classes
mkdir -p %{buildroot}%{_datadir}/aspectwerkz-%{version}/src
install -pm 644 bin/usage.txt %{buildroot}%{_datadir}/aspectwerkz-%{version}/bin
# Can only build samples with a JDK 5
cp -pr target/samples-classes/* %{buildroot}%{_datadir}/aspectwerkz-%{version}/classes
cp -pr src/samples/* %{buildroot}%{_datadir}/aspectwerkz-%{version}/src

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

%files
%defattr(-,root,root)
%{_javadir}/aspectwerkz-%{version}.jar
%{_javadir}/aspectwerkz.jar
%{_javadir}/aspectwerkz-core-%{version}.jar
%{_javadir}/aspectwerkz-core.jar
%{_javadir}/aspectwerkz-extensions-%{version}.jar
%{_javadir}/aspectwerkz-extensions.jar
%{_javadir}/aspectwerkz-nodeps-%{version}.jar
%{_javadir}/aspectwerkz-nodeps.jar
%{_javadir}/aspectwerkz-jdk5-%{version}.jar
%{_javadir}/aspectwerkz-jdk5.jar
%{_javadir}/aspectwerkz-nodeps-jdk5-%{version}.jar
%{_javadir}/aspectwerkz-nodeps-jdk5.jar
%{_javadir}/aspectwerkz-jdk14-%{version}.jar
%{_javadir}/aspectwerkz-jdk14.jar
%{_javadir}/aspectwerkz-nodeps-jdk14-%{version}.jar
%{_javadir}/aspectwerkz-nodeps-jdk14.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
%doc LICENSE.txt

%files demo
%defattr(-,root,root)
%{_bindir}/aspectwerkz
%{_datadir}/aspectwerkz-%{version}

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/aspectwerkz-%{version}
%{_javadocdir}/aspectwerkz

%files manual
%defattr(-,root,root)
%doc docs/*

#%files native
#%defattr(-,root,root)
#%{_includedir}/aspectwerkz/org_codehaus_aspectwerkz_extension_hotswap_HotSwapClient.h
#%{_jnidir}/libaspectwerkz.so

%changelog
* Sat Mar 26 2011 gil <puntogil@...> 2.0-5mamba
- rebuilt with java-gcj-compat & java-openjdk support
- rebuilt with system eclipse-aspectj
- remove sun-java* deps

* Thu Nov 04 2010 gil <puntogil@...> 2.0-4mamba
- rebuilt devel

* Thu Jan 21 2010 gil <puntogil@...> 2.0-3mamba
- move script in demo package
- added new sub package: native

* Sun Oct 18 2009 gil <puntogil@...> 2.0-2mamba
- added maven poms
- edit script
- added apache-geronimo-1.2-specs; sun-java-4; sun-java-5 support

* Thu Mar 05 2009 gil <puntogil@...> 2.0-1mamba
- package created by autospec