Blame SPECS/byteman.spec

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