objectweb-asm/objectweb-asm.spec

149 lines
5.3 KiB
RPMSpec

#
# spec file for package objectweb-asm
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define section free
Name: objectweb-asm
Version: 3.3.1
Release: 0
Summary: A code manipulation tool to implement adaptable systems
License: BSD-3-Clause
Group: Development/Libraries/Java
Url: http://asm.objectweb.org/
Source0: http://download.forge.objectweb.org/asm/asm-3.3.1.tar.gz
Source1: http://repo1.maven.org/maven2/asm/asm/3.3.1/asm-3.3.1.pom
Source2: http://repo1.maven.org/maven2/asm/asm-analysis/3.3.1/asm-analysis-3.3.1.pom
Source3: http://repo1.maven.org/maven2/asm/asm-commons/3.3.1/asm-commons-3.3.1.pom
Source4: http://repo1.maven.org/maven2/asm/asm-tree/3.3.1/asm-tree-3.3.1.pom
Source5: http://repo1.maven.org/maven2/asm/asm-util/3.3.1/asm-util-3.3.1.pom
Source6: http://repo1.maven.org/maven2/asm/asm-xml/3.3.1/asm-xml-3.3.1.pom
Source7: http://repo1.maven.org/maven2/asm/asm-all/3.3.1/asm-all-3.3.1.pom
Source8: http://repo1.maven.org/maven2/asm/asm-parent/3.3.1/asm-parent-3.3.1.pom
Source9: asm-MANIFEST.MF
Patch0: objectweb-asm-no-classpath-in-manifest.patch
# Needed by asm-xml.jar
Requires: xml-commons-apis
PreReq: javapackages-tools
BuildRequires: ant >= 1.6.5
BuildRequires: java-1_5_0-gcj-compat-devel
BuildRequires: javapackages-tools
BuildRequires: objectweb-anttask
BuildRequires: xml-commons-apis
BuildRequires: zip
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
ASM is a Java bytecode manipulation framework.
It can be used to dynamically generate stub classes or other proxy
classes, directly in binary form, or to dynamically modify classes at
load time, i.e., just before they are loaded into the Java Virtual
Machine.
ASM offers similar functionalities as BCEL or SERP, but is much
smaller.
%if 0
%package javadoc
Summary: Javadoc for %{name}
Group: Development/Libraries/Java
%description javadoc
ASM is a Java bytecode manipulation framework.
It can be used to dynamically generate stub classes or other proxy
classes, directly in binary form, or to dynamically modify classes at
load time, i.e., just before they are loaded into the Java Virtual
Machine.
ASM offers similar functionalities as BCEL or SERP, but is much
smaller.
%endif
%prep
%setup -q -n asm-%{version}
%patch0 -p1
perl -pi -e 's/\r$//g' LICENSE.txt README.txt
mkdir META-INF
cp -p %{SOURCE9} META-INF/MANIFEST.MF
%build
export CLASSPATH=
export OPT_JAR_LIST=:
ant -Dobjectweb.ant.tasks.path=$(build-classpath objectweb-anttask) jar
%install
# jars
install -d -m 755 %{buildroot}%{_javadir}/%{name}
for jar in output/dist/lib/*.jar; do
install -m 644 ${jar} \
%{buildroot}%{_javadir}/%{name}/`basename ${jar} | sed 's/-%{version}//g'`
done
touch META-INF/MANIFEST.MF
zip -u output/dist/lib/all/asm-all-%{version}.jar META-INF/MANIFEST.MF
install -m 644 output/dist/lib/all/asm-all-%{version}.jar %{buildroot}%{_javadir}/%{name}/asm-all.jar
# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -m 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP.objectweb-asm-asm.pom
%add_maven_depmap JPP.objectweb-asm-asm.pom %{name}/asm.jar
install -m 644 %{SOURCE2} %{buildroot}%{_mavenpomdir}/JPP.objectweb-asm-asm-analysis.pom
%add_maven_depmap JPP.objectweb-asm-asm-analysis.pom %{name}/asm-analysis.jar
install -m 644 %{SOURCE3} %{buildroot}%{_mavenpomdir}/JPP.objectweb-asm-asm-commons.pom
%add_maven_depmap JPP.objectweb-asm-asm-commons.pom %{name}/asm-commons.jar
install -m 644 %{SOURCE4} %{buildroot}%{_mavenpomdir}/JPP.objectweb-asm-asm-tree.pom
%add_maven_depmap JPP.objectweb-asm-asm-tree.pom %{name}/asm-tree.jar
install -m 644 %{SOURCE5} %{buildroot}%{_mavenpomdir}/JPP.objectweb-asm-asm-util.pom
%add_maven_depmap JPP.objectweb-asm-asm-util.pom %{name}/asm-util.jar
install -m 644 %{SOURCE6} %{buildroot}%{_mavenpomdir}/JPP.objectweb-asm-asm-xml.pom
%add_maven_depmap JPP.objectweb-asm-asm-xml.pom %{name}/asm-xml.jar
install -m 644 %{SOURCE7} %{buildroot}%{_mavenpomdir}/JPP.objectweb-asm-asm-all.pom
%add_maven_depmap JPP.objectweb-asm-asm-all.pom %{name}/asm-all.jar
install -m 644 %{SOURCE8} %{buildroot}%{_mavenpomdir}/JPP.objectweb-asm-asm-parent.pom
%add_maven_depmap JPP.objectweb-asm-asm-all.pom %{name}/asm-all.jar
%if 0
# javadoc
install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr output/dist/doc/javadoc/user/* %{buildroot}%{_javadocdir}/%{name}
%endif
%files
%defattr(0644,root,root,0755)
%doc LICENSE.txt README.txt
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/*.jar
%{_mavenpomdir}/*
%config %{_mavendepmapfragdir}/*
%if 0
%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}
%endif
%changelog