Documentation to build the amavisd-new from src rpm

Florin Portase portase.florin at medianetork.ro
Fri Jun 29 11:52:15 CEST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here is a working spec for RHEL 6

~~~~~~~
#
  # spec file for package amavisd-new
  #
#

Name:           amavisd-new
Summary:        High-Performance E-Mail Virus Scanner
License:        GPL-2.0+
Group:          Productivity/Networking/Security
Version:        2.7.0
Release:        3.el6
Url:            http://www.ijs.si/software/amavisd/
#BuildRequires:  sendmail
#BuildRequires:  sendmail-devel
Requires:       gzip bzip2 unarj zoo sharutils file
Requires:       perl-Compress-Zlib perl-Convert-UUlib perl-IO-stringy
Requires:       perl-MIME-tools perl-MailTools perl-Archive-Tar
Requires:       perl-Convert-TNEF perl-Archive-Zip perl-Net-Server
#Requires:      perl-spamassassin
Requires:       perl-Digest-MD5 perl-BerkeleyDB perl-Mail-DKIM
perl-Unix-Syslog
#Requires:       smtp_daemon
#BuildRequires:  systemd
Source0:         %{name}-%{version}.tar.gz
Source2:        amavisd
Patch1:         amavis_required_score.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Packager:       Florin Portase <florin.portase at cz.ibm.com>

%define avspool        /var/amavis
%define avdb           /var/amavis/db
%define avtmp          /var/amavis/tmp
%define avquarantine   /var/virusmails
%define avuser         amavis
%define avgroup        amavis

%description
Amavisd-new is a high-performance interface between mailer (MTA) and
content checkers: virus scanners or SpamAssassin. It talks to the MTA
via (E)SMTP, LMTP. It works with the
following MTAs:

- - postfix
- - sendmail (sendmail-milter)
- - exim


%prep
%setup -q

    sed -i "s|\$daemon_user  = 'vscan';|\$daemon_user  = '%{avuser}';|g; \
            s|\$daemon_group = 'vscan';|\$daemon_group =
'%{avgroup}';|g; \
            s|^# \$MYHOME =.*|\$MYHOME = '%{avspool}';|g; \
            s|/var/amavis/db|%{avdb}|g; \
            s|/var/virusmails|%{avquarantine}|g" amavisd.conf

-
---------------------------------------------------------------------------

%build

#
-
---------------------------------------------------------------------------

%install
mkdir -p $RPM_BUILD_ROOT/%{avquarantine}
mkdir -p $RPM_BUILD_ROOT/%{avspool}/{tmp,var}
mkdir -p $RPM_BUILD_ROOT/%{avdb}
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/%{_sbindir}

install -m 755 amavisd $RPM_BUILD_ROOT/%{_sbindir}/amavisd
install -m 755 amavisd-agent $RPM_BUILD_ROOT/%{_sbindir}/amavisd-agent
install -m 755 amavisd-nanny $RPM_BUILD_ROOT/%{_sbindir}/amavisd-nanny
#install -m 755 amavisd-release
$RPM_BUILD_ROOT/%{_sbindir}/amavisd-release
#install -m 755 p0f-analyzer.pl
$RPM_BUILD_ROOT/%{_sbindir}/p0f-analyzer.pl
install -m 644 amavisd.conf $RPM_BUILD_ROOT/etc/amavisd.conf
install -m 755 %{S:2} $RPM_BUILD_ROOT/etc/init.d/amavisd

%pre
%{_bindir}/getent group %{avgroup} || %{_sbindir}/groupadd -g 420 -r
%{avgroup} 2> /dev/null
%{_bindir}/getent passwd %{avuser} || %{_sbindir}/useradd -r -o -g
%{avgroup} -u 420 -s /bin/false -c "Vscan account" -d %{avspool}
%{avuser} 2> /dev/null

%preun
%stop_on_removal amavisd

%post

%postun
%restart_on_update amavisd
#%{insserv_cleanup}
%files
%defattr(-,root,root)
%doc AAAREADME.first LICENSE INSTALL
#%doc LDAP.ldif
#%dir /etc/openldap
#%dir /etc/openldap/schema
 %config(noreplace) /etc/init.d/amavisd
 %config(noreplace) /etc/amavisd.conf
#%config(noreplace) /etc/openldap/schema/amavisd-new.schema
%{_sbindir}/amavisd
%{_sbindir}/amavisd-agent
%{_sbindir}/amavisd-nanny

%defattr(0750,%{avuser},%{avgroup})
%dir %{avspool}
%dir %{avspool}/tmp
%dir %{avspool}/db
%dir %{avspool}/var
%dir %{avquarantine}

#%files
%defattr(0644,root,root,0755)
%doc RELEASE_NOTES
%doc README_FILES
%doc test-messages
%doc amavisd.conf-*
%doc MANIFEST TODO
%doc test-messages
#%doc %{_mandir}/man8/amavisd-milter*

%changelog


~~~~~~


On 06/28/2012 12:09 PM, Stefan Jakobs wrote:
> Anirudha Patil:
>> Hello Team,
> 
> Hi,
> 
>> I would like to build the amavisd-new from src rpm and was
>> wondering if you could assist me with any reference about
>> documentation to furnish the same.
> 
> see: https://build.opensuse.org/package/show?package=amavisd- 
> new&project=home%3Apheinlein%3Arhel
> 
>> I already have amavisd-new-2.6.4 running on RHEL4 system. [I know
>> that its not the official supported release]
>> 
>> With Regards Anirudha Patil
> 
> Regards Stefan
> 


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJP7XrPAAoJECEzxtLP+20464wH/jw4slFQbTc+f90RCltBX0n4
fYdnXWcQrqOReZ07hcxNfF1Pr4BVHAwPMNQVr0WkD2gHtKZ4z2SIAYYgyc4gnGiX
FyGwyEyFgQXYAM7xfD457cruvYHKGgeBDgcUujIDVRjLdBRwZ0YhCFUTiDUcs/YF
rPjDjI+Bt3UixcXsrNeiq/AmTCxkCflx7duHSqY6/Oo9VC9MXKGAlSjvGGJ56diB
FAHq+7jp0xNyqKxt0eWf6EMhd1VbCk8mNkvFEwK/ivPo/loyLVVRVkpxRwZxFvGP
Df4UtGQtrr4ahiXnt5V/4ty19J9bV+aRKuh/zyKkm5u5JQSr1dmgVnau3KGKZ1Y=
=6Ryr
-----END PGP SIGNATURE-----


More information about the amavis-users mailing list