Search
j0ke.net Open Build Service
>
Projects
>
home:netmax
:
monitoring
>
cs-nrpe
> cs-nrpe.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File cs-nrpe.spec of Package cs-nrpe
# # spec file for package cs-nrpe # # Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # #!BuildIgnore: post-build-checks %define pkg_name nrpe %define my_name cs-%{pkg_name} %define pkg_version 4.1.0 %define pkg_prefix /opt/%{my_name} %define nrpe_port 5666 %define nrpe_user cs-monitoring %define nrpe_group cs-monitoring %define nnmmsg logger -t %{name}/rpm Obsoletes: nagios-nrpe Obsoletes: nrpe Name: %{my_name} Version: %{pkg_version} Release: 0 Summary: NRPE Agent License: GPLv2 Group: Application/System URL: https://github.com/NagiosEnterprises/nrpe Source: %{pkg_name}-%{pkg_version}.tar.gz Patch0: %{pkg_name}-%{pkg_version}_config.patch Patch1: %{pkg_name}-%{pkg_version}_startup.patch BuildRoot: %{_tmppath}/%{my_name}-%{pkg_version}-root # For reconfiguration BuildRequires: autoconf, automake, libtool BuildRequires: gcc BuildRequires: openssl, openssl-devel BuildRequires: checkpolicy %if 0%{?suse_version} || 0%{?sles_version} BuildRequires: pwdutils Requires: pwdutils %endif %if 0%{?rhel} > 5 BuildRequires: selinux-policy-devel %endif %if 0%{?fedora} > 17 || 0%{?rhel} > 6 BuildRequires: systemd-units %endif %if ( 0%{?fedora} && 0%{?fedora} < 28 ) || ( 0%{?rhel} && 0%{?rhel} < 8 ) BuildRequires: tcp_wrappers-devel %endif %if 0%{?suse_version} BuildRequires: tcpd-devel %endif Requires(pre): %{_sbindir}/useradd, %{_sbindir}/usermod %if 0%{?el6} || 0%{?suse_version} < 1500 || 0%{?sles_version} < 15 Requires(preun): /sbin/service, /sbin/chkconfig Requires(post): /sbin/chkconfig, /sbin/service Requires(postun): /sbin/service %if 0%{?!sles_version} Requires: initscripts %endif %else Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %endif %description Nagios Remote Plugin Executor (NRPE) %prep %setup -q -n %{pkg_name}-%{pkg_version} %patch0 -b .config %patch1 -b .startup %build CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="%{?__global_ldflags}" \ %configure \ --prefix=%{pkg_prefix} \ --with-init-dir=%{_initrddir} \ --with-nrpe-port=%{nrpe_port} \ --with-nrpe-user=%{nrpe_user} \ --with-nrpe-group=%{nrpe_group} \ --with-piddir=/run \ --bindir=%{_sbindir} \ --libdir=/doesnt/matter/ \ --libexecdir=%{_prefix}/lib/nagios/plugins \ --datadir=%{_datadir}/nagios \ --sysconfdir=%{_sysconfdir}/nagios \ --localstatedir=%{_localstatedir}/run/ \ --enable-command-args %__make %{?_smp_mflags} nrpe %install ##%__make DESTDIR=%{buildroot} install-daemon install-config install-inetd %__install -D -m 755 src/nrpe %{buildroot}%{_sbindir}/nrpe %__install -D -m 644 startup/default-xinetd %{buildroot}%{_sysconfdir}/xinetd.d/nrpe %__install -D -m 644 startup/default-socket %{buildroot}/usr/lib/systemd/system/nrpe.socket %__install -D -m 644 startup/default-socket-svc %{buildroot}/usr/lib/systemd/system/nrpe.service %__install -D -m 644 sample-config/nrpe.cfg %{buildroot}%{_sysconfdir}/nagios/nrpe.cfg %pre # Create `nagios' group on the system if necessary if grep ^%{nrpe_user}: /etc/group; then : # group already exists else /usr/sbin/groupadd %{nrpe_group} || %nnmmsg Unexpected error adding group "%{nrpe_group}". Aborting install process. fi # Create `%{npre_user}' user on the system if necessary if id %{nrpe_user} ; then : # user already exists else /usr/sbin/useradd -r -d /var/log/nagios -s /bin/sh -c "%{nrpe_user}" -g %{nrpe_group} %{nrpe_user} || \ %nnmmsg Unexpected error adding user "%{nrpe_user}". Aborting install process. fi if grep ^nrpe /etc/services; then : # service entry exists else echo -e "nrpe\t5666/tcp\t# nagios nrpe" >> /etc/services fi %post if [ -d /etc/sudoers.d ] ; then cat > /etc/sudoers.d/50_%{nrpe_user} << EOF %{nrpe_user} ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/,/usr/lib/nagios/plugins/contrib/,/usr/lib64/nagios/plugins/,/usr/lib64/nagios/plugins/contrib/,/usr/local/libexec/nagios/ Defaults:%{nrpe_user} !requiretty Defaults:%{nrpe_user} !env_keep EOF chmod 0440 /etc/sudoers.d/50_%{nrpe_user} fi %postun %files %defattr(0644,root,root) %if 0%{?!sles_version} %license LICENSE.md %endif %doc CHANGELOG.md README.md SECURITY.md THANKS LEGAL README.SSL.md %defattr(0755,root,root) %{_sbindir}/nrpe %defattr(0644,root,root) %config(noreplace) %{_sysconfdir}/nagios/nrpe.cfg %config(noreplace) %{_sysconfdir}/xinetd.d/nrpe /usr/lib/systemd/system/nrpe.* %changelog