106 lines
5.1 KiB
RPMSpec
106 lines
5.1 KiB
RPMSpec
|
|
Name: objectweb-asm
|
||
|
|
Version: 6.2.1
|
||
|
|
Release: 3
|
||
|
|
Summary: Java bytecode manipulation and analysis framework
|
||
|
|
License: BSD
|
||
|
|
URL: http://asm.ow2.org/
|
||
|
|
Source0: https://gitlab.ow2.org/asm/asm/repository/ASM_6_2_1/archive.tar.gz#/%{name}-%{version}.tar.gz
|
||
|
|
Source1: asm-parent.pom
|
||
|
|
Source2: https://repo1.maven.org/maven2/org/ow2/asm/asm/%{version}/asm-%{version}.pom
|
||
|
|
Source3: https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/%{version}/asm-analysis-%{version}.pom
|
||
|
|
Source4: https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/%{version}/asm-commons-%{version}.pom
|
||
|
|
Source5: https://repo1.maven.org/maven2/org/ow2/asm/asm-test/%{version}/asm-test-%{version}.pom
|
||
|
|
Source6: https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/%{version}/asm-tree-%{version}.pom
|
||
|
|
Source7: https://repo1.maven.org/maven2/org/ow2/asm/asm-util/%{version}/asm-util-%{version}.pom
|
||
|
|
Source8: https://repo1.maven.org/maven2/org/ow2/asm/asm-xml/%{version}/asm-xml-%{version}.pom
|
||
|
|
Source9: asm-all.pom
|
||
|
|
|
||
|
|
BuildRequires: maven-local mvn(org.apache.felix:maven-bundle-plugin) mvn(org.apache.maven.plugins:maven-shade-plugin)
|
||
|
|
BuildRequires: mvn(org.ow2:ow2:pom:) mvn(org.codehaus.janino:janino) mvn(org.junit.jupiter:junit-jupiter-api)
|
||
|
|
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-engine) mvn(org.junit.jupiter:junit-jupiter-params)
|
||
|
|
BuildRequires: mvn(org.apache.maven.surefire:surefire-junit-platform) objectweb-asm >= 6
|
||
|
|
Requires: javapackages-tools
|
||
|
|
BuildArch: noarch
|
||
|
|
|
||
|
|
%description
|
||
|
|
ASM is an all purpose Java bytecode manipulation and analysis framework. It can be used to modify existing classes
|
||
|
|
or to dynamically generate classes, directly in binary form. ASM provides some common bytecode transformations and
|
||
|
|
analysis algorithms from which custom complex transformations and code analysis tools can be built. ASM offers similar
|
||
|
|
functionality as other Java bytecode frameworks, but is focused on performance. Because it was designed and implemented
|
||
|
|
to be as small and as fast as possible, it is well suited for use in dynamic systems (but can of course be used in a
|
||
|
|
static way too, e.g. in compilers).
|
||
|
|
|
||
|
|
%package help
|
||
|
|
Summary: API documentation for objectweb-asm
|
||
|
|
Provides: %{name}-javadoc = %{version}-%{release}
|
||
|
|
Obsoletes: %{name}-javadoc < %{version}-%{release}
|
||
|
|
|
||
|
|
%description help
|
||
|
|
This package provides API help documentation for objectweb-asm.
|
||
|
|
|
||
|
|
%prep
|
||
|
|
%autosetup -n asm-ASM_6_2_1-f86d1ce7d413a5d4f9a5b51c49eb592555c82e97 -p1
|
||
|
|
install -p -m 644 %{SOURCE1} pom.xml
|
||
|
|
|
||
|
|
find -name '*.jar' -delete
|
||
|
|
find asm{,-analysis,-commons} -name '*.class' -delete
|
||
|
|
rm -r gradle
|
||
|
|
|
||
|
|
for pom in asm asm-analysis asm-commons asm-test asm-tree asm-util asm-xml; do
|
||
|
|
install -p -m 644 $RPM_SOURCE_DIR/${pom}-%{version}.pom $pom/pom.xml
|
||
|
|
%pom_add_dep org.junit.jupiter:junit-jupiter-engine:5.1.0:test $pom
|
||
|
|
%pom_add_plugin org.apache.maven.plugins:maven-surefire-plugin:2.22.0 $pom
|
||
|
|
if [ "$pom" != "asm-test" ] ; then
|
||
|
|
bsn="org.objectweb.${pom//-/.}"
|
||
|
|
%pom_xpath_inject pom:project "<packaging>bundle</packaging>" $pom
|
||
|
|
%pom_add_plugin org.apache.felix:maven-bundle-plugin:3.5.0 $pom \
|
||
|
|
" <extensions>true</extensions>
|
||
|
|
<configuration>
|
||
|
|
<instructions>
|
||
|
|
<Bundle-SymbolicName>$bsn</Bundle-SymbolicName>
|
||
|
|
<Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
|
||
|
|
<_removeheaders>Bnd-LastModified,Build-By,Created-By,Include-Resource,Require-Capability,Tool</_removeheaders>
|
||
|
|
<_pluginpath>$(pwd)/tools/bnd-module-plugin/bnd-module-plugin.jar, $(find-jar objectweb-asm/asm-all)</_pluginpath>
|
||
|
|
<_plugin>org.objectweb.asm.tools.ModuleInfoBndPlugin;</_plugin>
|
||
|
|
</instructions>
|
||
|
|
</configuration>"
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
|
||
|
|
sed -i -e '/testReadAndWriteWithComputeMaxsAndLargeSubroutines/i@org.junit.jupiter.api.Disabled("missing class file")' \
|
||
|
|
asm/src/test/java/org/objectweb/asm/ClassWriterTest.java
|
||
|
|
sed -i -e '/testMergeWithJsrReachableFromTwoDifferentPaths/i@org.junit.jupiter.api.Disabled("missing class file")' \
|
||
|
|
asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/BasicInterpreterTest.java
|
||
|
|
sed -i -e '/testSortLocalVariablesAndInstantiate()/i@org.junit.jupiter.api.Disabled("missing class file")' \
|
||
|
|
asm-commons/src/test/java/org/objectweb/asm/commons/LocalVariablesSorterTest.java
|
||
|
|
|
||
|
|
install -d asm-all
|
||
|
|
sed 's/@VERSION@/%{version}/g' %{SOURCE9} > asm-all/pom.xml
|
||
|
|
|
||
|
|
%pom_remove_dep org.ow2.asm:asm-test asm-test
|
||
|
|
%mvn_alias :asm-all org.ow2.asm:asm-debug-all
|
||
|
|
%mvn_package :asm-aggregator __noinstall
|
||
|
|
%mvn_package :asm-test __noinstall
|
||
|
|
|
||
|
|
%build
|
||
|
|
pushd tools/bnd-module-plugin
|
||
|
|
javac -sourcepath ../../asm/src/main/java/ -cp $(build-classpath aqute-bnd) $(find -name *.java)
|
||
|
|
jar cf bnd-module-plugin.jar -C src/main/java org
|
||
|
|
popd
|
||
|
|
|
||
|
|
%mvn_build -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
|
||
|
|
|
||
|
|
%install
|
||
|
|
%mvn_install
|
||
|
|
%jpackage_script org.objectweb.asm.xml.Processor "" "" %{name}/asm:%{name}/asm-attrs:%{name}/asm-util:%{name}/asm-xml %{name}-processor true
|
||
|
|
|
||
|
|
%files -f .mfiles
|
||
|
|
%license LICENSE.txt
|
||
|
|
%{_bindir}/%{name}-processor
|
||
|
|
|
||
|
|
%files help -f .mfiles-javadoc
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Tue Feb 25 2020 zhouyihang <zhouyihang1@huawei.com> - 6.2.1-3
|
||
|
|
- Package init
|