2 # - Add polish info mail templates
3 # - move amavis part of tmpwatch configuration from tmpwatch.spec
5 %include /usr/lib/rpm/macros.perl
6 Summary: A Mail Virus Scanner with SpamAssassin support - daemon
7 Summary(pl.UTF-8): Antywirusowy skaner poczty elektronicznej z obsługą SpamAssasina - demon
13 Group: Applications/Mail
14 Source0: http://www.ijs.si/software/amavisd/%{name}-%{version}.tar.xz
15 # Source0-md5: 54e13e9804358982a05624900c9d0d6e
17 Source2: %{name}.tmpfiles
18 Source3: %{name}.tmpwatch
19 Patch0: %{name}-config.patch
20 Patch1: %{name}-tools-dbdir.patch
21 URL: http://www.ijs.si/software/amavisd/
22 BuildRequires: rpm-perlprov
23 BuildRequires: rpmbuild(macros) >= 1.304
24 BuildRequires: tar >= 1:1.22
25 Requires(post,preun): /sbin/chkconfig
26 Requires(postun): /usr/sbin/groupdel
27 Requires(postun): /usr/sbin/userdel
28 Requires(pre): /bin/id
29 Requires(pre): /usr/bin/getgid
30 Requires(pre): /usr/sbin/groupadd
31 Requires(pre): /usr/sbin/useradd
32 Requires: /usr/lib/sendmail
33 Requires: perl-Archive-Tar
34 Requires: perl-Archive-Zip >= 1.14
35 Requires: perl-Convert-BinHex
36 Requires: perl-Convert-TNEF
37 Requires: perl-Convert-UUlib >= 1.05
38 Requires: perl-IO-Compress
39 Requires: perl-MIME-tools
40 Requires: perl-Net-Server >= 0.93
41 Requires: perl-Time-HiRes >= 1.49
42 Requires: perl-Unix-Syslog
44 Requires: rc-scripts >= 0.4.1.23
46 Suggests: amavisd-milter >= 1.5.0
63 Suggests: perl-Authen-SASL
66 # required already by perl-Mail-SpamAssassin
67 #Suggests: perl-DB_File
68 #Suggests: perl-IO-Socket-INET6
69 # required when doing SQL lookups
71 #Suggests: perl-DBD-mysql
72 Suggests: perl-Digest-MD5
73 Suggests: perl-Mail-DKIM >= 0.31
74 Suggests: perl-Mail-SpamAssassin > 3.3.0
85 Provides: group(amavis)
86 Provides: user(amavis)
90 Obsoletes: amavisd-daemon
91 Obsoletes: amavisd-exim
92 Obsoletes: amavisd-new-exim
93 Obsoletes: amavisd-new-postfix
94 Obsoletes: amavisd-new-qmail
95 Obsoletes: amavisd-postfix
96 Obsoletes: amavisd-qmail
97 Conflicts: amavis-stats <= 0.1.12
98 Conflicts: postfix < 2.7.0
99 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101 %define _tmpwatchdir /etc/tmpwatch
102 %define schemadir /usr/share/openldap/schema
105 AMaViS is a script that interfaces a mail transport agent (MTA) with
106 one or more virus scanners and SpamAssasin. This is daemonized version
109 %description -l pl.UTF-8
110 AMaViS to skrypt pośredniczący pomiędzy agentem transferu poczty (MTA)
111 a jednym lub więcej programów antywirusowych i SpamAssasinem. Wersja
114 %package -n openldap-schema-amavisd-new
115 Summary: Amavisd-new LDAP schema
116 Summary(pl.UTF-8): Schemat LDAP dla amavisd-new
117 Group: Networking/Daemons
118 Requires: openldap-servers
120 %description -n openldap-schema-amavisd-new
121 This package contains LDAP schema for use with amavisd-new.
123 %description -n openldap-schema-amavisd-new -l pl.UTF-8
124 Ten pakiet zawiera schemat LDAP do używania z amavisd-new.
132 rm -rf $RPM_BUILD_ROOT
133 install -d $RPM_BUILD_ROOT{%{_var}/spool/amavis/{runtime,virusmails,db}} \
134 $RPM_BUILD_ROOT{%{_var}/run/amavisd,/etc/rc.d/init.d,%{_sbindir}} \
135 $RPM_BUILD_ROOT{/etc/tmpfiles.d,%{_tmpwatchdir}}
137 install -p amavisd $RPM_BUILD_ROOT%{_sbindir}
138 install -p amavisd-agent $RPM_BUILD_ROOT%{_sbindir}
139 install -p amavisd-nanny $RPM_BUILD_ROOT%{_sbindir}
140 install -p amavisd-release $RPM_BUILD_ROOT%{_sbindir}
141 install -p amavisd-submit $RPM_BUILD_ROOT%{_sbindir}
142 cp -p amavisd.conf $RPM_BUILD_ROOT%{_sysconfdir}/amavisd.conf
144 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/amavisd
145 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_tmpwatchdir}/%{name}.conf
147 install %{SOURCE2} $RPM_BUILD_ROOT/etc/tmpfiles.d/%{name}.conf
149 install -Dp LDAP.schema $RPM_BUILD_ROOT%{schemadir}/amavisd-new.schema
152 rm -rf $RPM_BUILD_ROOT
155 %groupadd -g 116 -r -f amavis
156 %useradd -u 97 -r -d %{_var}/spool/amavis -s /bin/false -c "Anti Virus Checker" -g amavis amavis
159 if [ "$1" = "0" ]; then
165 /sbin/chkconfig --add amavisd
166 %service amavisd restart "Amavisd daemon"
169 if [ "$1" = "0" ]; then
170 %service amavisd stop
171 /sbin/chkconfig --del amavisd
174 %post -n openldap-schema-amavisd-new
175 %openldap_schema_register %{schemadir}/amavisd-new.schema
176 %service -q ldap restart
178 %postun -n openldap-schema-amavisd-new
179 if [ "$1" = "0" ]; then
180 %openldap_schema_unregister %{schemadir}/amavisd-new.schema
181 %service -q ldap restart
185 %defattr(644,root,root,755)
186 %doc AAAREADME.first INSTALL RELEASE_NOTES README_FILES/* test-messages
187 %attr(755,root,root) %{_sbindir}/amavisd
188 %attr(755,root,root) %{_sbindir}/amavisd-agent
189 %attr(755,root,root) %{_sbindir}/amavisd-nanny
190 %attr(755,root,root) %{_sbindir}/amavisd-release
191 %attr(755,root,root) %{_sbindir}/amavisd-submit
192 %attr(754,root,root) /etc/rc.d/init.d/amavisd
193 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/amavisd.conf
194 %config(noreplace) %verify(not md5 mtime size) %{_tmpwatchdir}/%{name}.conf
195 %config(noreplace) %verify(not md5 mtime size) /etc/tmpfiles.d/%{name}.conf
196 %attr(750,amavis,amavis) %{_var}/spool/amavis
197 %attr(750,amavis,amavis) %{_var}/run/amavisd
199 %files -n openldap-schema-amavisd-new
200 %defattr(644,root,root,755)
201 %{schemadir}/*.schema