diff --git a/httpd_cgi_graphs.conf b/httpd_cgi_graphs.conf
index bef5228..7a3787e 100644
--- a/httpd_cgi_graphs.conf
+++ b/httpd_cgi_graphs.conf
@@ -38,3 +38,24 @@
+
+
+# Uncomment following lines to require authentication:
+
+#
+# AuthUserFile /etc/munin/munin-htpasswd
+# AuthName "Munin"
+# AuthType Basic
+# Require valid-user
+# # This next part requires mod_expires to be enabled.
+# #
+# # We could use around here, but I want it to be
+# # as evident as possible that you either have to load mod_expires _or_
+# # you coment out/remove these lines.
+# #
+# # Set the default expiery time for files 5 minutes 10 seconds from
+# # their creation (modification) time. There are probably new files by
+# # that time.
+# ExpiresActive On
+# ExpiresDefault M310
+#
diff --git a/httpd_cron_graphs.conf b/httpd_cron_graphs.conf
index 15e1ac2..ed34bf8 100644
--- a/httpd_cron_graphs.conf
+++ b/httpd_cron_graphs.conf
@@ -26,3 +26,24 @@
+
+
+# Uncomment following lines to require authentication:
+
+#
+# AuthUserFile /etc/munin/munin-htpasswd
+# AuthName "Munin"
+# AuthType Basic
+# Require valid-user
+# # This next part requires mod_expires to be enabled.
+# #
+# # We could use around here, but I want it to be
+# # as evident as possible that you either have to load mod_expires _or_
+# # you coment out/remove these lines.
+# #
+# # Set the default expiery time for files 5 minutes 10 seconds from
+# # their creation (modification) time. There are probably new files by
+# # that time.
+# ExpiresActive On
+# ExpiresDefault M310
+#
diff --git a/munin.spec b/munin.spec
index 79d9c82..a5211ef 100644
--- a/munin.spec
+++ b/munin.spec
@@ -1,6 +1,6 @@
Name: munin
Version: 2.0.49
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Network-wide resource monitoring tool
License: GPLv2
URL: http://munin-monitoring.org/
@@ -63,6 +63,10 @@ BuildRequires: perl-Carp
BuildRequires: systemd
BuildRequires: firewalld-filesystem
%endif
+%if 0%{?rhel} <= 7
+BuildRequires: java-devel
+BuildRequires: jpackage-utils
+%endif
# Munin server requires
Requires: %{name}-common = %{version}
@@ -137,10 +141,12 @@ Provides: munin-async = %{version}-%{release}
Obsoletes: munin-async < 2.0.39-4
Provides: munin-netip-plugins = %{version}-%{release}
Obsoletes: munin-netip-plugins < 2.0.39-4
+%if 0%{?rhel} >= 8 || 0%{?fedora} >= 28
Provides: munin-java-plugins = %{version}-%{release}
Obsoletes: munin-java-plugins < 2.0.39-2
Provides: munin-plugins-java = %{version}-%{release}
Obsoletes: munin-plugins-java < 2.0.45-2
+%endif
%description node
@@ -182,6 +188,20 @@ This package contains common files that are used by both the server (munin)
and node (munin-node) packages.
+%if 0%{?rhel} <= 7
+%package plugins-java
+Summary: Java plugins for Munin resource monitoring
+Requires: %{name}-node = %{version}
+BuildArch: noarch
+Provides: munin-java-plugins = %{version}-%{release}
+Obsoletes: munin-java-plugins < 2.0.39-2
+
+
+%description plugins-java
+Additional Java plugins for munin-node.
+%endif
+
+
%package plugins-ruby
Summary: Ruby plugins for Munin resource monitoring
Requires: %{name}-node = %{version}
@@ -265,6 +285,9 @@ sed -i -e '
s,^PYTHON := \(.*\),PYTHON := /usr/bin/python2,;
%endif
s,^RUBY := \(.*\),RUBY := /usr/bin/ruby,;
+%if 0%{?rhel} <= 7
+ s,^JAVALIBDIR = \(.*\),JAVALIBDIR = $(DESTDIR)%{_javadir},;
+%endif
s,^PERLLIB = \(.*\),PERLLIB = $(DESTDIR)%{perl_vendorlib},;
s,^HOSTNAME := \(.*\),HOSTNAME := localhost.localdomain,;
s,^PLUGINUSER := \(.*\),PLUGINUSER := munin,;
@@ -286,10 +309,16 @@ cp %SOURCE18 .
%build
+%if 0%{?rhel} <= 7
+export CLASSPATH=plugins/javalib/org/munin/plugin/jmx:$CLASSPATH
+%endif
make CONFIG=Makefile.config
%install
+%if 0%{?rhel} <= 7
+export CLASSPATH=plugins/javalib/org/munin/plugin/jmx:$CLASSPATH
+%endif
make CONFIG=Makefile.config \
DESTDIR=%{buildroot} \
install
@@ -663,6 +692,7 @@ fi
%config(noreplace) %ghost %{_sysconfdir}/munin/munin-htpasswd
%config(noreplace) %ghost %{_sysconfdir}/httpd/conf.d/munin.conf
%config(noreplace) %ghost %{_sysconfdir}/httpd/conf.d/munin-cgi.conf
+%config(noreplace) %ghost %{_localstatedir}/www/html/munin/.htaccess
%files node
@@ -692,6 +722,7 @@ fi
%dir %{_datadir}/munin
%{_datadir}/munin/munin-async
%{_datadir}/munin/plugins/
+%exclude %{_datadir}/munin/plugins/jmx_
%exclude %{_datadir}/munin/plugins/tomcat_
%exclude %{_datadir}/munin/plugins/munin_stats
%{perl_vendorlib}/Munin/Node
@@ -724,6 +755,13 @@ fi
%endif
+%if 0%{?rhel} <= 7
+%files plugins-java
+%{_javadir}/munin-jmx-plugins.jar
+%{_datadir}/munin/plugins/jmx_
+%endif
+
+
%files plugins-ruby
%{_datadir}/munin/plugins/tomcat_
@@ -755,6 +793,10 @@ fi
%changelog
+* Sat Jul 13 2019 Kim B. Heino - 2.0.49-3
+- rhbz#1721384: Mark .htaccess as ghost, include it to example config files
+- Re-add munin-plugins-java subpackage for rhel6 and rhel7
+
* Fri May 31 2019 Jitka Plesnikova - 2.0.49-2
- Perl 5.30 rebuild