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