Blame SPECS/prometheus-jmx-exporter.spec

0f112a
%global version_id parent
0f112a
%global upstream_name jmx_exporter
0f112a
%global simple_client_version 0.6.0
0f112a
0f112a
# Filter requires for the Java Agent as deps are shaded within.
0f112a
%global jmx_or_client io\\.prometheus\\.jmx:.*|io\\.prometheus:simpleclient.*|org\\.yaml:snakeyaml.*
0f112a
%global mvn_requires_filter .*mvn\\(%{jmx_or_client}\\)
4e9e78
%global java_headless_filter \\(?.*java-headless.*\\)?
4e9e78
%global __requires_exclude ^%{java_headless_filter}|%{mvn_requires_filter}$
0f112a
0f112a
Name:           prometheus-jmx-exporter
0f112a
Version:        0.12.0
4e9e78
Release:        7%{?dist}
0f112a
Summary:        Prometheus JMX Exporter
0f112a
0f112a
License:        ASL 2.0
0f112a
URL:            https://github.com/prometheus/jmx_exporter/
0f112a
0f112a
Source0:        https://github.com/prometheus/jmx_exporter/archive/%{version_id}-%{version}.tar.gz
0f112a
Patch1:         properly_rewrite_namespace.patch
ee38a3
Patch2:         0001-Fix-CVE-2017-18640-and-add-a-test.patch
0f112a
0f112a
BuildArch:  noarch
4e9e78
Requires: %{name}-jdk-binding
4e9e78
Suggests: %{name}-openjdk11 = %{version}-%{release}
0f112a
0f112a
BuildRequires: maven-local
0f112a
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
0f112a
BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin)
0f112a
BuildRequires: mvn(org.apache.maven.plugins:maven-shade-plugin)
0f112a
BuildRequires: mvn(org.yaml:snakeyaml)
0f112a
BuildRequires: mvn(io.prometheus:simpleclient)
0f112a
BuildRequires: mvn(io.prometheus:simpleclient_hotspot)
0f112a
BuildRequires: mvn(io.prometheus:simpleclient_common)
0f112a
BuildRequires: mvn(io.prometheus:simpleclient_httpserver)
0f112a
0f112a
Provides: bundled(io.prometheus.jmx:collector) = %{version}
0f112a
Provides: bundled(io.prometheus:simpleclient) = %{simple_client_version}
ee38a3
Provides: bundled(org.yaml:snakeyaml) = 1.26
0f112a
Provides: bundled(biz.source_code:base64coder) = 2010.12.19
0f112a
Provides: bundled(commons-codec:commons-codec) = 1.11
0f112a
Provides: bundled(io.prometheus:simpleclient_hotspot) = %{simple_client_version}
0f112a
Provides: bundled(io.prometheus:simpleclient_httpserver) = %{simple_client_version}
0f112a
Provides: bundled(io.prometheus:simpleclient_common) = %{simple_client_version}
0f112a
0f112a
%description
0f112a
JMX to Prometheus exporter: a collector that can be configured to scrape
0f112a
and expose MBeans of a JMX target. This exporter is intended to be run as
0f112a
a Java Agent, exposing a HTTP server and serving metrics of the local JVM.
0f112a
4e9e78
%package openjdk8
4e9e78
Summary: OpenJDK 1.8.0 binding for %{name}
4e9e78
Provides: %{name}-jdk-binding = %{version}-%{release}
4e9e78
Conflicts: %{name}-jdk-binding
4e9e78
Requires: %{name} = %{version}-%{release}
4e9e78
Requires: java-1.8.0-headless
4e9e78
4e9e78
%description openjdk8
4e9e78
OpenJDK 1.8.0 binding package for %{name}
4e9e78
4e9e78
%package openjdk11
4e9e78
Summary: OpenJDK 11 binding for %{name}
4e9e78
Provides: %{name}-jdk-binding = %{version}-%{release}
4e9e78
Conflicts: %{name}-jdk-binding
4e9e78
Requires: %{name} = %{version}-%{release}
4e9e78
Requires: java-11-headless
4e9e78
4e9e78
%description openjdk11
4e9e78
OpenJDK 11 binding package for %{name}
4e9e78
4e9e78
%package openjdk17
4e9e78
Summary: OpenJDK 17 binding for %{name}
4e9e78
Provides: %{name}-jdk-binding = %{version}-%{release}
4e9e78
Conflicts: %{name}-jdk-binding
4e9e78
Requires: %{name} = %{version}-%{release}
4e9e78
Requires: java-17-headless
4e9e78
4e9e78
%description openjdk17
4e9e78
OpenJDK 17 binding package for %{name}
4e9e78
0f112a
%prep
0f112a
%setup -q -n %{upstream_name}-%{version_id}-%{version}
0f112a
0f112a
%patch1 -p1
ee38a3
%patch2 -p1
0f112a
0f112a
%pom_remove_plugin org.vafer:jdeb jmx_prometheus_httpserver
0f112a
%pom_remove_plugin org.apache.maven.plugins:maven-failsafe-plugin jmx_prometheus_javaagent
0f112a
%pom_remove_plugin org.codehaus.mojo:build-helper-maven-plugin jmx_prometheus_javaagent
0f112a
0f112a
# Don't install artefacts from the reactor but the java agent itself. This is because
0f112a
# the agent needs deps from the reactor but shades them.
0f112a
%mvn_package "io.prometheus.jmx:jmx_prometheus_httpserver" __noinstall
0f112a
%mvn_package "io.prometheus.jmx:parent" __noinstall
0f112a
0f112a
# Don't depend on obsolete sonatype-oss-parent
0f112a
# See: https://github.com/prometheus/jmx_exporter/issues/420
0f112a
%pom_xpath_remove pom:project/pom:parent
0f112a
0f112a
%build
ee38a3
# ignore spurious test errors with: -Dmaven.test.failure.ignore=true
ee38a3
%mvn_build -j
0f112a
0f112a
%install
0f112a
%mvn_install
0f112a
0f112a
%files -f .mfiles
0f112a
%license LICENSE
0f112a
%doc NOTICE
0f112a
4e9e78
%files openjdk8
4e9e78
# empty files for the binding package
4e9e78
4e9e78
%files openjdk11
4e9e78
# empty files for the binding package
4e9e78
4e9e78
%files openjdk17
4e9e78
# empty files for the binding package
4e9e78
0f112a
%changelog
4e9e78
* Tue Aug 31 2021 Severin Gehwolf <sgehwolf@redhat.com> - 0.12.0-7
4e9e78
- Add JDK binding sub-packages so that the package
4e9e78
  can be used with either JDK 11 or JDK 17.
4e9e78
- Add requirement on base package for the JDK binding packages.
4e9e78
ee38a3
* Mon Apr 20 2020 Severin Gehwolf <sgehwolf@redhat.com> - 0.12.0-6
ee38a3
- Fix CVE-2017-18640 by using updated snakeyaml.
ee38a3
0f112a
* Wed Oct 09 2019 Severin Gehwolf <sgehwolf@redhat.com> - 0.12.0-5
0f112a
- rebuilt
0f112a
0f112a
* Wed Oct 09 2019 Severin Gehwolf <sgehwolf@redhat.com> - 0.12.0-4
0f112a
- rebuilt
0f112a
0f112a
* Wed Oct 09 2019 Severin Gehwolf <sgehwolf@redhat.com> - 0.12.0-3
0f112a
- Advertise correct bundled snakeyaml version (1.25)
0f112a
0f112a
* Tue Sep 03 2019 Severin Gehwolf <sgehwolf@redhat.com> - 0.12.0-2
0f112a
- Add patch to properly name-space included dependencies
0f112a
0f112a
* Mon Aug 12 2019 Severin Gehwolf <sgehwolf@redhat.com> - 0.12.0-1
0f112a
- Initial package.
0f112a