objectweb-asm/objectweb-asm.spec

156 lines
5.1 KiB
RPMSpec

#
# spec file for package objectweb-asm
#
# Copyright (c) 2018 SUSE LINUX 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 https://bugs.opensuse.org/
#
Name: objectweb-asm
Version: 6.0
Release: 0
Summary: Java bytecode manipulation framework
License: BSD-3-Clause
Group: Development/Libraries/Java
URL: http://asm.objectweb.org/
# ./generate-tarball.sh
Source0: %{name}-%{version}.tar.xz
# The source contains binary jars that cannot be verified for licensing and could be proprietary
Source1: generate-tarball.sh
Patch0: %{name}-%{version}-uberjar.patch
Patch1: %{name}-%{version}-sourcetarget.patch
Patch2: %{name}-%{version}-no_bnd.patch
Patch3: %{name}-%{version}-no_retrofit.patch
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
BuildRequires: objectweb-anttask
BuildRequires: xz
BuildArch: noarch
%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.
%package javadoc
Summary: Java bytecode manipulation framework
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.
%package examples
Summary: Java bytecode manipulation framework
Group: Development/Libraries/Java
%description examples
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.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
rm -f src/org/objectweb/asm/tools/ModuleInfoBndPlugin.java
%patch3 -p1
# wrong end of line encoding
find examples/ -type 'f' | xargs sed -i -e 's/.$//'
sed -i -e 's/.$//' README.txt LICENSE.txt
mkdir -p test/lib
%build
ant \
-Dcompile.source=8 -Dcompile.target=8 \
-Dobjectweb.ant.tasks.path=$(build-classpath objectweb-anttask) \
dist.version jar jdoc
%install
install -d -m 755 %{buildroot}/%{_javadir}/%{name}
# jars
install -m 644 output/dist/lib/*jar %{buildroot}/%{_javadir}/%{name}
(cd %{buildroot}%{_javadir}/%{name} && for jar in *-%{version}.jar; do ln -sf ${jar} ${jar/-%{version}/}; done)
install -m 644 output/dist/lib/all/asm-all-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-all-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)
# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}/%{name}
install -pm 644 output/dist/lib/all/asm-all-%{version}.pom %{buildroot}%{_mavenpomdir}/%{name}-all-%{version}.pom
%add_maven_depmap %{name}-all-%{version}.pom %{name}-all-%{version}.jar
install -pm 644 output/dist/lib/asm-%{version}.pom %{buildroot}%{_mavenpomdir}/%{name}/asm-%{version}.pom
%add_maven_depmap %{name}/asm-%{version}.pom %{name}/asm-%{version}.jar
install -pm 644 output/dist/lib/asm-parent-%{version}.pom %{buildroot}%{_mavenpomdir}/%{name}/asm-parent-%{version}.pom
%add_maven_depmap %{name}/asm-parent-%{version}.pom
for i in analysis commons tree util xml; do
install -pm 644 output/dist/lib/asm-$i-%{version}.pom %{buildroot}%{_mavenpomdir}/%{name}/asm-$i-%{version}.pom
%add_maven_depmap %{name}/asm-$i-%{version}.pom %{name}/asm-$i-%{version}.jar
done
# javadoc
install -d -m 755 %{buildroot}/%{_javadocdir}/%{name}-%{version}
cp -pr output/dist/doc/javadoc/user/* %{buildroot}/%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} %{buildroot}/%{_javadocdir}/%{name}
%fdupes -s %{buildroot}
%fdupes -s examples/
%files
%license LICENSE.txt
%doc README.txt
%{_javadir}/%{name}-all*.jar
%{_javadir}/%{name}
%{_mavenpomdir}/%{name}-all-%{version}.pom
%{_mavenpomdir}/%{name}
%if %{defined _maven_repository}
%{_mavendepmapfragdir}/%{name}
%else
%{_datadir}/maven-metadata/%{name}.xml*
%endif
%files javadoc
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%files examples
%doc examples/*
%changelog