[bacula/f16] Remove fedora-usermgmt

Simone Caronni slaanesh at fedoraproject.org
Tue Jan 24 10:09:48 UTC 2012


commit addb41ab38819098d376eaa4a80623181e5c3e72
Author: Simone Caronni <negativo17 at gmail.com>
Date:   Tue Jan 24 11:09:28 2012 +0100

    Remove fedora-usermgmt

 bacula.spec |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/bacula.spec b/bacula.spec
index 5cdf860..ea943a5 100644
--- a/bacula.spec
+++ b/bacula.spec
@@ -1,4 +1,5 @@
-%bcond_without	fedora
+%global uid 133
+%global username bacula
 
 Name:			bacula
 Version:		5.0.3
@@ -131,8 +132,8 @@ Group:			System Environment/Daemons
 Requires:		bacula-director = %{version}-%{release}
 Requires:		bacula-common = %{version}-%{release}
 Requires:		logwatch
-Requires(pre):		fedora-usermgmt
-Requires(postun):	fedora-usermgmt
+Requires(pre):		shadow-utils
+Requires(postun):	shadow-utils
 %if 0%{?fedora} >= 16 || 0%{?rhel} > 6
 Requires(post):		systemd-sysv
 Requires(post):		systemd-units
@@ -696,9 +697,10 @@ if [ "$1" = 0 ]; then
 fi
 
 %pre common
-/usr/sbin/fedora-groupadd 33 -r bacula &>/dev/null || :
-/usr/sbin/fedora-useradd  33 -r -s /sbin/nologin -d /var/spool/bacula -M \
-	-c 'Bacula Backup System' -g bacula bacula &>/dev/null || :
+getent group %username >/dev/null || groupadd -g %uid -r %username &>/dev/null || :
+getent passwd %username >/dev/null || useradd -u %uid -r -s /sbin/nologin \
+	-d /var/spool/bacula -M -c 'Bacula Backup System' -g %username %username &>/dev/null || :
+exit 0
 
 %post storage-mysql
 /usr/sbin/alternatives --install /usr/sbin/bcopy bacula-sd /usr/sbin/bcopy.mysql 50 \
@@ -727,6 +729,11 @@ if [ "$1" = 0 ]; then
 	/usr/sbin/alternatives --remove bacula-sd /usr/sbin/bcopy.postgresql
 fi
 
+%postun common
+test "$1" != 0 || userdel %username &>/dev/null || :
+test "$1" != 0 || groupdel %username &>/dev/null || :
+exit 0
+
 %if 0%{?fedora} >= 16 || 0%{?rhel} > 6
 
 %post client
@@ -1106,9 +1113,12 @@ fi
 
 
 %changelog
-* Mon Fri Jan 20 2012 Simone Caronni <negativo17 at gmail.com> - 5.0.3-20
+* Tue Jan 24 2012 Simone Caronni <negativo17 at gmail.com> - 5.0.3-20
 - Fix rhbz#728693 and rhbz#726147.
 - Remove bacula-docs BuildRequires.
+- Remove fedora-usermgmt dependency, static id 133 already defined as in:
+  `cat /usr/share/doc/setup-2.8.36/uidgid | grep bacula`
+  Upgrades still keep the old uid/gid.
 
 * Wed Jan 11 2012 Simone Caronni <negativo17 at gmail.com> - 5.0.3-19
 - Add devel subpackage.


More information about the scm-commits mailing list