Blame SPECS/prometheus-jmx-exporter.spec

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