Blame SPECS/byteman.spec

41999a
# Note to the interested reader:
41999a
#   fedpkg mockbuild --without tests
41999a
# will make mvn_build macro skip tests.
41999a
# See: https://github.com/fedora-java/javapackages/issues/62
41999a
41999a
%global javacup_or_asm java_cup:java_cup|org\\.ow2\\.asm:asm.*
41999a
# Don't have generated mvn()-style requires for java_cup or asm
41999a
%global mvn_javacup_or_asm_matcher .*mvn\\(%{javacup_or_asm}\\)
41999a
# Don't have generated requires for java-headless >= 1:1.9
41999a
%global java_headless_matcher java-headless >= 1:(1\\.9|9)
41999a
%global __requires_exclude ^%{mvn_javacup_or_asm_matcher}|%{java_headless_matcher}$
41999a
41999a
%global homedir %{_datadir}/%{name}
41999a
%global bindir %{homedir}/bin
41999a
41999a
Name:             byteman
41999a
Version:          4.0.4
41999a
Release:          2%{?dist}
41999a
Summary:          Java agent-based bytecode injection tool
41999a
License:          LGPLv2+
41999a
URL:              http://www.jboss.org/byteman
41999a
# wget -O 4.0.4.tar.gz https://github.com/bytemanproject/byteman/archive/4.0.4.tar.gz
41999a
Source0:          https://github.com/bytemanproject/byteman/archive/%{version}.tar.gz
41999a
41999a
BuildArch:        noarch
41999a
41999a
# Byteman 4.x requires JDK 9+ to build. Require JDK 11 explicitly.
41999a
BuildRequires:    java-11-openjdk-devel
41999a
BuildRequires:    maven-local
41999a
BuildRequires:    maven-shade-plugin
41999a
BuildRequires:    maven-source-plugin
41999a
BuildRequires:    maven-plugin-plugin
41999a
BuildRequires:    maven-plugin-bundle
41999a
BuildRequires:    maven-assembly-plugin
41999a
BuildRequires:    maven-failsafe-plugin
41999a
BuildRequires:    maven-jar-plugin
41999a
BuildRequires:    maven-surefire-plugin
41999a
BuildRequires:    maven-surefire-provider-testng
41999a
BuildRequires:    maven-surefire-provider-junit
41999a
BuildRequires:    maven-verifier-plugin
41999a
BuildRequires:    maven-dependency-plugin
41999a
BuildRequires:    java_cup
41999a
BuildRequires:    jarjar
41999a
BuildRequires:    objectweb-asm
41999a
BuildRequires:    junit
41999a
BuildRequires:    testng
41999a
# JBoss modules byteman plugin requires it
41999a
BuildRequires:    mvn(org.jboss.modules:jboss-modules)
41999a
41999a
Provides:         bundled(objectweb-asm) = 6.2
41999a
Provides:         bundled(java_cup) = 1:0.11b-8
41999a
# We are filtering java-headless >= 1:1.9 requirement. Add
41999a
# JDK 8 requirement here explicitly which shouldn't match the filter.
41999a
Requires:         java-headless >= 1:1.8
41999a
41999a
# Related pieces removed via pom_xpath_remove macros
41999a
Patch1:           remove_submit_integration_test_verification.patch
41999a
41999a
%description
41999a
Byteman is a tool which simplifies tracing and testing of Java programs.
41999a
Byteman allows you to insert extra Java code into your application,
41999a
either as it is loaded during JVM startup or even after it has already
41999a
started running. The injected code is allowed to access any of your data
41999a
and call any application methods, including where they are private.
41999a
You can inject code almost anywhere you want and there is no need to
41999a
prepare the original source code in advance nor do you have to recompile,
41999a
repackage or redeploy your application. In fact you can remove injected
41999a
code and reinstall different code while the application continues to execute.
41999a
41999a
%package javadoc
41999a
Summary:          Javadoc for %{name}
41999a
41999a
%description javadoc
41999a
This package contains the API documentation for %{name}.
41999a
41999a
%package rulecheck-maven-plugin
41999a
Summary:          Maven plugin for checking Byteman rules.
41999a
41999a
%description rulecheck-maven-plugin
41999a
This package contains the Byteman rule check maven plugin.
41999a
41999a
%package bmunit
41999a
Summary:          TestNG and JUnit integration for Byteman.
41999a
41999a
%description bmunit
41999a
The Byteman bmunit jar provides integration of Byteman into
41999a
TestNG and JUnit tests.
41999a
41999a
%package dtest
41999a
Summary:          Remote byteman instrumented testing.
41999a
41999a
%description dtest
41999a
The Byteman dtest jar supports instrumentation of test code executed on
41999a
remote server hosts and validation of assertions describing the expected
41999a
operation of the instrumented methods.
41999a
41999a
%prep
41999a
%setup -q -n byteman-%{version}
41999a
41999a
# Don't use javadoc plugin, use XMvn for javadocs
41999a
%pom_remove_plugin -r :maven-javadoc-plugin
41999a
%pom_xpath_remove 'pom:execution[pom:id="make-javadoc-assembly"]' byteman
41999a
41999a
# Fix the gid:aid for java_cup
41999a
sed -i "s|net.sf.squirrel-sql.thirdparty-non-maven|java_cup|" agent/pom.xml
41999a
sed -i "s|java-cup|java_cup|" agent/pom.xml
41999a
sed -i "s|net.sf.squirrel-sql.thirdparty-non-maven|java_cup|" tests/pom.xml
41999a
sed -i "s|java-cup|java_cup|" tests/pom.xml
41999a
41999a
# Remove Submit integration test invocations (agent)
41999a
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-failsafe-plugin']/pom:executions/pom:execution[pom:id='submit.TestSubmit']" agent
41999a
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-failsafe-plugin']/pom:executions/pom:execution[pom:id='submit.TestSubmit.compiled']" agent
41999a
%patch1 -p2
41999a
41999a
# Remove Submit integration test invocations (tests)
41999a
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-failsafe-plugin']/pom:executions/pom:execution[pom:id='submit.TestSubmit']" tests
41999a
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-failsafe-plugin']/pom:executions/pom:execution[pom:id='submit.TestSubmit.compiled']" tests
41999a
41999a
# Remove scope=system and systemPath for com.sun:tools
41999a
%pom_xpath_remove "pom:profiles/pom:profile/pom:dependencies/pom:dependency[pom:artifactId='tools']/pom:scope" install
41999a
%pom_xpath_remove "pom:profiles/pom:profile/pom:dependencies/pom:dependency[pom:artifactId='tools']/pom:systemPath" install
41999a
%pom_xpath_remove "pom:profiles/pom:profile/pom:dependencies/pom:dependency[pom:artifactId='tools']/pom:scope" contrib/bmunit
41999a
%pom_xpath_remove "pom:profiles/pom:profile/pom:dependencies/pom:dependency[pom:artifactId='tools']/pom:systemPath" contrib/bmunit
41999a
41999a
# Some tests fail intermittently during builds. Disable them.
41999a
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-surefire-plugin']/pom:executions" contrib/bmunit
41999a
%pom_xpath_set "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-surefire-plugin']/pom:configuration" '<skip>true</skip>' contrib/bmunit
41999a
41999a
# Don't build download, docs modules
41999a
%pom_disable_module download
41999a
%pom_disable_module docs
41999a
41999a
# Put maven plugin into a separate package
41999a
%mvn_package ":byteman-rulecheck-maven-plugin" rulecheck-maven-plugin
41999a
# Put byteman-bmunit/byteman-dtest into a separate packages since they
41999a
# runtime require junit
41999a
%mvn_package ":byteman-bmunit" bmunit
41999a
%mvn_package ":byteman-dtest" dtest
41999a
41999a
%build
41999a
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
41999a
%mvn_build
41999a
41999a
%install
41999a
%mvn_install
41999a
41999a
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
41999a
41999a
install -d -m 755 $RPM_BUILD_ROOT%{homedir}
41999a
install -d -m 755 $RPM_BUILD_ROOT%{homedir}/lib
41999a
install -d -m 755 $RPM_BUILD_ROOT%{bindir}
41999a
41999a
install -m 755 bin/bmsubmit.sh $RPM_BUILD_ROOT%{bindir}/bmsubmit
41999a
install -m 755 bin/bminstall.sh  $RPM_BUILD_ROOT%{bindir}/bminstall
41999a
install -m 755 bin/bmjava.sh  $RPM_BUILD_ROOT%{bindir}/bmjava
41999a
install -m 755 bin/bmcheck.sh  $RPM_BUILD_ROOT%{bindir}/bmcheck
41999a
41999a
for f in bmsubmit bmjava bminstall bmcheck; do
41999a
cat > $RPM_BUILD_ROOT%{_bindir}/${f} << EOF
41999a
#!/bin/sh
41999a
41999a
export BYTEMAN_HOME=/usr/share/byteman
41999a
export JAVA_HOME=/usr/lib/jvm/java
41999a
41999a
\$BYTEMAN_HOME/bin/${f} \$*
41999a
EOF
41999a
done
41999a
41999a
chmod 755 $RPM_BUILD_ROOT%{_bindir}/*
41999a
41999a
for m in bmunit dtest install sample submit; do
41999a
  ln -s %{_javadir}/byteman/byteman-${m}.jar $RPM_BUILD_ROOT%{homedir}/lib/byteman-${m}.jar
41999a
done
41999a
41999a
# Create contrib/jboss-module-system structure since bminstall expects it
41999a
# for the -m option.
41999a
install -d -m 755 $RPM_BUILD_ROOT%{homedir}/contrib
41999a
install -d -m 755 $RPM_BUILD_ROOT%{homedir}/contrib/jboss-modules-system
41999a
ln -s %{_javadir}/byteman/byteman-jboss-modules-plugin.jar $RPM_BUILD_ROOT%{homedir}/contrib/jboss-modules-system/byteman-jboss-modules-plugin.jar
41999a
41999a
ln -s %{_javadir}/byteman/byteman.jar $RPM_BUILD_ROOT%{homedir}/lib/byteman.jar
41999a
41999a
%files -f .mfiles
41999a
%{homedir}/lib/byteman.jar
41999a
%{homedir}/lib/byteman-install.jar
41999a
%{homedir}/lib/byteman-sample.jar
41999a
%{homedir}/lib/byteman-submit.jar
41999a
%{homedir}/contrib/*
41999a
%{bindir}/*
41999a
%{_bindir}/*
41999a
%doc README
41999a
%license docs/copyright.txt
41999a
41999a
%files javadoc -f .mfiles-javadoc
41999a
%license docs/copyright.txt
41999a
41999a
%files rulecheck-maven-plugin -f .mfiles-rulecheck-maven-plugin
41999a
%license docs/copyright.txt
41999a
41999a
%files bmunit -f .mfiles-bmunit
41999a
%license docs/copyright.txt
41999a
%{homedir}/lib/byteman-bmunit.jar
41999a
41999a
%files dtest -f .mfiles-dtest
41999a
%license docs/copyright.txt
41999a
%{homedir}/lib/byteman-dtest.jar
41999a
41999a
%changelog
41999a
* Wed Jul 18 2018 Severin Gehwolf <sgehwolf@redhat.com> - 4.0.4-2
41999a
- Rebuild with java-11-openjdk.
41999a
41999a
* Tue Jul 10 2018 Severin Gehwolf <sgehwolf@redhat.com> - 4.0.4-1
41999a
- Update to latest upstream 4.0.4 release.
41999a
- Split junit-dependent packages into sub-packages:
41999a
  byteman-dtest, byteman-bmunit
41999a
- Fix automatically generated requirements:
41999a
  - ASM is BR-only and bundled.
41999a
  - java-headless >= 1:1.9 would get generated, but byteman 4.x
41999a
    runs on JDK 8 too (would even work for JDK 6)
41999a
41999a
* Tue Jul 03 2018 Severin Gehwolf <sgehwolf@redhat.com> - 4.0.3-1
41999a
- Update to latest upstream 4.0.3 release.
41999a
41999a
* Mon Jul 02 2018 Severin Gehwolf <sgehwolf@redhat.com> - 4.0.2-1
41999a
- Update to latest upstream 4.0.2 release.
41999a
- Adds support for modular JDKs.
41999a
41999a
* Wed May 16 2018 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.6-6
41999a
- Add maven-javadoc-plugin as BR. Fix versions of bundled
41999a
  libs.
41999a
41999a
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.6-5
41999a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
41999a
41999a
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.6-4
41999a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
41999a
41999a
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.6-3
41999a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
41999a
41999a
* Fri Dec 09 2016 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.6-2
41999a
- Add BRs, maven-plugin-bundle, maven-source-plugin and
41999a
  maven-plugin-plugin, fixing FTBFS.
41999a
- Resolves: RHBZ#1402998
41999a
41999a
* Mon Jun 13 2016 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.6-1
41999a
- Update to latest upstream release.
41999a
41999a
* Mon Mar 14 2016 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.4-2
41999a
- Enable some tests during build
41999a
- Fix generated requires by filtering requires for bundled libs.
41999a
- Split maven plugin into separate package.
41999a
41999a
* Thu Feb 18 2016 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.4-1
41999a
- Update to latest upstream 3.0.4 release.
41999a
41999a
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.4.1-8
41999a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
41999a
41999a
* Thu Aug 06 2015 gil cattaneo <puntogil@libero.it> 2.1.4.1-7
41999a
- Fix FTBFS rhbz#1239392
41999a
- Remove duplicate files
41999a
- Introduce license macro
41999a
41999a
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.4.1-6
41999a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
41999a
41999a
* Fri Feb 27 2015 Michal Srb <msrb@redhat.com> - 2.1.4.1-5
41999a
- Fix FTBFS
41999a
- Rebuild to generate new metadata
41999a
41999a
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.4.1-4
41999a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
41999a
41999a
* Fri Apr 18 2014 Marek Goldmann <mgoldman@redhat.com> - 2.1.4.1-3
41999a
- Rebuilding for objectweb-asm update, RHBZ#1083570
41999a
41999a
* Fri Mar 28 2014 Michael Simacek <msimacek@redhat.com> - 2.1.4.1-2
41999a
- Use Requires: java-headless rebuild (#1067528)
41999a
41999a
* Fri Feb 14 2014 Marek Goldmann <mgoldman@redhat.com> - 2.1.4.1-1
41999a
- Upstream release 2.1.4.1
41999a
41999a
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.2-2
41999a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
41999a
41999a
* Thu Jul 04 2013 Marek Goldmann <mgoldman@redhat.com> - 2.1.2-1
41999a
- Upstream release 2.1.2
41999a
41999a
* Wed Jun  5 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.0.4-5
41999a
- Remove tools.jar from dependencyManagement
41999a
41999a
* Wed May 29 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-4
41999a
- New guidelines
41999a
41999a
* Thu Apr 25 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-3
41999a
- Fixes to the launch scripts
41999a
41999a
* Wed Apr 24 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-2
41999a
- Added bmsubmit, bminstall and bmjava scripts, RHBZ#951560
41999a
41999a
* Thu Feb 21 2013 Marek Goldmann <mgoldman@redhat.com> - 2.0.4-1
41999a
- Upstream release 2.0.4
41999a
- Switched to Maven
41999a
- Bundling java_cup and objectweb-asm (fpc#226)
41999a
41999a
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-6
41999a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
41999a
41999a
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-5
41999a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
41999a
41999a
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-4
41999a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
41999a
41999a
* Tue Sep 20 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.2-3
41999a
- Removed binary files from src.rpm
41999a
41999a
* Mon Sep 19 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.2-2
41999a
- Cleaned spec file
41999a
41999a
* Wed Jul 27 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.2-1
41999a
- Upstream release: 1.5.2
41999a
41999a
* Thu Jul 21 2011 Marek Goldmann <mgoldman@redhat.com> 1.5.1-1
41999a
- Initial packaging
41999a