]> git.pld-linux.org Git - packages/clamav.git/commitdiff
- revert user changes
authorpascalek <pascalek@pld-linux.org>
Sat, 17 May 2003 07:11:40 +0000 (07:11 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    clamav.spec -> 1.35

clamav.spec

index af17557caf1a584a5ffee151a098bf79badb8442..5b2414f51d51e6042a69b66e0326dc5d8702c845 100644 (file)
@@ -16,7 +16,6 @@ Requires:     %{name}-database
 BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: zlib-devel
-Requires(pre): user-clamav
 Requires(post,preun):  /sbin/chkconfig
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -119,6 +118,26 @@ install etc/clamav.conf $RPM_BUILD_ROOT%{_sysconfdir}/
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre
+if [ -n "`getgid clamav`" ]; then
+        if [ "`getgid clamav`" != "43" ]; then
+                echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
+                exit 1
+        fi
+else
+       echo "Adding group clamav GID=43"
+        /usr/sbin/groupadd -g 43 -r -f clamav
+fi
+if [ -n "`id -u clamav 2>/dev/null`" ]; then
+       if [ "`id -u clamav`" != "43" ]; then
+               echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
+               exit 1
+       fi
+else
+       echo "Adding user clamav UID=43"
+       /usr/sbin/useradd -u 43 -r -d /tmp  -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
+fi
+
 %post
 touch %{_var}/log/%{name}.log && chmod 640 %{_var}/log/%{name}.log && chown clamav %{_var}/log/%{name}.log
 /sbin/chkconfig --add clamd
@@ -136,6 +155,14 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del clamd
 fi
 
+%postun
+if [ "$1" = "0" ]; then
+       echo "Removing user clamav"
+       /usr/sbin/userdel clamav
+       echo "Removing group clamav"
+       /usr/sbin/groupdel clamav
+fi
+
 %post   libs -p /sbin/ldconfig
 %postun libs -p /sbin/ldconfig
 
This page took 0.028926 seconds and 4 git commands to generate.