20194b
%global homedir %{_datadir}/%{name}
20194b
%global bindir %{homedir}/bin
e083d3
%global hash 373601b4e608ea622b2fec947824b99cd0edb124
e083d3
%global __requires_exclude ^mvn\(.*\)$
20194b
20194b
Name:             byteman
e083d3
Version:          2.1.4.1
e083d3
Release:          3%{?dist}
20194b
Summary:          Java agent-based bytecode injection tool
20194b
License:          LGPLv2+
20194b
URL:              http://www.jboss.org/byteman
e083d3
Source0:          https://github.com/bytemanproject/byteman/archive/%{hash}.tar.gz
20194b
20194b
BuildArch:        noarch
20194b
20194b
BuildRequires:    jpackage-utils
20194b
BuildRequires:    javapackages-tools
20194b
BuildRequires:    java-devel
20194b
BuildRequires:    maven-local
20194b
BuildRequires:    maven-shade-plugin
20194b
BuildRequires:    maven-failsafe-plugin
20194b
BuildRequires:    maven-jar-plugin
20194b
BuildRequires:    maven-surefire-plugin
20194b
BuildRequires:    maven-surefire-provider-testng
20194b
BuildRequires:    maven-surefire-provider-junit4
20194b
BuildRequires:    maven-verifier-plugin
20194b
BuildRequires:    java_cup
20194b
BuildRequires:    jarjar
20194b
BuildRequires:    objectweb-asm
20194b
BuildRequires:    junit4
20194b
BuildRequires:    testng
20194b
20194b
Requires:         jpackage-utils
20194b
Requires:         java-devel
20194b
e083d3
# Bundled at build time
e083d3
Provides:         bundled(java_cup) = 1:0.11a-16
e083d3
Provides:         bundled(objectweb-asm) = 0:3.3.1-9
20194b
20194b
%description
20194b
Byteman is a tool which simplifies tracing and testing of Java programs.
20194b
Byteman allows you to insert extra Java code into your application,
20194b
either as it is loaded during JVM startup or even after it has already
20194b
started running. The injected code is allowed to access any of your data
20194b
and call any application methods, including where they are private.
20194b
You can inject code almost anywhere you want and there is no need to
20194b
prepare the original source code in advance nor do you have to recompile,
20194b
repackage or redeploy your application. In fact you can remove injected
20194b
code and reinstall different code while the application continues to execute.
20194b
20194b
%package javadoc
20194b
Summary:          Javadocs for %{name}
20194b
20194b
%description javadoc
20194b
This package contains the API documentation for %{name}.
20194b
20194b
%prep
e083d3
%setup -q -n byteman-%{hash}
20194b
20194b
# Fix the gid:aid for java_cup
20194b
sed -i "s|net.sf.squirrel-sql.thirdparty-non-maven|java_cup|" agent/pom.xml
20194b
sed -i "s|java-cup|java_cup|" agent/pom.xml
20194b
34bb07
# com.sun:tools dependency has scope "system", which should not used
34bb07
# in RHEL.
34bb07
%pom_remove_dep com.sun:tools
34bb07
e083d3
%pom_xpath_inject  "pom:plugin[pom:artifactId = 'maven-javadoc-plugin']/pom:configuration" "<additionalparam>\${doclintparam}</additionalparam>"
e083d3
%pom_xpath_inject  "pom:profiles" "<profile>
e083d3
        <id>disable-java-8-doclint</id>
e083d3
        <activation>
e083d3
            <jdk>[1.8,)</jdk>
e083d3
        </activation>
e083d3
        <properties>
e083d3
            <doclintparam>-Xdoclint:none</doclintparam>
e083d3
        </properties>
e083d3
      </profile>"
e083d3
20194b
%build
20194b
%mvn_build
20194b
20194b
%install
e083d3
%mvn_install
e083d3
20194b
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
20194b
20194b
install -d -m 755 $RPM_BUILD_ROOT%{homedir}
20194b
install -d -m 755 $RPM_BUILD_ROOT%{homedir}/lib
20194b
install -d -m 755 $RPM_BUILD_ROOT%{bindir}
20194b
20194b
install -m 755 bin/bmsubmit.sh $RPM_BUILD_ROOT%{bindir}/bmsubmit
20194b
install -m 755 bin/bminstall.sh  $RPM_BUILD_ROOT%{bindir}/bminstall
20194b
install -m 755 bin/bmjava.sh  $RPM_BUILD_ROOT%{bindir}/bmjava
20194b
install -m 755 bin/bmcheck.sh  $RPM_BUILD_ROOT%{bindir}/bmcheck
20194b
20194b
for f in bmsubmit bmjava bminstall bmcheck; do
20194b
cat > $RPM_BUILD_ROOT%{_bindir}/${f} << EOF
20194b
#!/bin/sh
20194b
20194b
export BYTEMAN_HOME=/usr/share/byteman
20194b
export JAVA_HOME=/usr/lib/jvm/java
20194b
20194b
\$BYTEMAN_HOME/bin/${f} \$*
20194b
EOF
20194b
done
20194b
20194b
chmod 755 $RPM_BUILD_ROOT%{_bindir}/*
20194b
20194b
for m in bmunit dtest install sample submit; do
20194b
  ln -s %{_javadir}/byteman/byteman-${m}.jar $RPM_BUILD_ROOT%{homedir}/lib/byteman-${m}.jar
20194b
done
20194b
20194b
ln -s %{_javadir}/byteman/byteman.jar $RPM_BUILD_ROOT%{homedir}/lib/byteman.jar
20194b
e083d3
%files -f .mfiles
e083d3
%dir %{_javadir}/%{name}
20194b
%{homedir}/*
20194b
%{_bindir}/*
20194b
%doc README docs/ProgrammersGuide.pdf docs/copyright.txt
20194b
e083d3
%files javadoc -f .mfiles-javadoc
20194b
%doc docs/copyright.txt
20194b
20194b
%changelog
e083d3
* Mon Jul 02 2018 Severin Gehwolf <sgehwolf@redhat.com> - 2.1.4.1-3
e083d3
- Allow rebuild with JDK-8.
e083d3
e083d3
* Wed Jun 06 2018 Severin Gehwolf <sgehwolf@redhat.com> - 2.1.4.1-2
e083d3
- Don't filter provides. Update bundled java_cup and
e083d3
  asm versions.
e083d3
e083d3
* Wed May 30 2018 Severin Gehwolf <sgehwolf@redhat.com> - 2.1.4.1-1
e083d3
- Rebase to version 2.1.4.1. Resolves RHBZ#1408898.
e083d3
34bb07
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 2.0.4-5
34bb07
- Mass rebuild 2013-12-27
34bb07
34bb07
* Wed Nov 13 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.0.4-4
34bb07
- Remove system-scoped dependency on tools.jar
34bb07
20194b
* Thu Apr 25 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-3
20194b
- Fixes to the launch scripts
20194b
20194b
* Wed Apr 24 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-2
20194b
- Added bmsubmit, bminstall and bmjava scripts, RHBZ#951560
20194b
20194b
* Thu Feb 21 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-1
20194b
- Upstream release 2.0.4
20194b
- Switched to Maven
20194b
- Bundling java_cup and objectweb-asm (fpc#226)
20194b
20194b
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-6
20194b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
20194b
20194b
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-5
20194b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
20194b
20194b
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-4
20194b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
20194b
20194b
* Tue Sep 20 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.2-3
20194b
- Removed binary files from src.rpm
20194b
20194b
* Mon Sep 19 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.2-2
20194b
- Cleaned spec file
20194b
20194b
* Wed Jul 27 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.2-1
20194b
- Upstream release: 1.5.2
20194b
20194b
* Thu Jul 21 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.1-1
20194b
- Initial packaging
20194b