Hello community,

here is the log from the commit of package munge for openSUSE:Factory checked 
in at 2017-02-14 00:48:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/munge (Old)
 and      /work/SRC/openSUSE:Factory/.munge.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "munge"

Changes:
--------
--- /work/SRC/openSUSE:Factory/munge/munge.changes      2017-01-17 
14:35:43.574860398 +0100
+++ /work/SRC/openSUSE:Factory/.munge.new/munge.changes 2017-02-14 
00:48:23.454323837 +0100
@@ -1,0 +2,28 @@
+Tue Feb  7 17:27:18 UTC 2017 - [email protected]
+
+- Fix BuildRequires for zlib-devel.
+
+-------------------------------------------------------------------
+Wed Feb  1 20:13:51 UTC 2017 - [email protected]
+
+- Replace group/user add macros with function calls.
+- Make sure we update the user/group of files/directories correctly
+  when updating - in case they have changed.
+
+-------------------------------------------------------------------
+Tue Jan  3 16:18:13 UTC 2017 - [email protected]
+
+- Use user 'munge', group 'munge' for systemd and user 'daemon', group 'root' 
+  for non-systemd by setting the appropriate macros '%munge_u' and '%munge_g'.
+- Create user/group munge if they don't exist.
+- Add 'BuildRequires: libbz2-devel'
+- Fix typo.
+
+-------------------------------------------------------------------
+Tue Jan  3 15:56:53 UTC 2017 - [email protected]
+
+- Add 'Recommends: munge' to libmunge:
+  This library requires the munge service to run on the
+  local system to be useful.
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ munge.spec ++++++
--- /var/tmp/diff_new_pack.RhhNyp/_old  2017-02-14 00:48:25.086093482 +0100
+++ /var/tmp/diff_new_pack.RhhNyp/_new  2017-02-14 00:48:25.090092917 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package munge
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -15,11 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
 %if 0%{?suse_version} >= 1210
 %define have_systemd 1
 %endif
 %define lversion 2
 
+%if 0%{?have_systemd}
+ %define munge_g %name
+ %define munge_u %name
+%else
+ %define munge_g root
+ %define munge_u daemon
+%endif
+
 Name:           munge
 Version:        0.5.12
 Release:        0
@@ -31,10 +40,15 @@
 Source1:        baselibs.conf
 Source2:        sysconfig.munge
 Patch0:         Make-SUSE-specific-adjustments.patch
+BuildRequires:  libbz2-devel
 BuildRequires:  openssl-devel
 BuildRequires:  pkgconfig
 BuildRequires:  zlib-devel
-BuildRequires:  libbz2-devel
+%if 0%{?suse_version} <= 1140
+Requires(pre):  pwdutils
+%else
+Requires(pre):  shadow
+%endif
 %if 0%{?have_systemd}
 BuildRequires: systemd
 BuildRequires: systemd-rpm-macros
@@ -58,6 +72,7 @@
 %package -n lib%{name}%{lversion}
 Summary:        Libraries for applications using MUNGE
 Group:          System/Libraries
+Recommends:     munge
 
 %description -n lib%{name}%{lversion}
 A shared library for applications using the MUNGE authentication service.
@@ -94,12 +109,12 @@
    test -f %{buildroot}/lib/systemd/system/munge.service && \
       rm -f %{buildroot}/lib/systemd/system/munge.service
    rm -f %{buildroot}/%{_tmpfilesdir}/munge.conf
-   sed -i 's/USER="munge"/USER="daemon"/g' %{buildroot}/%{_initrddir}/%{name}
+   sed -i 's/USER="munge"/USER="%munge_u"/g' %{buildroot}/%{_initrddir}/%{name}
    %{__ln_s} -f %{_initrddir}/%{name} %{buildroot}%{_sbindir}/rc%{name}
 %else
-  sed -i 's/User=munge/User=daemon/g' %{buildroot}%{_unitdir}/munge.service
-  sed -i 's/Group=munge/Group=root/g' %{buildroot}%{_unitdir}/munge.service
-  sed -i 's/munge \+munge/daemon root/g' %{buildroot}%{_tmpfilesdir}/munge.conf
+  sed -i 's/User=munge/User=%munge_u/g' %{buildroot}%{_unitdir}/munge.service
+  sed -i 's/Group=munge/Group=%munge_g/g' %{buildroot}%{_unitdir}/munge.service
+  sed -i 's/munge \+munge/%munge_u %munge_g/g' 
%{buildroot}%{_tmpfilesdir}/munge.conf
   %{__rm} -f %{buildroot}/%{_initddir}/munge
   %{__ln_s} %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
 %endif
@@ -108,11 +123,15 @@
 
 %postun -n lib%{name}%{lversion} -p /sbin/ldconfig
 
-
-%if 0%{?have_systemd}
 %pre
+%if 0%{?have_systemd}
 %service_add_pre munge.service
 %endif
+%define munge_home "%_localstatedir%_rundir/munge"
+%define munge_descr "MUNGE authentication service"
+getent group %munge_g >/dev/null || groupadd -r %munge_g
+getent passwd %munge_u >/dev/null || useradd -r -g %munge_g -d %munge_home -s 
/bin/false -c %munge_descr %munge_u
+exit 0
 
 %preun
 %if 0%{?have_systemd}
@@ -121,7 +140,14 @@
 %stop_on_removal munge
 %endif
 
+%define fixperm() [ -e %1 ] && /bin/chown %munge_u:%munge_g %1
 %postun
+if [ $1 -eq 1 ]
+then
+    %{fixperm %{_localstatedir}/log/munge}
+    %{fixperm %{_localstatedir}/log/munge/munged.log}
+    %{fixperm %{_localstatedir}/run/munge}
+fi
 %if 0%{?have_systemd}
 %service_del_postun munge.service
 %else
@@ -129,14 +155,19 @@
 %insserv_cleanup
 %endif
 
-
 %post
+if [ $1 -eq 1 ]
+then
+    %{fixperm %{_localstatedir}/log/munge}
+    %{fixperm %{_localstatedir}/log/munge/munged.log}
+    %{fixperm %{_localstatedir}/run/munge}
+fi
 if [ ! -e %{_sysconfdir}/munge/munge.key -a -c /dev/urandom ]; then
   /bin/dd if=/dev/urandom bs=1 count=1024 \
     >%{_sysconfdir}/munge/munge.key 2>/dev/null
-  /bin/chown daemon %{_sysconfdir}/munge/munge.key
-  /bin/chmod 0400 %{_sysconfdir}/munge/munge.key
 fi
+/bin/chown %munge_u:%munge_g %{_sysconfdir}/munge/munge.key
+/bin/chmod 0400 %{_sysconfdir}/munge/munge.key
 %if 0%{?have_systemd}
 %service_add_post munge.service
 systemd-tmpfiles --create %{_tmpfilesdir}/munge.conf
@@ -157,9 +188,9 @@
 %doc README
 %doc TODO
 %doc doc/*
-%dir %attr(0700,daemon,root) %config %{_sysconfdir}/munge
-%dir %attr(0711,daemon,root) %config %{_localstatedir}/lib/munge
-%dir %attr(0700,daemon,root) %config %{_localstatedir}/log/munge
+%dir %attr(0700,%munge_u,%munge_g) %config %{_sysconfdir}/munge
+%dir %attr(0711,%munge_u,%munge_g) %config %{_localstatedir}/lib/munge
+%dir %attr(0700,%munge_u,%munge_g) %config %{_localstatedir}/log/munge
 %{_bindir}/*
 %{_sbindir}/*
 %{_mandir}/*[^3]/*
@@ -168,7 +199,7 @@
 %{_unitdir}/munge.service
 %{_tmpfilesdir}/munge.conf
 %else
-%attr(0755,daemon,root) %dir %{_localstatedir}/run/%{name}
+%attr(0755,%munge_u,%munge_g) %dir %{_localstatedir}/run/%{name}
 %{_initddir}/munge
 %endif
 


Reply via email to