Severin Gehwolf 75b8ba
%global javacup_or_asm java_cup:java_cup|org.ow2.asm:asm-all
Severin Gehwolf 75b8ba
%global __requires_exclude ^.*mvn\\(%{javacup_or_asm}\\)$
Severin Gehwolf 75b8ba
Marek Goldmann 986401
%global homedir %{_datadir}/%{name}
Marek Goldmann 986401
%global bindir %{homedir}/bin
Marek Goldmann 986401
Marek Goldmann 91459f
Name:             byteman
Severin Gehwolf 1ad9b3
Version:          3.0.6
Fedora Release Engineering 03bb78
Release:          4%{?dist}
Marek Goldmann 91459f
Summary:          Java agent-based bytecode injection tool
Marek Goldmann 91459f
License:          LGPLv2+
Marek Goldmann 91459f
URL:              http://www.jboss.org/byteman
Severin Gehwolf 1ad9b3
# wget -O 3.0.6.tar.gz https://github.com/bytemanproject/byteman/archive/3.0.6.tar.gz
Severin Gehwolf ebba2b
Source0:          https://github.com/bytemanproject/byteman/archive/%{version}.tar.gz
Marek Goldmann 91459f
Marek Goldmann 91459f
BuildArch:        noarch
Marek Goldmann 91459f
Marek Goldmann d226b2
BuildRequires:    maven-local
Marek Goldmann d226b2
BuildRequires:    maven-shade-plugin
Severin Gehwolf 5fc4f5
BuildRequires:    maven-source-plugin
Severin Gehwolf 5fc4f5
BuildRequires:    maven-plugin-plugin
Severin Gehwolf 5fc4f5
BuildRequires:    maven-plugin-bundle
Marek Goldmann d226b2
BuildRequires:    maven-failsafe-plugin
Marek Goldmann d226b2
BuildRequires:    maven-jar-plugin
Marek Goldmann d226b2
BuildRequires:    maven-surefire-plugin
Marek Goldmann d226b2
BuildRequires:    maven-surefire-provider-testng
Michal Srb ef86e6
BuildRequires:    maven-surefire-provider-junit
Marek Goldmann d226b2
BuildRequires:    maven-verifier-plugin
Severin Gehwolf ebba2b
BuildRequires:    maven-dependency-plugin
Marek Goldmann 91459f
BuildRequires:    java_cup
Marek Goldmann 91459f
BuildRequires:    jarjar
Severin Gehwolf ebba2b
BuildRequires:    objectweb-asm
Michal Srb ef86e6
BuildRequires:    junit
Marek Goldmann 91459f
BuildRequires:    testng
Severin Gehwolf ebba2b
# JBoss modules byteman plugin requires it
Severin Gehwolf ebba2b
BuildRequires:    mvn(org.jboss.modules:jboss-modules)
Marek Goldmann 91459f
Severin Gehwolf ebba2b
Provides:         bundled(objectweb-asm) = 0:5.0.4-2
Severin Gehwolf ebba2b
Provides:         bundled(java_cup) = 1:0.11b-3
Marek Goldmann d226b2
Marek Goldmann 91459f
%description
Marek Goldmann 91459f
Byteman is a tool which simplifies tracing and testing of Java programs.
Marek Goldmann 91459f
Byteman allows you to insert extra Java code into your application,
Marek Goldmann 91459f
either as it is loaded during JVM startup or even after it has already
Marek Goldmann 91459f
started running. The injected code is allowed to access any of your data
Marek Goldmann 91459f
and call any application methods, including where they are private.
Marek Goldmann 91459f
You can inject code almost anywhere you want and there is no need to
Marek Goldmann 91459f
prepare the original source code in advance nor do you have to recompile,
Marek Goldmann 91459f
repackage or redeploy your application. In fact you can remove injected
Marek Goldmann 91459f
code and reinstall different code while the application continues to execute.
Marek Goldmann 91459f
Marek Goldmann 91459f
%package javadoc
gil 016d0f
Summary:          Javadoc for %{name}
Marek Goldmann 91459f
Marek Goldmann 91459f
%description javadoc
Marek Goldmann 91459f
This package contains the API documentation for %{name}.
Marek Goldmann 91459f
Severin Gehwolf 75b8ba
%package rulecheck-maven-plugin
Severin Gehwolf 75b8ba
Summary:          Maven plugin for checking Byteman rules.
Severin Gehwolf 75b8ba
Severin Gehwolf 75b8ba
%description rulecheck-maven-plugin
Severin Gehwolf 75b8ba
This package contains the Byteman rule check maven plugin.
Severin Gehwolf 75b8ba
Marek Goldmann 91459f
%prep
Severin Gehwolf ebba2b
%setup -q -n byteman-%{version}
gil 016d0f
# Fix doclint problem
gil 016d0f
%pom_xpath_inject  "pom:plugin[pom:artifactId = 'maven-javadoc-plugin']/pom:configuration" "<additionalparam>-Xdoclint:none</additionalparam>"
Marek Goldmann 91459f
Marek Goldmann d226b2
# Fix the gid:aid for java_cup
Marek Goldmann d226b2
sed -i "s|net.sf.squirrel-sql.thirdparty-non-maven|java_cup|" agent/pom.xml
Marek Goldmann d226b2
sed -i "s|java-cup|java_cup|" agent/pom.xml
Marek Goldmann 91459f
Severin Gehwolf ebba2b
# Remove scope=system and systemPath for com.sun:tools
Severin Gehwolf ebba2b
%pom_xpath_remove "pom:profiles/pom:profile/pom:dependencies/pom:dependency[pom:artifactId='tools']/pom:scope" install
Severin Gehwolf ebba2b
%pom_xpath_remove "pom:profiles/pom:profile/pom:dependencies/pom:dependency[pom:artifactId='tools']/pom:systemPath" install
Severin Gehwolf ebba2b
%pom_xpath_remove "pom:profiles/pom:profile/pom:dependencies/pom:dependency[pom:artifactId='tools']/pom:scope" contrib/bmunit
Severin Gehwolf ebba2b
%pom_xpath_remove "pom:profiles/pom:profile/pom:dependencies/pom:dependency[pom:artifactId='tools']/pom:systemPath" contrib/bmunit
Michal Srb ef86e6
Severin Gehwolf 75b8ba
# Some tests fail intermittently during builds. Disable them.
Severin Gehwolf 75b8ba
%pom_disable_module tests contrib/jboss-modules-system
Severin Gehwolf 75b8ba
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-surefire-plugin']/pom:executions" contrib/bmunit
Severin Gehwolf 75b8ba
%pom_xpath_set "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-surefire-plugin']/pom:configuration" '<skip>true</skip>' contrib/bmunit
Severin Gehwolf 75b8ba
Severin Gehwolf 1ad9b3
# Don't build download, docs modules
Severin Gehwolf 1ad9b3
%pom_disable_module download
Severin Gehwolf 1ad9b3
%pom_disable_module docs
Severin Gehwolf 1ad9b3
Severin Gehwolf 1ad9b3
# Put maven plugin into a separate package
Severin Gehwolf 75b8ba
%mvn_package ":byteman-rulecheck-maven-plugin" rulecheck-maven-plugin
Severin Gehwolf 75b8ba
Marek Goldmann 91459f
%build
Severin Gehwolf 75b8ba
%mvn_build
Marek Goldmann 91459f
Marek Goldmann 91459f
%install
Marek Goldmann d8d67d
%mvn_install
Marek Goldmann d8d67d
Marek Goldmann 986401
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
Marek Goldmann 91459f
Marek Goldmann 986401
install -d -m 755 $RPM_BUILD_ROOT%{homedir}
Marek Goldmann 986401
install -d -m 755 $RPM_BUILD_ROOT%{homedir}/lib
Marek Goldmann 986401
install -d -m 755 $RPM_BUILD_ROOT%{bindir}
Marek Goldmann 986401
Marek Goldmann 986401
install -m 755 bin/bmsubmit.sh $RPM_BUILD_ROOT%{bindir}/bmsubmit
Marek Goldmann 986401
install -m 755 bin/bminstall.sh  $RPM_BUILD_ROOT%{bindir}/bminstall
Marek Goldmann 986401
install -m 755 bin/bmjava.sh  $RPM_BUILD_ROOT%{bindir}/bmjava
Marek Goldmann 986401
install -m 755 bin/bmcheck.sh  $RPM_BUILD_ROOT%{bindir}/bmcheck
Marek Goldmann 986401
Marek Goldmann 986401
for f in bmsubmit bmjava bminstall bmcheck; do
Marek Goldmann 986401
cat > $RPM_BUILD_ROOT%{_bindir}/${f} << EOF
Marek Goldmann 986401
#!/bin/sh
Marek Goldmann 986401
Marek Goldmann 986401
export BYTEMAN_HOME=/usr/share/byteman
Marek Goldmann a6df69
export JAVA_HOME=/usr/lib/jvm/java
Marek Goldmann 986401
Marek Goldmann a6df69
\$BYTEMAN_HOME/bin/${f} \$*
Marek Goldmann 986401
EOF
Marek Goldmann 986401
done
Marek Goldmann 986401
Marek Goldmann 986401
chmod 755 $RPM_BUILD_ROOT%{_bindir}/*
Marek Goldmann 986401
Marek Goldmann 986401
for m in bmunit dtest install sample submit; do
Marek Goldmann 986401
  ln -s %{_javadir}/byteman/byteman-${m}.jar $RPM_BUILD_ROOT%{homedir}/lib/byteman-${m}.jar
Marek Goldmann 986401
done
Marek Goldmann 986401
Marek Goldmann 986401
ln -s %{_javadir}/byteman/byteman.jar $RPM_BUILD_ROOT%{homedir}/lib/byteman.jar
Marek Goldmann 986401
Marek Goldmann d8d67d
%files -f .mfiles
Marek Goldmann 986401
%{homedir}/*
Marek Goldmann 986401
%{_bindir}/*
gil 016d0f
%doc README docs/ProgrammersGuide.pdf
gil 016d0f
%license docs/copyright.txt
Marek Goldmann 91459f
Marek Goldmann d8d67d
%files javadoc -f .mfiles-javadoc
gil 016d0f
%license docs/copyright.txt
Marek Goldmann 91459f
Severin Gehwolf 75b8ba
%files rulecheck-maven-plugin -f .mfiles-rulecheck-maven-plugin
Severin Gehwolf 75b8ba
%license docs/copyright.txt
Severin Gehwolf 75b8ba
Marek Goldmann 91459f
%changelog
Fedora Release Engineering 03bb78
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.6-4
Fedora Release Engineering 03bb78
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
Fedora Release Engineering 03bb78
Fedora Release Engineering 917db4
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.6-3
Fedora Release Engineering 917db4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
Fedora Release Engineering 917db4
Severin Gehwolf 5fc4f5
* Fri Dec 09 2016 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.6-2
Severin Gehwolf 5fc4f5
- Add BRs, maven-plugin-bundle, maven-source-plugin and
Severin Gehwolf 5fc4f5
  maven-plugin-plugin, fixing FTBFS.
Severin Gehwolf 5fc4f5
- Resolves: RHBZ#1402998
Severin Gehwolf 5fc4f5
Severin Gehwolf 1ad9b3
* Mon Jun 13 2016 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.6-1
Severin Gehwolf 1ad9b3
- Update to latest upstream release.
Severin Gehwolf 1ad9b3
Severin Gehwolf 75b8ba
* Mon Mar 14 2016 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.4-2
Severin Gehwolf 75b8ba
- Enable some tests during build
Severin Gehwolf 75b8ba
- Fix generated requires by filtering requires for bundled libs.
Severin Gehwolf 75b8ba
- Split maven plugin into separate package.
Severin Gehwolf 75b8ba
Severin Gehwolf ebba2b
* Thu Feb 18 2016 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.4-1
Severin Gehwolf ebba2b
- Update to latest upstream 3.0.4 release.
Severin Gehwolf ebba2b
Dennis Gilmore 1d1c3a
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.4.1-8
Dennis Gilmore 1d1c3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
Dennis Gilmore 1d1c3a
gil 016d0f
* Thu Aug 06 2015 gil cattaneo <puntogil@libero.it> 2.1.4.1-7
gil 016d0f
- Fix FTBFS rhbz#1239392
gil 016d0f
- Remove duplicate files
gil 016d0f
- Introduce license macro
gil 016d0f
Dennis Gilmore 447820
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.4.1-6
Dennis Gilmore 447820
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
Dennis Gilmore 447820
Michal Srb ef86e6
* Fri Feb 27 2015 Michal Srb <msrb@redhat.com> - 2.1.4.1-5
Michal Srb ef86e6
- Fix FTBFS
Michal Srb ef86e6
- Rebuild to generate new metadata
Michal Srb ef86e6
Dennis Gilmore 1a6214
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.4.1-4
Dennis Gilmore 1a6214
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
Dennis Gilmore 1a6214
Marek Goldmann a5b854
* Fri Apr 18 2014 Marek Goldmann <mgoldman@redhat.com> - 2.1.4.1-3
Marek Goldmann a5b854
- Rebuilding for objectweb-asm update, RHBZ#1083570
Marek Goldmann a5b854
Michael Simacek 69ae54
* Fri Mar 28 2014 Michael Simacek <msimacek@redhat.com> - 2.1.4.1-2
Michael Simacek 69ae54
- Use Requires: java-headless rebuild (#1067528)
Michael Simacek 69ae54
Marek Goldmann 07c3ff
* Fri Feb 14 2014 Marek Goldmann <mgoldman@redhat.com> - 2.1.4.1-1
Marek Goldmann 07c3ff
- Upstream release 2.1.4.1
Marek Goldmann 07c3ff
Dennis Gilmore a93d59
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.2-2
Dennis Gilmore a93d59
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
Dennis Gilmore a93d59
Marek Goldmann 6a9549
* Thu Jul 04 2013 Marek Goldmann <mgoldman@redhat.com> - 2.1.2-1
Marek Goldmann 6a9549
- Upstream release 2.1.2
Marek Goldmann 6a9549
Mikolaj Izdebski 51d4ec
* Wed Jun  5 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.0.4-5
Mikolaj Izdebski 51d4ec
- Remove tools.jar from dependencyManagement
Mikolaj Izdebski 51d4ec
Marek Goldmann d8d67d
* Wed May 29 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-4
Marek Goldmann d8d67d
- New guidelines
Marek Goldmann d8d67d
Marek Goldmann a6df69
* Thu Apr 25 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-3
Marek Goldmann a6df69
- Fixes to the launch scripts
Marek Goldmann a6df69
Marek Goldmann 986401
* Wed Apr 24 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-2
Marek Goldmann 986401
- Added bmsubmit, bminstall and bmjava scripts, RHBZ#951560
Marek Goldmann 986401
Marek Goldmann d226b2
* Thu Feb 21 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-1
Marek Goldmann d226b2
- Upstream release 2.0.4
Marek Goldmann d226b2
- Switched to Maven
Marek Goldmann d226b2
- Bundling java_cup and objectweb-asm (fpc#226)
Marek Goldmann d226b2
Dennis Gilmore 9699f6
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-6
Dennis Gilmore 9699f6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
Dennis Gilmore 9699f6
Dennis Gilmore 78671a
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-5
Dennis Gilmore 78671a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
Dennis Gilmore 78671a
Dennis Gilmore cec89d
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-4
Dennis Gilmore cec89d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
Dennis Gilmore cec89d
Marek Goldmann 91459f
* Tue Sep 20 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.2-3
Marek Goldmann 91459f
- Removed binary files from src.rpm
Marek Goldmann 91459f
Marek Goldmann 91459f
* Mon Sep 19 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.2-2
Marek Goldmann 91459f
- Cleaned spec file
Marek Goldmann 91459f
Marek Goldmann 91459f
* Wed Jul 27 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.2-1
Marek Goldmann 91459f
- Upstream release: 1.5.2
Marek Goldmann 91459f
Marek Goldmann 91459f
* Thu Jul 21 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.1-1
Marek Goldmann 91459f
- Initial packaging
Marek Goldmann 91459f