Blame SPECS/objectweb-asm3.spec

b63f0b
%{?scl:%scl_package objectweb-asm3}
b63f0b
%{!?scl:%global pkg_name %{name}}
b63f0b
b63f0b
Name:           %{?scl_prefix}objectweb-asm3
b63f0b
Version:        3.3.1
b63f0b
Release:        14.2%{?dist}
b63f0b
Summary:        Java bytecode manipulation and analysis framework
b63f0b
License:        BSD
b63f0b
URL:            http://asm.ow2.org/
b63f0b
BuildArch:      noarch
b63f0b
b63f0b
Source0:        http://download.forge.ow2.org/asm/asm-%{version}.tar.gz
b63f0b
Source1:        http://www.apache.org/licenses/LICENSE-2.0.txt
b63f0b
b63f0b
BuildRequires:  %{?scl_prefix}ant
b63f0b
BuildRequires:  %{?scl_prefix}maven-local
b63f0b
# shade-jar utility used in this spec file needs this
b63f0b
BuildRequires:  %{?scl_prefix}objectweb-asm3
b63f0b
b63f0b
%description
b63f0b
ASM is an all purpose Java bytecode manipulation and analysis
b63f0b
framework.  It can be used to modify existing classes or dynamically
b63f0b
generate classes, directly in binary form.  Provided common
b63f0b
transformations and analysis algorithms allow to easily assemble
b63f0b
custom complex transformations and code analysis tools.
b63f0b
b63f0b
%package        javadoc
b63f0b
Summary:        API documentation for %{pkg_name}
b63f0b
b63f0b
%description    javadoc
b63f0b
This package provides %{summary}.
b63f0b
b63f0b
%prep
b63f0b
%setup -q -n asm-%{version}
b63f0b
find -name *.jar -delete
b63f0b
b63f0b
sed -i /Class-path/d archive/asm-xml.xml
b63f0b
b63f0b
# Our system version of asm always used BSN org.objectweb.asm for
b63f0b
# asm-all because that's what Eclipse bundle has.  Now upstream
b63f0b
# provides OSGi metadata with incompatible BSN, but we want to keep
b63f0b
# compatibility with existing Eclipse plugins, so we have to use the
b63f0b
# old BSN (org.objectweb.asm).
b63f0b
sed -i s/org.objectweb.asm.all/org.objectweb.asm/ archive/asm-all.xml
b63f0b
b63f0b
%build
b63f0b
%ant -Dobjectweb.ant.tasks.path= jar jdoc
b63f0b
b63f0b
mv output/dist/lib/all/* output/dist/lib/
b63f0b
b63f0b
# Fix artifactId in POMs for shaded artifacts
b63f0b
for m in asm asm-analysis asm-commons asm-tree asm-util asm-xml asm-all; do
b63f0b
    cp output/dist/lib/${m}-%{version}.pom output/dist/lib/${m}-distroshaded-%{version}.pom
b63f0b
    %pom_xpath_set "pom:project/pom:artifactId" "${m}-distroshaded" \
b63f0b
                   output/dist/lib/${m}-distroshaded-%{version}.pom
b63f0b
done
b63f0b
b63f0b
# Fix inter-module dependecies in POMs for shaded artifacts
b63f0b
%if 0%{?fedora} > 0
b63f0b
pushd output/dist/lib
b63f0b
for m in asm-analysis asm-commons asm-util; do
b63f0b
    %pom_remove_dep :asm-tree ${m}-distroshaded-%{version}.pom
b63f0b
    %pom_add_dep asm:asm-tree-distroshaded:3.3.1 ${m}-distroshaded-%{version}.pom
b63f0b
done
b63f0b
%pom_remove_dep :asm-util asm-xml-distroshaded-%{version}.pom
b63f0b
%pom_add_dep asm:asm-util-distroshaded:3.3.1 asm-xml-distroshaded-%{version}.pom
b63f0b
b63f0b
%pom_remove_dep :asm asm-tree-distroshaded-%{version}.pom
b63f0b
%pom_add_dep asm:asm-distroshaded:3.3.1 asm-tree-distroshaded-%{version}.pom
b63f0b
popd
b63f0b
b63f0b
for m in asm asm-analysis asm-commons asm-tree asm-util asm-xml asm-all; do
b63f0b
    shade-jar org.objectweb.asm org.objectweb.distroshaded.asm output/dist/lib/${m}-%{version}.jar \
b63f0b
              output/dist/lib/${m}-distroshaded-%{version}.jar
b63f0b
    jar xf output/dist/lib/${m}-distroshaded-%{version}.jar META-INF/MANIFEST.MF
b63f0b
    sed -i /Bundle-/d META-INF/MANIFEST.MF
b63f0b
    jar ufM output/dist/lib/${m}-distroshaded-%{version}.jar META-INF/MANIFEST.MF
b63f0b
done
b63f0b
%endif
b63f0b
b63f0b
%install
b63f0b
%mvn_artifact output/dist/lib/asm-parent-%{version}.pom
b63f0b
b63f0b
for m in asm asm-analysis asm-commons asm-tree asm-util asm-xml asm-all; do
b63f0b
%if 0%{?fedora} > 0
b63f0b
    %mvn_artifact output/dist/lib/${m}-distroshaded-%{version}.pom \
b63f0b
                  output/dist/lib/${m}-distroshaded-%{version}.jar
b63f0b
%endif
b63f0b
    %mvn_artifact output/dist/lib/${m}-%{version}.pom \
b63f0b
                  output/dist/lib/${m}-%{version}.jar
b63f0b
done
b63f0b
%mvn_install -J output/dist/doc/javadoc/user
b63f0b
b63f0b
%jpackage_script org.objectweb.asm.xml.Processor "" "" %{pkg_name}/asm:%{pkg_name}/asm-attrs:%{pkg_name}/asm-util:%{pkg_name}/asm-xml %{pkg_name}-processor true
b63f0b
b63f0b
%files -f .mfiles
b63f0b
%doc LICENSE.txt README.txt
b63f0b
%{_bindir}/%{pkg_name}-processor
b63f0b
%dir %{_javadir}/%{pkg_name}
b63f0b
b63f0b
%files javadoc -f .mfiles-javadoc
b63f0b
%doc LICENSE.txt
b63f0b
b63f0b
%changelog
b63f0b
* Thu Jun 22 2017 Michael Simacek <msimacek@redhat.com> - 3.3.1-14.2
b63f0b
- Mass rebuild 2017-06-22
b63f0b
b63f0b
* Wed Jun 21 2017 Java Maintainers <java-maint@redhat.com> - 3.3.1-14.1
b63f0b
- Automated package import and SCL-ization
b63f0b
b63f0b
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.1-14
b63f0b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
b63f0b
b63f0b
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.1-13
b63f0b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
b63f0b
b63f0b
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.1-12
b63f0b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
b63f0b
b63f0b
* Tue Sep  2 2014 Darryl L. Pierce <dpierce@redhat.com> - 3.3.1-11
b63f0b
- First build for EPEL7.
b63f0b
b63f0b
* Fri Aug 29 2014 Darryl L. Pierce <dpierce@redhat.com> - 3.3.1-10.1
b63f0b
- Commented out BR on objectweb-asm3 to enable building on EPEL7.
b63f0b
b63f0b
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.1-10
b63f0b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
b63f0b
b63f0b
* Mon Jan 20 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.3.1-9
b63f0b
- Remove Eclipse Orbit alias
b63f0b
b63f0b
* Mon Dec 16 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.3.1-8
b63f0b
- Remove OSGi metadata from shaded JARs
b63f0b
- Resolves: rhbz#1043066
b63f0b
b63f0b
* Fri Dec 06 2013 Michal Srb <msrb@redhat.com> - 3.3.1-7
b63f0b
- Separate artifacts for shaded asm
b63f0b
b63f0b
* Thu Dec 05 2013 Michal Srb <msrb@redhat.com> - 3.3.1-6
b63f0b
- Fix provides
b63f0b
b63f0b
* Thu Dec 05 2013 Michal Srb <msrb@redhat.com> - 3.3.1-5
b63f0b
- Build also "distroshaded" JARs and install them
b63f0b
b63f0b
* Thu Dec  5 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.3.1-4
b63f0b
- Change asm-all BSN to org.objectweb.asm
b63f0b
b63f0b
* Tue Dec  3 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.3.1-3
b63f0b
- Install asm-parent POM
b63f0b
b63f0b
* Thu Nov 14 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.3.1-2
b63f0b
- Remove classpath from manifest
b63f0b
- Install %{pkg_name}-processor command
b63f0b
b63f0b
* Mon Nov 11 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.3.1-1
b63f0b
- Initial packaging