5ea6b0
%bcond_without junit5
5ea6b0
%bcond_without osgi
5ea6b0
5ea6b0
Name:           objectweb-asm
5ea6b0
Version:        7.3.1
5ea6b0
Release:        3%{?dist}
5ea6b0
Summary:        Java bytecode manipulation and analysis framework
5ea6b0
License:        BSD
5ea6b0
URL:            http://asm.ow2.org/
5ea6b0
BuildArch:      noarch
5ea6b0
5ea6b0
# ./generate-tarball.sh
5ea6b0
Source0:        %{name}-%{version}.tar.gz
5ea6b0
Source1:        parent.pom
5ea6b0
Source2:        https://repo1.maven.org/maven2/org/ow2/asm/asm/%{version}/asm-%{version}.pom
5ea6b0
Source3:        https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/%{version}/asm-analysis-%{version}.pom
5ea6b0
Source4:        https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/%{version}/asm-commons-%{version}.pom
5ea6b0
Source5:        https://repo1.maven.org/maven2/org/ow2/asm/asm-test/%{version}/asm-test-%{version}.pom
5ea6b0
Source6:        https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/%{version}/asm-tree-%{version}.pom
5ea6b0
Source7:        https://repo1.maven.org/maven2/org/ow2/asm/asm-util/%{version}/asm-util-%{version}.pom
5ea6b0
# We still want to create an "all" uberjar, so this is a custom pom to generate it
5ea6b0
# TODO: Fix other packages to no longer depend on "asm-all" so we can drop this
5ea6b0
Source8:        asm-all.pom
5ea6b0
# The source contains binary jars that cannot be verified for licensing and could be proprietary
5ea6b0
Source9:       generate-tarball.sh
5ea6b0
5ea6b0
# Revert upstream change https://gitlab.ow2.org/asm/asm/-/commit/2a58bc9bcf2ea6eee03e973d1df4cf9312573c9d
5ea6b0
# To restore some deprecations that were deleted and broke the API
5ea6b0
Patch0: 0001-Revert-upstream-change-2a58bc9.patch
5ea6b0
5ea6b0
BuildRequires:  maven-local
5ea6b0
BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
5ea6b0
BuildRequires:  mvn(org.apache.maven.plugins:maven-shade-plugin)
5ea6b0
BuildRequires:  mvn(org.ow2:ow2:pom:)
5ea6b0
%if %{with junit5}
5ea6b0
BuildRequires:  mvn(org.codehaus.janino:janino)
5ea6b0
BuildRequires:  mvn(org.junit.jupiter:junit-jupiter-api)
5ea6b0
BuildRequires:  mvn(org.junit.jupiter:junit-jupiter-engine)
5ea6b0
BuildRequires:  mvn(org.junit.jupiter:junit-jupiter-params)
5ea6b0
BuildRequires:  mvn(org.apache.maven.surefire:surefire-junit-platform)
5ea6b0
%endif
5ea6b0
5ea6b0
%if %{with osgi}
5ea6b0
# asm-all needs to be in pluginpath for BND.  If this self-dependency
5ea6b0
# becomes a problem then ASM core will have to be build from source
5ea6b0
# with javac before main maven build, just like bnd-module-plugin
5ea6b0
BuildRequires:  objectweb-asm >= 6
5ea6b0
%endif
5ea6b0
5ea6b0
# Explicit javapackages-tools requires since asm-processor script uses
5ea6b0
# /usr/share/java-utils/java-functions
5ea6b0
Requires:       javapackages-tools
5ea6b0
5ea6b0
%description
5ea6b0
ASM is an all purpose Java bytecode manipulation and analysis
5ea6b0
framework.  It can be used to modify existing classes or dynamically
5ea6b0
generate classes, directly in binary form.  Provided common
5ea6b0
transformations and analysis algorithms allow to easily assemble
5ea6b0
custom complex transformations and code analysis tools.
5ea6b0
5ea6b0
%package        javadoc
5ea6b0
Summary:        API documentation for %{name}
5ea6b0
5ea6b0
%description    javadoc
5ea6b0
This package provides %{summary}.
5ea6b0
5ea6b0
%prep
5ea6b0
%setup -q
5ea6b0
5ea6b0
%patch0 -p1
5ea6b0
5ea6b0
# A custom parent pom to aggregate the build
5ea6b0
cp -p %{SOURCE1} pom.xml
5ea6b0
5ea6b0
%if %{without junit5}
5ea6b0
%pom_disable_module asm-test
5ea6b0
%endif
5ea6b0
5ea6b0
# Insert poms into modules
5ea6b0
for pom in asm asm-analysis asm-commons asm-test asm-tree asm-util; do
5ea6b0
  cp -p $RPM_SOURCE_DIR/${pom}-%{version}.pom $pom/pom.xml
5ea6b0
  # Fix junit5 configuration
5ea6b0
%if %{with junit5}
5ea6b0
  %pom_add_dep org.junit.jupiter:junit-jupiter-engine:5.1.0:test $pom
5ea6b0
  %pom_add_plugin org.apache.maven.plugins:maven-surefire-plugin:2.22.0 $pom
5ea6b0
%endif
5ea6b0
%if %{with osgi}
5ea6b0
  if [ "$pom" != "asm-test" ] ; then
5ea6b0
    # Make into OSGi bundles
5ea6b0
    bsn="org.objectweb.${pom//-/.}"
5ea6b0
    %pom_xpath_inject pom:project "<packaging>bundle</packaging>" $pom
5ea6b0
    %pom_add_plugin org.apache.felix:maven-bundle-plugin:3.5.0 $pom \
5ea6b0
"   <extensions>true</extensions>
5ea6b0
    <configuration>
5ea6b0
      <instructions>
5ea6b0
        <Bundle-SymbolicName>$bsn</Bundle-SymbolicName>
5ea6b0
        <Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
5ea6b0
        <_removeheaders>Bnd-LastModified,Build-By,Created-By,Include-Resource,Require-Capability,Tool</_removeheaders>
5ea6b0
        <_pluginpath>$(pwd)/tools/bnd-module-plugin/bnd-module-plugin.jar, $(find-jar objectweb-asm/asm-all)</_pluginpath>
5ea6b0
        <_plugin>org.objectweb.asm.tools.ModuleInfoBndPlugin;</_plugin>
5ea6b0
      </instructions>
5ea6b0
    </configuration>"
5ea6b0
  fi
5ea6b0
%endif
5ea6b0
done
5ea6b0
5ea6b0
# Disable tests that use unlicensed class files
5ea6b0
sed -i -e '/testToByteArray_computeMaxs_largeSubroutines/i@org.junit.jupiter.api.Disabled("missing class file")' \
5ea6b0
  asm/src/test/java/org/objectweb/asm/ClassWriterTest.java
5ea6b0
sed -i -e '/testAnalyze_mergeWithJsrReachableFromTwoDifferentPaths/i@org.junit.jupiter.api.Disabled("missing class file")' \
5ea6b0
  asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/AnalyzerWithBasicInterpreterTest.java
5ea6b0
sed -i -e '/testAllMethods_issue317586()/i@org.junit.jupiter.api.Disabled("missing class file")' \
5ea6b0
  asm-commons/src/test/java/org/objectweb/asm/commons/LocalVariablesSorterTest.java
5ea6b0
5ea6b0
# Remove failing test SerialVersionUidAdderTest due to missing class files
5ea6b0
rm asm-commons/src/test/java/org/objectweb/asm/commons/SerialVersionUidAdderTest.java
5ea6b0
5ea6b0
# Insert asm-all pom
5ea6b0
mkdir -p asm-all
5ea6b0
sed 's/@VERSION@/%{version}/g' %{SOURCE8} > asm-all/pom.xml
5ea6b0
5ea6b0
# Remove invalid self-dependency
5ea6b0
%pom_remove_dep org.ow2.asm:asm-test asm-test
5ea6b0
5ea6b0
# Compat aliases
5ea6b0
%mvn_alias :asm-all org.ow2.asm:asm-debug-all
5ea6b0
5ea6b0
# No need to ship the custom parent pom
5ea6b0
%mvn_package :asm-aggregator __noinstall
5ea6b0
# Don't ship the test framework to avoid runtime dep on junit
5ea6b0
%mvn_package :asm-test __noinstall
5ea6b0
5ea6b0
%build
5ea6b0
# Must compile bnd plugin first, which is used to generate Java 9 module-info.class files
5ea6b0
pushd tools/bnd-module-plugin
5ea6b0
javac -sourcepath ../../asm/src/main/java/ -cp $(build-classpath aqute-bnd) $(find -name *.java)
5ea6b0
jar cf bnd-module-plugin.jar -C src/main/java org
5ea6b0
popd
5ea6b0
5ea6b0
%if %{with junit5}
5ea6b0
%mvn_build -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
5ea6b0
%else
5ea6b0
%mvn_build -f -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
5ea6b0
%endif
5ea6b0
5ea6b0
%install
5ea6b0
%mvn_install
5ea6b0
5ea6b0
%jpackage_script org.objectweb.asm.xml.Processor "" "" %{name}/asm:%{name}/asm-attrs:%{name}/asm-util %{name}-processor true
5ea6b0
5ea6b0
%files -f .mfiles
5ea6b0
%license LICENSE.txt
5ea6b0
%{_bindir}/%{name}-processor
5ea6b0
5ea6b0
%files javadoc -f .mfiles-javadoc
5ea6b0
%license LICENSE.txt
5ea6b0
5ea6b0
%changelog
5ea6b0
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 7.3.1-3
5ea6b0
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
5ea6b0
5ea6b0
* Wed May 06 2020 Mat Booth <mat.booth@redhat.com> - 7.3.1-2
5ea6b0
- Revert an upstream change to prevent breaking API change
5ea6b0
5ea6b0
* Thu Feb 27 2020 Jayashree Huttanagoudat <jhuttana@redhat.com> - 7.3.1-1
5ea6b0
- Upgraded to upstream version 7.3.1.
5ea6b0
5ea6b0
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 7.0-4
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
5ea6b0
5ea6b0
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.0-3
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
5ea6b0
5ea6b0
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.0-2
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
5ea6b0
5ea6b0
* Wed Nov 21 2018 Severin Gehwolf <sgehwolf@redhat.com> - 7.0-1
5ea6b0
- Update to latest upstream 7.0 release.
5ea6b0
- Removes package asm-xml (deprecated since 6.1).
5ea6b0
5ea6b0
* Tue Sep 11 2018 Mat Booth <mat.booth@redhat.com> - 6.2.1-1
5ea6b0
- Update to latest upstream release
5ea6b0
- Fix test suite execution
5ea6b0
5ea6b0
* Fri Aug 03 2018 Michael Simacek <msimacek@redhat.com> - 6.2-5
5ea6b0
- Repack the tarball without binaries
5ea6b0
5ea6b0
* Wed Aug 01 2018 Severin Gehwolf <sgehwolf@redhat.com> - 6.2-4
5ea6b0
- Explicitly require javapackages-tools for asm-processor script
5ea6b0
  which uses java-functions.
5ea6b0
5ea6b0
* Wed Aug 01 2018 Severin Gehwolf <sgehwolf@redhat.com> - 6.2-3
5ea6b0
- Allow conditionally building without OSGi
5ea6b0
  metadata.
5ea6b0
5ea6b0
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.2-2
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
5ea6b0
5ea6b0
* Mon Jul 02 2018 Michael Simacek <msimacek@redhat.com> - 6.2-1
5ea6b0
- Update to upstream version 6.2
5ea6b0
5ea6b0
* Sat Jun 30 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 6.1.1-4
5ea6b0
- Relax versioned self-build-requirement a bit
5ea6b0
5ea6b0
* Fri Jun 29 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 6.1.1-3
5ea6b0
- Add objectweb-asm to BND pluginpath
5ea6b0
5ea6b0
* Thu Jun 28 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 6.1.1-2
5ea6b0
- Allow conditionally building without junit5
5ea6b0
5ea6b0
* Wed Apr 25 2018 Mat Booth <mat.booth@redhat.com> - 6.1.1-1
5ea6b0
- Update to latest upstream relase for Java 10 support
5ea6b0
- Switch to maven build
5ea6b0
- Now executing test suites
5ea6b0
5ea6b0
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0-2
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
5ea6b0
5ea6b0
* Mon Sep 25 2017 Michael Simacek <msimacek@redhat.com> - 6.0-1
5ea6b0
- Update to upstream version 6.0
5ea6b0
5ea6b0
* Tue Sep 12 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 6.0-0.2.beta
5ea6b0
- Fix invalid OSGi metadata
5ea6b0
- Resolves: rhbz#1490817
5ea6b0
5ea6b0
* Mon Sep 11 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 6.0-0.1.beta
5ea6b0
- Update to upstream version 6.0 beta
5ea6b0
5ea6b0
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.1-8
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5ea6b0
5ea6b0
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.1-7
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
5ea6b0
5ea6b0
* Mon Oct 10 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.1-6
5ea6b0
- Use OSGi API JARs to run BND classpath, instead of Eclipse
5ea6b0
5ea6b0
* Sat Sep 24 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.1-5
5ea6b0
- Update to current packaging guidelines
5ea6b0
- Remove obsoletes and provides for objectweb-asm4
5ea6b0
5ea6b0
* Wed Jun 15 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.1-4
5ea6b0
- Add missing build-requires
5ea6b0
5ea6b0
* Wed Jun  1 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.1-3
5ea6b0
- Avoid calling XMvn from build-classpath
5ea6b0
5ea6b0
* Tue May 31 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.1-2
5ea6b0
- Add missing JARs to BND classpath
5ea6b0
5ea6b0
* Thu Mar 24 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.1-1
5ea6b0
- Update to upstream version 5.1
5ea6b0
5ea6b0
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.4-2
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
5ea6b0
5ea6b0
* Thu Aug 06 2015 Michael Simacek <msimacek@redhat.com> - 5.0.4-1
5ea6b0
- Update to upstream version 5.0.4
5ea6b0
5ea6b0
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.3-2
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
5ea6b0
5ea6b0
* Sun Jul 20 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.0.3-1
5ea6b0
- Update to upstream version 5.0.3
5ea6b0
5ea6b0
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.2-2
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
5ea6b0
5ea6b0
* Mon May  5 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.0.2-1
5ea6b0
- Update to upstream version 5.0.2
5ea6b0
5ea6b0
* Mon Apr 14 2014 Mat Booth <mat.booth@redhat.com> - 5.0.1-2
5ea6b0
- SCL-ize package.
5ea6b0
- Fix bogus dates in changelog.
5ea6b0
5ea6b0
* Mon Mar 24 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.0.1-1
5ea6b0
- Update to upstream version 5.0.1
5ea6b0
5ea6b0
* Wed Mar 19 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.0-0.3.beta
5ea6b0
- Enable asm-debug-all module
5ea6b0
5ea6b0
* Mon Jan 20 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.0-0.2.beta
5ea6b0
- Remove Eclipse Orbit alias
5ea6b0
5ea6b0
* Tue Dec  3 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.0-0.1.beta
5ea6b0
- Update to 5.0 beta
5ea6b0
5ea6b0
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:3.3.1-8
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
5ea6b0
5ea6b0
* Wed Mar  6 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:3.3.1-7
5ea6b0
- Make jetty orbit depmap point to asm-all jar
5ea6b0
- Resolves: rhbz#917625
5ea6b0
5ea6b0
* Mon Mar  4 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:3.3.1-6
5ea6b0
- Add depmap for org.eclipse.jetty.orbit
5ea6b0
- Resolves: rhbz#917625
5ea6b0
5ea6b0
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:3.3.1-5
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
5ea6b0
5ea6b0
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:3.3.1-4
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
5ea6b0
5ea6b0
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:3.3.1-3
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
5ea6b0
5ea6b0
* Fri Sep 16 2011 Alexander Kurtakov <akurtako@redhat.com> 0:3.3.1-2
5ea6b0
- Use poms produced by the build not foreign ones.
5ea6b0
- Adpat to current guidelines.
5ea6b0
5ea6b0
* Mon Apr 04 2011 Chris Aniszczyk <zx@redhat.com> 0:3.3.1
5ea6b0
- Upgrade to 3.3.1
5ea6b0
5ea6b0
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:3.2-3
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
5ea6b0
5ea6b0
* Tue Jul 13 2010 Orion Poplawski <orion@cora.nwra.com>  0:3.2.1-2
5ea6b0
- Change depmap parent id to asm (bug #606659)
5ea6b0
5ea6b0
* Thu Apr 15 2010 Fernando Nasser <fnasser@redhat.com> 0:3.2.1
5ea6b0
- Upgrade to 3.2
5ea6b0
5ea6b0
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:3.1-7.1
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
5ea6b0
5ea6b0
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:3.1-6.1
5ea6b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
5ea6b0
5ea6b0
* Thu Oct 23 2008 David Walluck <dwalluck@redhat.com> 0:3.1-5.1
5ea6b0
- build for Fedora
5ea6b0
5ea6b0
* Thu Oct 23 2008 David Walluck <dwalluck@redhat.com> 0:3.1-5
5ea6b0
- add OSGi manifest (Alexander Kurtakov)
5ea6b0
5ea6b0
* Mon Oct 20 2008 David Walluck <dwalluck@redhat.com> 0:3.1-4
5ea6b0
- remove Class-Path from MANIFEST.MF
5ea6b0
- add unversioned javadoc symlink
5ea6b0
- remove javadoc scriptlets
5ea6b0
- fix directory ownership
5ea6b0
- remove build requirement on dos2unix
5ea6b0
5ea6b0
* Fri Feb 08 2008 Ralph Apel <r.apel@r-apel.de> - 0:3.1-3jpp
5ea6b0
- Add poms and depmap frags with groupId of org.objectweb.asm !
5ea6b0
- Add asm-all.jar 
5ea6b0
- Add -javadoc Requires post and postun
5ea6b0
- Restore Vendor, Distribution
5ea6b0
5ea6b0
* Thu Nov 22 2007 Fernando Nasser <fnasser@redhat.com> - 0:3.1-2jpp
5ea6b0
- Fix EOL of txt files
5ea6b0
- Add dependency on jaxp 
5ea6b0
5ea6b0
* Thu Nov 22 2007 Fernando Nasser <fnasser@redhat.com> - 0:3.1-1jpp
5ea6b0
- Upgrade to 3.1
5ea6b0
5ea6b0
* Wed Aug 22 2007 Fernando Nasser <fnasser@redhat.com> - 0:3.0-1jpp
5ea6b0
- Upgrade to 3.0
5ea6b0
- Rename to include objectweb- prefix as requested by ObjectWeb
5ea6b0
5ea6b0
* Thu Jan 05 2006 Fernando Nasser <fnasser@redhat.com> - 0:2.1-2jpp
5ea6b0
- First JPP 1.7 build
5ea6b0
5ea6b0
* Thu Oct 06 2005 Ralph Apel <r.apel at r-apel.de> 0:2.1-1jpp
5ea6b0
- Upgrade to 2.1
5ea6b0
5ea6b0
* Fri Mar 11 2005 Sebastiano Vigna <vigna at acm.org> 0:2.0.RC1-1jpp
5ea6b0
- First release of the 2.0 line.