[rhnmd] Rebase to rhnmd-5.3.15-1.fc18 in rawhide.

Miroslav Suchý msuchy at fedoraproject.org
Wed Mar 6 15:40:04 UTC 2013


commit 8e8e56c8de0824f022f64257ac8de7cd7560f139
Author: Miroslav Suchý <msuchy at redhat.com>
Date:   Wed Mar 6 16:39:57 2013 +0100

    Rebase to rhnmd-5.3.15-1.fc18 in rawhide.

 .gitignore |    1 +
 rhnmd.spec |   94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 sources    |    2 +-
 3 files changed, 89 insertions(+), 8 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b8d60f1..053d6b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 /rhnmd-5.3.8.tar.gz
 /rhnmd-5.3.10.tar.gz
 /rhnmd-5.3.11.tar.gz
+/rhnmd-5.3.15.tar.gz
diff --git a/rhnmd.spec b/rhnmd.spec
index a781a4a..d6419fc 100644
--- a/rhnmd.spec
+++ b/rhnmd.spec
@@ -8,8 +8,8 @@ Summary:        Red Hat Network Monitoring Daemon
 Name:           rhnmd
 URL:            https://fedorahosted.org/spacewalk
 Source0:        https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version:        5.3.11
-Release:        2%{?dist}
+Version:        5.3.15
+Release:        1%{?dist}
 License:        GPLv2
 BuildArch:      noarch
 Group:          System Environment/Daemons
@@ -20,6 +20,25 @@ Requires:       openssh
 BuildRequires:  sysconfig
 %else
 Requires:       openssh-server
+%if 0%{?fedora}
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(post): systemd-sysv
+Requires(preun): systemd-sysv
+Requires(post): systemd-units
+Requires(preun): systemd-units
+BuildRequires: systemd-units
+%else
+Requires(post): chkconfig
+Requires(preun): chkconfig
+# This is for /sbin/service
+Requires(preun): initscripts
+Requires(postun): initscripts
+%endif
+%endif
+%if 0%{?suse_version} >= 1210
+BuildRequires: systemd
+%{?systemd_requires}
 %endif
 BuildRequires:  pam-devel
 Obsoletes:      rhnmd.i386 < 5.3.0-5
@@ -28,6 +47,7 @@ Provides:       rhnmd.i386 = %{version}
 Provides:       rhnmd.x86_64 = %{version}
 
 Requires(post): /usr/sbin/semanage, /sbin/restorecon
+Requires(preun): /usr/sbin/semanage
 
 %description
 rhnmd enables secure ssh-based communication between the monitoring
@@ -44,17 +64,31 @@ rm -rf $RPM_BUILD_ROOT
 
 mkdir -p $RPM_BUILD_ROOT%{_usr}/sbin
 mkdir -p $RPM_BUILD_ROOT%{_usr}/lib
-mkdir -p $RPM_BUILD_ROOT%{_initddir}
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{np_name}
 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/%{np_name}/.ssh
+mkdir -p $RPM_BUILD_ROOT%{_var}/lib/%{np_name}/sbin
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
 mkdir -p $RPM_BUILD_ROOT%{_libdir}
 ln -sf sshd $RPM_BUILD_ROOT%{_usr}/sbin/rhnmd
+
 %if 0%{?suse_version}
+%if 0%{?suse_version} >= 1210
+mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
+install -m 0644 rhnmd.service $RPM_BUILD_ROOT/%{_unitdir}/
+%else
+mkdir -p $RPM_BUILD_ROOT%{_initddir}
 install -pm 0755 rhnmd.init.SUSE $RPM_BUILD_ROOT%{_initddir}/rhnmd
+%endif
+%else
+%if 0%{?fedora}
+mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
+install -m 0644 rhnmd.service $RPM_BUILD_ROOT/%{_unitdir}/
 %else
+mkdir -p $RPM_BUILD_ROOT%{_initddir}
 install -pm 0755 rhnmd-init $RPM_BUILD_ROOT%{_initddir}/rhnmd
 %endif
+%endif
+install -pm 0755 rhnmd_create_key.sh $RPM_BUILD_ROOT%{_var}/lib/%{np_name}/sbin/
 install -pm 0644 rhnmd_config $RPM_BUILD_ROOT%{_sysconfdir}/%{np_name}/rhnmd_config
 install -pm 0600 authorized_keys $RPM_BUILD_ROOT%{_var}/lib/%{np_name}/.ssh/authorized_keys
 install -pm 0644 rhnmd-pam_config $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/rhnmd
@@ -80,6 +114,9 @@ if getent passwd %{np_name} >/dev/null && [ -d /home/nocpulse ]; then
   rm -rf %{_var}/lib/nocpulse/bin
   rm -rf %{_var}/lib/nocpulse/var
 fi
+%if 0%{?suse_version} >= 1210
+%service_add_pre rhnmd.service
+%endif
 
 %post
 # keygen is done in init script. Doing this in %post is bad for using this rpm in appliances.
@@ -89,7 +126,12 @@ then
     /sbin/runuser -s /bin/bash -c "/usr/bin/ssh-keygen -q -t dsa -N '' -f %{identity}" - %{np_name}
 fi
 %endif
-/sbin/chkconfig --add rhnmd
+%if 0%{?suse_version} >= 1210
+%service_add_post rhnmd.service
+%else
+if [ -f /etc/init.d/rhnmd ]; then
+    /sbin/chkconfig --add rhnmd
+fi
 /usr/sbin/semanage fcontext -a -t sshd_key_t '/var/lib/nocpulse/\.ssh/nocpulse-identity' || :
 %if 0%{?rhel} && "%rhel" < "6"
 /usr/sbin/semanage fcontext -a -t sshd_key_t '/var/lib/nocpulse/\.ssh/authorized_keys' || :
@@ -97,12 +139,32 @@ fi
 /usr/sbin/semanage fcontext -a -t ssh_home_t '/var/lib/nocpulse/\.ssh/authorized_keys' || :
 %endif
 /sbin/restorecon -rvv /var/lib/nocpulse || :
+%if 0%{?fedora}
+/usr/sbin/semanage port -l | grep -q '^ssh_port_t\b.*\btcp\b.*\b4545\b' || /usr/sbin/semanage port -a -t ssh_port_t -p tcp 4545 || :
+%endif
+%endif
 
 %preun
+%if 0%{?suse_version} >= 1210
+%service_del_preun rhnmd.service
+%else
 if [ $1 = 0 ]; then
+    %if 0%{?fedora}
+    /bin/systemctl stop rhnmd.service >/dev/null 2>&1
+    /usr/sbin/semanage port -d -t ssh_port_t -p tcp 4545 || :
+    %else
     /sbin/service rhnmd stop > /dev/null 2>&1
-    /sbin/chkconfig --del rhnmd
+    %endif
+    if [ -f /etc/init.d/rhnmd ]; then
+        /sbin/chkconfig --del rhnmd
+    fi
 fi
+%endif
+
+%if 0%{?suse_version} >= 1210
+%postun
+%service_del_preun rhnmd.service
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -112,15 +174,33 @@ rm -rf $RPM_BUILD_ROOT
 %config(noreplace) %{_sysconfdir}/pam.d/rhnmd
 %dir %attr(-, %{np_name},%{np_name}) %{_var}/lib/%{np_name}
 %dir %attr(700, %{np_name},%{np_name}) %{_var}/lib/%{np_name}/.ssh
+%dir %attr(-, %{np_name},%{np_name}) %{_var}/lib/%{np_name}/sbin
 %config(noreplace) %attr(-, %{np_name},%{np_name}) %{_var}/lib/%{np_name}/.ssh/authorized_keys
+%{_var}/lib/%{np_name}/sbin/*
 %{_usr}/sbin/rhnmd
 %config(noreplace) %{_sysconfdir}/%{np_name}/rhnmd_config
+%if 0%{?fedora} || 0%{?suse_version} >= 1210
+%{_unitdir}/rhnmd.service
+%else
 %{_initddir}/rhnmd
+%endif
 %doc LICENSE
 
 %changelog
-* Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 5.3.11-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+* Fri Jan 04 2013 Jan Pazdziora 5.3.15-1
+- We may need to define the port 4545 as ours to use.
+- The daemon does success for us.
+
+* Mon Dec 10 2012 Michael Mraka <michael.mraka at redhat.com> 5.3.14-1
+- added missing pid file
+- fixed service description
+
+* Mon Dec 10 2012 Michael Mraka <michael.mraka at redhat.com> 5.3.13-1
+- use rhnmd.service on Fedora
+
+* Sun Nov 11 2012 Michael Calmer <mc at suse.de> 5.3.12-1
+- create rhnmd.service for systemd
+- no use of /var/lock/subsys/ anymore
 
 * Tue Aug 28 2012 Tomas Kasparek <tkasparek at redhat.com> 5.3.11-1
 - 852386 - Independent SElinux policy for rhel5
diff --git a/sources b/sources
index d90596f..9f1901d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-39d6fc5ea5b37fe4dc1eb67050825f3b  rhnmd-5.3.11.tar.gz
+d694bc9f3e765b8a9b8c57cde6b9e569  rhnmd-5.3.15.tar.gz


More information about the scm-commits mailing list