Blob Blame History Raw
%global commit befb850dbc72b117ad6bebabee314e7d41b97183
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name:		abrt-java-connector
Version:	1.0.6
Release:	12%{?dist}
Summary:	JNI Agent library converting Java exceptions to ABRT problems

Group:		System Environment/Libraries
License:	GPLv2+
URL:		https://github.com/jfilak/abrt-java-connector
Source0:	https://github.com/jfilak/%{name}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz

#Patch0001:	0001-Update-the-spec-file.patch
Patch0002:	0002-Encapsulate-all-jthread_map-calls-inside-critical-se.patch
Patch0003:	0003-Add-thread-stress-test.patch
Patch0004:	0004-Make-thread-stress-test-more-robust.patch
Patch0005:	0005-Unify-reason-message-format.patch
Patch0006:	0006-Adapt-tests-to-the-recent-changes-in-formats.patch
Patch0007:	0007-Add-tests-for-reason-message-shortening.patch
Patch0008:	0008-Fix-a-bug-in-testdriver.patch
Patch0009:	0009-Add-support-for-changing-log-directory.patch
Patch0010:	0010-Make-log-output-disabled-by-default.patch
Patch0011:	0011-Add-support-for-journald-and-syslog.patch
Patch0012:	0012-Completely-disable-logging-in-ThreadStressTest.patch
Patch0013:	0013-Make-ThreadStressTest-configurable.patch
Patch0014:	0014-Add-an-abstract-to-README.patch
Patch0015:	0015-Check-error-codes-of-jvmti-functions.patch
Patch0016:	0016-Use-the-last-frame-s-class-path-for-executable.patch
Patch0017:	0017-Provide-Arch-specific-StressTest-configuration.patch
Patch0018:	0018-Fix-arch-specific-outputs.patch
#Patch0019:	0019-Update-the-spec-file.patch
Patch0020:	0020-Use-the-main-class-URL-for-executable.patch
Patch0021:	0021-Add-documentation-for-executable-option.patch
Patch0022:	0022-Exception-callback-code-optimizations.patch
Patch0023:	0023-Do-not-enter-critical-section-if-not-necessary.patch
Patch0024:	0024-Do-not-report-exceptions-caught-by-native-methods.patch
Patch0025:	0025-Update-the-missing-class-test.patch
Patch0026:	0026-Surround-all-JNI-calls-in-try-catch-all-block.patch
Patch0027:	0027-Do-not-ship-own-reporting-workflow-definitions.patch
#Patch0028:	0028-Remove-the-workflow-files-from-the-spec-file.patch
Patch0029:	0029-Speed-up-ExceptionCatch-event-callback.patch
Patch0030:	0030-Add-an-utility-for-stack-trace-analysis.patch
Patch0031:	0031-Hook-the-stack-trace-analysis-tool-in-post-create.patch
#Patch0032:	0032-Add-abrt-action-analyze-java-to-the-spec-file.patch
Patch0033:	0033-Add-test-for-analysis-tool.patch
Patch0034:	0034-Use-satyr-for-calculation-of-the-duplicates-hashes.patch
Patch0035:	0035-Add-a-manual-page-for-the-analysis-tool.patch
#Patch0036:	0036-Add-the-analysis-tool-s-manual-page-to-the-spec-file.patch
#Patch0037:	0037-Add-build-requires-for-the-analysis-tool.patch
Patch0038:	0038-Speed-up-thread-start-end-processing.patch
#Patch0039:	0039-Update-the-spec-file.patch
Patch0040:	0040-Fix-a-pair-of-defects-uncovered-by-coverity.patch
Patch0041:	0041-Make-sure-that-agent_onload-and-agent_onunload-are-p.patch
Patch0042:	0042-Add-a-test-for-multiple-calls-of-Agent_OnLoad.patch
Patch0043:	0043-Add-test-results-for-Linux-aarch64.patch
Patch0044:	0044-Add-test-results-for-Linux-ppc64le.patch
Patch0045:	0045-Update-Linux-aarch64-tests-for-rhel-7.1.patch
Patch0046:	0046-Install-the-agent-lib-to-non-arch-specific-directory.patch
#Patch0047:	0047-Update-the-spec-file.patch
Patch0048:	0048-Clearly-state-that-tests-cannot-be-run-under-root.patch
Patch0049:	0049-Update-tests-for-rhel-7.4.patch
Patch0050:	0050-Fix-a-deadlock-in-RemoteTest.patch
Patch0051:	0051-Support-test-suite-output-files-for-multiple-Java-ve.patch
Patch0052:	0052-Adapt-the-test-suite-to-Java-1.8.patch
Patch0053:	0053-Decrease-the-tested-memory-limits-because-of-failure.patch
Patch0054:	0054-Adapt-the-arm-test-outputs-to-java-1.8.patch
Patch0055:	0055-Update-the-test-results.patch
Patch0056:	0056-Update-the-test-results.patch
Patch0057:	0057-Disable-ClassNotFoundException-test-again.patch
Patch0058:	0058-Update-test-results-in-run_test.log.in.patch
Patch0059:	0059-add-test-outputs-for-java-1.7.patch
Patch0060:	0060-Update-tests-for-rhel-7.4-for-java-1.7.patch

# git is need for '%%autosetup -S git' which automatically applies all the
# patches above. Please, be aware that the patches must be generated
# by 'git format-patch'
BuildRequires:	git

BuildRequires:	cmake
BuildRequires:	satyr-devel
BuildRequires:	libreport-devel
BuildRequires:	abrt-devel
BuildRequires:	java-1.7.0-openjdk-devel
BuildRequires:	systemd-devel
BuildRequires:	gettext

Requires:	abrt >= 2.1.11-3


%description
JNI library providing an agent capable to process both caught and uncaught
exceptions and transform them to ABRT problems


%prep
# http://www.rpm.org/wiki/PackagerDocs/Autosetup
# Default '__scm_apply_git' is 'git apply && git commit' but this workflow
# doesn't allow us to create a new file within a patch, so we have to use
# 'git am' (see /usr/lib/rpm/macros for more details)
%define __scm_apply_git(qp:m:) %{__git} am
%autosetup -S git -n %{name}-%{commit}


%build
%cmake -DCMAKE_BUILD_TYPE=Release
make %{?_smp_mflags}


%install
make install DESTDIR=%{buildroot}

%files
%doc LICENSE README AUTHORS
%config(noreplace) %{_sysconfdir}/libreport/plugins/bugzilla_format_java.conf
%config(noreplace) %{_sysconfdir}/libreport/plugins/bugzilla_formatdup_java.conf
%config(noreplace) %{_sysconfdir}/libreport/events.d/java_event.conf
%{_bindir}/abrt-action-analyze-java
%{_mandir}/man1/abrt-action-analyze-java.1*
%{_mandir}/man5/java_event.conf.5*
%{_mandir}/man5/bugzilla_format_java.conf.5*
%{_mandir}/man5/bugzilla_formatdup_java.conf.5*

# Applications may use a single subdirectory under/usr/lib.
# http://www.pathname.com/fhs/pub/fhs-2.3.html#PURPOSE22
#
# Java does not support multilib.
# https://fedorahosted.org/fesco/ticket/961
%{_prefix}/lib/abrt-java-connector

%check
# Run tests as root can broke your system.
# Tests are trying to modify system files in order
# to get permission denied exceptions.
# https://bugzilla.redhat.com/show_bug.cgi?id=1259309
if [ "_0" != "_$(id -u)" ]; then
    make test || {
        cat Testing/Temporary/LastTest.log
        exit 69
    }
else
    echo "Cannot run tests under root user.";
    exit 1;
fi




%changelog
* Mon May 15 2017 Matej Habrnal <mhabrnal@redhat.com> - 1.0.6-12
- Fix the tests cannot be run under root
- Resolves: #1259309

* Tue May  9 2017 Matej Habrnal <mhabrnal@redhat.com> - 1.0.6-11
- update test outputs to work with java-1.8.0-openjdk
- Resolves: #1436776

* Tue Feb 14 2017 Matej Habrnal <mhabrnal@redhat.com> - 1.0.6-10
- Clearly state that tests cannot be run under root
- Resolves: #1259309

* Thu Jul 02 2015 Jakub Filak <jfilak@redhat.com> - 1.0.6-9
- Install the library to /usr/lib/abrt-java-connector on all arches
- Resolves: #1238578

* Mon Sep 22 2014 Jakub Filak <jfilak@redhat.com> - 1.0.6-8
- Adapt aarch64 test results to RHEL7.1
- Resolves: #1133406

* Thu Aug 21 2014 Jakub Filak <jfilak@redhat.com> - 1.0.6-7
- Add test results for Linux-ppc64le
- Resolves: #1125469

* Tue Feb 11 2014 Jakub Filak <jfilak@redhat.com> - 1.0.6-6
- Make sure that agent_onload and agent_onunload are processed only once
- Add test results for Linux-aarch64
- Resolves: #1044756, #1063322

* Fri Jan 31 2014 Jakub Filak <jfilak@redhat.com> - 1.0.6-5
- Fix a pair of defects uncovered by covscan
- Resolves: #1056584

* Tue Jan 28 2014 Daniel Mach <dmach@redhat.com> - 1.0.6-4
- Mass rebuild 2014-01-24

* Wed Jan 22 2014 Jakub Filak <jfilak@redhat.com> - 1.0.6-3
- Mark stack trace with remote paths as not-reportable
- Do not provide own reporting workflows
- Code optimization
- Do not report exception caught by native functions
- Use the last frame class path for executable
- Gracefully handle JVMTI errors
- Add an abstract to README
- Add support for journald and syslog
- Make log output disabled by default
- Add support for changing log directory
- Fix a race condition causing a crash of JVM
- Related: #1051198
- Resolves: #1051483, #1054720, #1054737, #1055581

* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.0.6-2
- Mass rebuild 2013-12-27

* Tue Oct 01 2013 Jakub Filak <jfilak@redhat.com> - 1.0.6-1
- Fix a deadlock in GC start callback
- Disable experimental features in production releases
- Resolves: #1012827

* Tue Jul 30 2013 Jakub Filak <jfilak@redhat.com> - 1.0.5-1
- Provide a proper configuration for libreport

* Thu Jul 18 2013 Jakub Filak <jfilak@redhat.com> - 1.0.4-1
- Stop creating an empty log file
- Resolves: #985776

* Tue Jul 16 2013 Jakub Filak <jfilak@redhat.com> - 1.0.3-1
- Fix tests on arm

* Tue Jul 09 2013 Jakub Filak <jfilak@redhat.com> - 1.0.2-1
- Do not crash on empty command line options

* Mon Jul 08 2013 Jakub Filak <jfilak@redhat.com> - 1.0.1-1
- Fix tests on ppc and s390 on both 32 and 64 bit

* Thu Jun 27 2013 Jakub Filak <jfilak@redhat.com> - 1.0.0-1
- Publicly releasable version

* Mon Jun 03 2013 Jakub Filak <jfilak@redhat.com> - 0.1.2-1
- Start versioning library
- Drop build dependency on abrt-devel

* Mon Jun 03 2013 Jakub Filak <jfilak@redhat.com> - 0.1.1-2
- Provide ABRT configuration

* Mon Jun 03 2013 Jakub Filak <jfilak@redhat.com> - 0.1.1-1
- New release

* Fri May 31 2013 Jakub Filak <jfilak@redhat.com> - 0.1.0-3
- Build with the library name same as the package name

* Fri May 31 2013 Jakub Filak <jfilak@redhat.com> - 0.1.0-2
- Build with ABRT enabled

* Fri May 31 2013 Jakub Filak <jfilak@redhat.com> - 0.1.0-1
- Initial version