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