[smstools/f13/master] - added if clause for deciding between uucp and dialout group (BZ#605211)

Patrick Charles François Ernzer pcfe at fedoraproject.org
Thu Jan 20 18:45:52 UTC 2011


commit 54641bf90251776c14f3e6d7660cbdba71071ce8
Author: Patrick C. F. Ernzer <pcfe at redhat.com>
Date:   Thu Jan 20 20:45:43 2011 +0200

    - added if clause for deciding between uucp and dialout group (BZ#605211)

 smstools.spec |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/smstools.spec b/smstools.spec
index a2621a3..65589b4 100644
--- a/smstools.spec
+++ b/smstools.spec
@@ -2,7 +2,7 @@
 
 Name:           smstools
 Version:        3.1.5
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Tools to send and receive short messages through GSM modems or mobile phones
 
 License:        GPLv2+
@@ -64,7 +64,17 @@ rm -rf $RPM_BUILD_ROOT
 
 %pre
 getent group smstools >/dev/null || groupadd -r smstools
-getent passwd smstools >/dev/null || useradd -r -d /var/lib/smstools -m -g smstools -G uucp smstools
+
+# on older releases we need to use uucp (here it seems only the uucp group exists)
+# on newer releases it's dialout (here it seems both groups exist)
+# it would be more elegant to base my if clause on the udev rules instead of the group existence
+if [ `getent group dialout` ]
+  then
+    getent passwd smstools >/dev/null || useradd -r -d /var/lib/smstools -m -g smstools -G dialout smstools
+  else
+    getent passwd smstools >/dev/null || useradd -r -d /var/lib/smstools -m -g smstools -G uucp smstools
+fi
+
 
 %post
 if [ $1 -eq 0 ]; then
@@ -110,6 +120,9 @@ fi
 %attr(0750,smstools,smstools) %dir %{_varlogdir}/smsd_stats
 
 %changelog
+* Thu Jan 20 2011 Patrick C. F. Ernzer <smstools.spec at pcfe.net> 3.1.5-5
+- added if clause for deciding between uucp and dialout group (BZ#605211)
+
 * Thu Oct 15 2009 Patrick C. F. Ernzer <smstools.spec at pcfe.net> 3.1.5-4
 - added flag -m to useradd
 


More information about the scm-commits mailing list