[rhnmd] Rebase to rhnmd-5.3.10-1.fc16 in rawhide.
Miroslav Suchý
msuchy at fedoraproject.org
Mon Jan 2 15:04:07 UTC 2012
commit 19b117e02eddfd5087eb6bcf92912520910d5a59
Author: Miroslav Suchý <msuchy at redhat.com>
Date: Mon Jan 2 16:04:01 2012 +0100
Rebase to rhnmd-5.3.10-1.fc16 in rawhide.
.gitignore | 1 +
rhnmd.spec | 36 ++++++++++++++++++++++++++++++++++--
sources | 2 +-
3 files changed, 36 insertions(+), 3 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 40b7e9f..4dc6f20 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/rhnmd-5.3.8.tar.gz
+/rhnmd-5.3.10.tar.gz
diff --git a/rhnmd.spec b/rhnmd.spec
index 6779bb5..c99159c 100644
--- a/rhnmd.spec
+++ b/rhnmd.spec
@@ -8,19 +8,27 @@ 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.8
+Version: 5.3.10
Release: 1%{?dist}
License: GPLv2
BuildArch: noarch
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires: openssh-server openssh
+Requires: openssh
+%if 0%{?suse_version}
+# make chkconfig work during build
+BuildRequires: sysconfig
+%else
+Requires: openssh-server
+%endif
BuildRequires: pam-devel
Obsoletes: rhnmd.i386 < 5.3.0-5
Obsoletes: rhnmd.x86_64 < 5.3.0-5
Provides: rhnmd.i386 = %{version}
Provides: rhnmd.x86_64 = %{version}
+Requires(post): /usr/sbin/semanage, /sbin/restorecon
+
%description
rhnmd enables secure ssh-based communication between the monitoring
scout and the monitored host.
@@ -42,7 +50,11 @@ mkdir -p $RPM_BUILD_ROOT%{_var}/lib/%{np_name}/.ssh
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}
+install -pm 0755 rhnmd.init.SUSE $RPM_BUILD_ROOT%{_initddir}/rhnmd
+%else
install -pm 0755 rhnmd-init $RPM_BUILD_ROOT%{_initddir}/rhnmd
+%endif
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
@@ -50,9 +62,15 @@ install -pm 0644 rhnmd-pam_config $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/rhnmd
%pre
if [ $1 -eq 1 ] ; then
getent group %{np_name} >/dev/null || groupadd -r %{np_name}
+%if !0%{?suse_version}
getent passwd %{np_name} >/dev/null || \
useradd -r -g %{np_name} -d %{_var}/lib/%{np_name} -c "NOCpulse user" %{np_name}
/usr/bin/passwd -l %{np_name} >/dev/null
+%else
+ # SUSE sshd do not allow to login into locked accounts
+ getent passwd %{np_name} >/dev/null || \
+ useradd -r -g %{np_name} -d %{_var}/lib/%{np_name} -c "NOCpulse user" %{np_name} -s /bin/bash
+%endif
exit 0
fi
# Old NOCpulse packages has home in /home/nocpulse.
@@ -64,11 +82,17 @@ if getent passwd %{np_name} >/dev/null && [ -d /home/nocpulse ]; then
fi
%post
+# keygen is done in init script. Doing this in %post is bad for using this rpm in appliances.
+%if !0%{?suse_version}
if [ ! -f %{identity} ]
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
+/usr/sbin/semanage fcontext -a -t sshd_key_t '/var/lib/nocpulse/\.ssh/nocpulse-identity' || :
+/usr/sbin/semanage fcontext -a -t ssh_home_t '/var/lib/nocpulse/\.ssh/authorized_keys' || :
+/sbin/restorecon -rvv /var/lib/nocpulse || :
%preun
if [ $1 = 0 ]; then
@@ -81,6 +105,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root,root,-)
+%dir %{_sysconfdir}/%{np_name}
%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
@@ -91,6 +116,13 @@ rm -rf $RPM_BUILD_ROOT
%doc LICENSE
%changelog
+* Fri Oct 07 2011 Jan Pazdziora 5.3.10-1
+- 594647 - label rhnmd's files upon installation.
+
+* Fri Apr 15 2011 Jan Pazdziora 5.3.9-1
+- add nocpulse config dir to filelist (mc at suse.de)
+- build rhnmd on SUSE (mc at suse.de)
+
* Thu Mar 10 2011 Miroslav Suchý <msuchy at redhat.com> 5.3.8-1
- 538057 - add corresponding "Provides:" for the arch-specific packages
- 538057 - versioned provides, substitute tabs with spaces
diff --git a/sources b/sources
index 97a57be..51a2b2e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-fabf16b9b6f5374bb4ab9f7966e7e77d rhnmd-5.3.8.tar.gz
+ae341442bc49f3082a5ccc86b6b33a5f rhnmd-5.3.10.tar.gz
More information about the scm-commits
mailing list