1
0
forked from pool/objectweb-asm
2019-03-06 10:20:03 +00:00
committed by Git OBS Bridge
parent 7236dccfd8
commit 64910e3727
17 changed files with 884 additions and 782 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package objectweb-asm
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 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
@@ -17,7 +17,7 @@
Name: objectweb-asm
Version: 6.0
Version: 6.2.1
Release: 0
Summary: Java bytecode manipulation framework
License: BSD-3-Clause
@@ -25,19 +25,25 @@ Group: Development/Libraries/Java
URL: http://asm.objectweb.org/
# ./generate-tarball.sh
Source0: %{name}-%{version}.tar.xz
Source1: %{name}-%{version}-build.tar.xz
Source2: http://repo1.maven.org/maven2/org/ow2/asm/asm/%{version}/asm-%{version}.pom
Source3: http://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/%{version}/asm-analysis-%{version}.pom
Source4: http://repo1.maven.org/maven2/org/ow2/asm/asm-commons/%{version}/asm-commons-%{version}.pom
Source5: http://repo1.maven.org/maven2/org/ow2/asm/asm-test/%{version}/asm-test-%{version}.pom
Source6: http://repo1.maven.org/maven2/org/ow2/asm/asm-tree/%{version}/asm-tree-%{version}.pom
Source7: http://repo1.maven.org/maven2/org/ow2/asm/asm-util/%{version}/asm-util-%{version}.pom
Source8: http://repo1.maven.org/maven2/org/ow2/asm/asm-xml/%{version}/asm-xml-%{version}.pom
# We still want to create an "all" uberjar, so this is a custom pom to generate it
# TODO: Fix other packages to no longer depend on "asm-all" so we can drop this
Source9: asm-all.pom
# 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
Source10: generate-tarball.sh
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
BuildRequires: objectweb-anttask
BuildRequires: xz
Requires: objectweb-pom
Obsoletes: %{name}-examples
BuildArch: noarch
%description
@@ -82,75 +88,57 @@ 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
%setup -q -a1
cp %{SOURCE2} asm/pom.xml
cp %{SOURCE3} asm-analysis/pom.xml
cp %{SOURCE4} asm-commons/pom.xml
cp %{SOURCE5} asm-test/pom.xml
cp %{SOURCE6} asm-tree/pom.xml
cp %{SOURCE7} asm-util/pom.xml
cp %{SOURCE8} asm-xml/pom.xml
# Insert asm-all pom
mkdir -p asm-all
sed 's/@VERSION@/%{version}/g' %{SOURCE9} > asm-all/pom.xml
%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
for i in asm asm-analysis asm-commons asm-tree asm-util asm-xml asm-all; do
%pom_remove_parent ${i}
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/
%build
%ant \
package javadoc
%files
%install
# jars
install -dm 0755 %{buildroot}/%{_javadir}/%{name}
for i in asm asm-analysis asm-commons asm-tree asm-util asm-xml asm-all; do
install -pm 0644 ${i}/target/${i}-%{version}.jar %{buildroot}/%{_javadir}/%{name}/${i}.jar
done
# poms
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
for i in asm asm-analysis asm-commons asm-tree asm-util asm-xml; do
install -pm 0644 ${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/${i}.pom
%add_maven_depmap %{name}/${i}.pom %{name}/${i}.jar
done
install -pm 0644 asm-all/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/asm-all.pom
%add_maven_depmap %{name}/asm-all.pom %{name}/asm-all.jar -a org.ow2.asm:asm-debug-all
# javadoc
install -dm 0755 %{buildroot}/%{_javadocdir}/%{name}
for i in asm asm-analysis asm-commons asm-tree asm-util asm-xml; do
cp -pr ${i}/target/site/apidocs %{buildroot}/%{_javadocdir}/%{name}/${i}
done
%fdupes -s %{buildroot}/%{_javadocdir}
# script
%jpackage_script org.objectweb.asm.xml.Processor "" "" %{name}/asm:%{name}/asm-util:%{name}/asm-xml %{name}-processor true
%files -f .mfiles
%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
%{_bindir}/%{name}-processor
%files javadoc
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%files examples
%doc examples/*
%changelog