]> git.pld-linux.org Git - packages/bacula.git/commitdiff
- use %useradd/%groupadd macros auto/ac/bacula-1_36_3-1
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 1 May 2005 17:31:30 +0000 (17:31 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bacula.spec -> 1.26

bacula.spec

index 77d4c0aac65079fc863d8bae98d6371e25cf4c07..f77b2fdff09316148079f6a0fabe3331398ed330 100644 (file)
@@ -35,6 +35,7 @@ BuildRequires:        ncurses-devel
 BuildRequires: openssl-devel
 BuildRequires: pkgconfig
 BuildRequires: readline-devel
+BuildRequires: rpmbuild(macros) >= 1.202
 BuildRequires: sed >= 4.0
 BuildRequires: sqlite-devel
 BuildRequires: wxGTK2-devel >= 2.4.0
@@ -433,28 +434,14 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
 rm -rf $RPM_BUILD_ROOT
 
 %pre common
-if [ -n "`getgid bacula`" ]; then
-       if [ "`getgid bacula`" != "136" ]; then
-               echo "Error: group bacula doesn't have gid=136. Correct this before installing bacula." 1>&2
-               exit 1
-       fi
-else
-       /usr/sbin/groupadd -g 136 -r -f bacula
-fi
-if [ -n "`id -u bacula 2>/dev/null`" ]; then
-       if [ "`id -u bacula`" != "136" ]; then
-               echo "Error: user bacula doesn't have uid=136. Correct this before installing bacula." 1>&2
-               exit 1
-       fi
-else
-       /usr/sbin/useradd -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula 1>&2
-fi
+%groupadd -P %{name}-common -g 136 -r -f bacula
+%useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
 
 %post common
 echo "Updating bacula passwords and names..."
 cd /etc/bacula
 for f in *-password ; do
-       if ! [ -s $f ] ; then
+       if [ ! -s $f ] ; then
                openssl rand -base64 33 > $f
        fi
        p=`cat $f`
This page took 0.106342 seconds and 4 git commands to generate.