From a00ed71e3767f7a67e797a729a19041984545039 Mon Sep 17 00:00:00 2001 From: radzio Date: Thu, 29 Aug 2002 18:20:05 +0000 Subject: [PATCH] - updated to 0.4.1.orig - add Patch0 (amavis-ng.patch) - add %pre and %postun scripts, which create/delete amavis group and user acount ([GU]ID=97) - STBR, test - TODO: Requires, /usr/bin/suidperl is needed by /usr/sbin/qmail-queue.amavis Changed files: amavis-ng.spec -> 1.3 --- amavis-ng.spec | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/amavis-ng.spec b/amavis-ng.spec index a1bc969..3503657 100644 --- a/amavis-ng.spec +++ b/amavis-ng.spec @@ -1,11 +1,12 @@ Summary: New generation amavis Summary(pl): Amavis nowej generacji Name: amavis-ng -Version: 0.1.3.1 +Version: 0.1.4.1.orig Release: 0 License: GPL Group: Applications/Mail -Source0: http://prdownloads.sourceforge.net/amavis/%{name}-%{version}.tar.gz +Source0: http://prdownloads.sourceforge.net/amavis/%{name}_%{version}.tar.gz +Patch0: amavis-ng.patch URL: http://amavis.sourceforge.net/ BuildRequires: perl BuildRequires: perl-devel @@ -22,10 +23,11 @@ blah blah %prep %setup -q +%patch0 -p1 %build perl Makefile.PL - +%{__make} %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT @@ -35,8 +37,40 @@ install -d $RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT +%pre +if [ -n "`getgid amavis`" ]; then + if [ "`getgid amavis`" != "97" ]; then + echo "Warning: group amavis doesn't have gid=97. Correct this before installing clamav" 1>&2 + exit 1 + fi +else + echo "adding group amavis GID=97" + /usr/sbin/groupadd -g 97 -r -f amavis +fi + +if [ -n "`id -u amavis 2>/dev/null`" ]; then + if [ "`id -u amavis`" != "97" ]; then + echo "Error: user amavis doesn't have uid=97. Correct this before installing amavis." 1>&2 + exit 1 + fi +else + echo "adding user amavis UID=97" + /usr/sbin/useradd -u 97 -r -d /var/spool/amavis -s /bin/false -c "Anti Virus Checker" -g nobody amavis 1>&2 +fi + +%postun +if [ "$1" = "0" ]; then + echo "Removing user amavis" + /usr/sbin/userdel amavis + echo "Removing group clamav" + /usr/sbin/groupdel amavis +fi + + %files %defattr(644,root,root,755) -%doc README ChangeLog +%doc README TODO %attr(755,root,root) %{_bindir}/* -%{_datadir}/%{name} +%attr(755,root,root) %{_sbindir}/* +%{_datadir}/amavis +%attr(750,amavis,amavis) /var/spool/amavis -- 2.43.0