%global alt_name nagios-plugin-jvm-deadlocks %global nagiospluginsdir %{_libdir}/nagios/plugins # No binaries in this package %global debug_package %{nil} Name: nagios-plugins-jvm-deadlocks Version: 0.0.1 Release: 1%{?dist} Summary: Nagios plugin to check Java deadlocks Group: Applications/System License: GPLv3+ URL: https://github.com/melmorabity/nagios-plugin-jvm-deadlocks/ Source0: https://github.com/melmorabity/%{alt_name}/archive/%{version}/%{name}-%{version}.tar.gz # Fix build with commons-cli 1.2, as provided by EPEL (see # https://github.com/melmorabity/nagios-plugin-jvm-deadlocks/commit/db4ce3f) Patch0: %{name}-0.0.1-commons_cli_1.2.patch BuildRequires: maven-local BuildRequires: mvn(com.sun:tools) BuildRequires: mvn(commons-cli:commons-cli) BuildRequires: mvn(org.apache.commons:commons-exec) BuildRequires: mvn(org.apache.commons:commons-lang3) # Required for tools.jar library Requires: java-devel >= 1:1.8.0 Requires: nagios-common %description %{summary}. %prep %setup -q -n %{alt_name}-%{version} %if 0%{?rhel} %patch0 -p1 -b .commons_cli_1.2 %endif # Disable wrapper script generation %pom_remove_plugin :appassembler-maven-plugin # https://fedora-java.github.io/howto/latest/#error_scope_systemx %pom_remove_dep com.sun:tools %pom_add_dep com.sun:tools %build %mvn_build -j %install %mvn_install # %%jpackage_script generate scripts in %%{_bindir} %jpackage_script com.github.melmorabity.nagios_plugin_jvm_deadlocks.Main "" "" commons-cli:commons-exec:commons-lang3:%{name} check_jvm_deadlocks false install -dm 0755 $RPM_BUILD_ROOT%{nagiospluginsdir}/ mv $RPM_BUILD_ROOT%{_bindir}/check_jvm_deadlocks $RPM_BUILD_ROOT%{nagiospluginsdir}/ %files -f .mfiles %doc README.md %license LICENSE %{nagiospluginsdir}/check_jvm_deadlocks %{_javadir}/%{name}/ %changelog * Sun Jan 14 2018 Mohamed El Morabity - 0.0.1-1 - Initial RPM release