- updated to 2.12.1, partial PLD merge
[packages/amavisd-new.git] / amavisd-new.spec
1 # TODO:
2 # - consider following upstream and renaming to amavis
3 # - Add polish info mail templates
4 # - move amavis part of tmpwatch configuration from tmpwatch.spec
5 #
6 Summary:        A Mail Virus Scanner with SpamAssassin support - daemon
7 Summary(pl.UTF-8):      Antywirusowy skaner poczty elektronicznej z obsługą SpamAssasina - demon
8 Name:           amavisd-new
9 Version:        2.12.1
10 Release:        1
11 Epoch:          1
12 License:        GPL
13 Group:          Applications/Mail
14 Source0:        https://gitlab.com/amavis/amavis/-/archive/v%{version}/amavis-v%{version}.tar.bz2
15 # Source0-md5:  bf62d0331f6bf11e2873be798dc26276
16 Source1:        %{name}.init
17 Source3:        %{name}.tmpwatch
18 Patch0:         %{name}-config.patch
19 Patch1:         %{name}-tools-dbdir.patch
20 URL:            https://gitlab.com/amavis/amavis/
21 BuildRequires:  rpm-perlprov
22 BuildRequires:  rpmbuild(macros) >= 1.671
23 BuildRequires:  tar >= 1:1.22
24 Requires(post,preun):   /sbin/chkconfig
25 Requires(postun):       /usr/sbin/groupdel
26 Requires(postun):       /usr/sbin/userdel
27 Requires(pre):  /bin/id
28 Requires(pre):  /usr/bin/getgid
29 Requires(pre):  /usr/sbin/groupadd
30 Requires(pre):  /usr/sbin/useradd
31 Requires:       /usr/lib/sendmail
32 Requires:       perl-Archive-Tar
33 Requires:       perl-Archive-Zip >= 1.14
34 Requires:       perl-Convert-BinHex
35 Requires:       perl-Convert-TNEF
36 Requires:       perl-Convert-UUlib >= 1.05
37 Requires:       perl-File-LibMagic
38 Requires:       perl-IO-Compress
39 Requires:       perl-MIME-tools
40 Requires:       perl-Net-LibIDN
41 Requires:       perl-Net-Server >= 0.93
42 Requires:       perl-Time-HiRes >= 1.49
43 Requires:       perl-Unix-Syslog
44 Requires:       perl-libnet
45 Requires:       rc-scripts >= 0.4.1.23
46 Requires:       sh-utils
47 Suggests:       amavisd-milter >= 1.5.0
48 #Suggests:      arc
49 #Suggests:      arj
50 Suggests:       binutils
51 Suggests:       bzip2
52 Suggests:       cabextract
53 Suggests:       clamav
54 Suggests:       cpio
55 Suggests:       dspam
56 Suggests:       freeze
57 Suggests:       gzip
58 Suggests:       lha
59 Suggests:       lzop
60 #Suggests:      melt
61 Suggests:       ncompress
62 Suggests:       nomarch
63 Suggests:       pax
64 Suggests:       perl-Authen-SASL
65 Suggests:       unarj
66 #Suggests:      unfreeze
67 # required already by perl-Mail-SpamAssassin
68 #Suggests:      perl-DB_File
69 #Suggests:      perl-IO-Socket-INET6
70 # required when doing SQL lookups
71 Suggests:       p0f
72 Suggests:       perl-Crypt-OpenSSL-RSA
73 #Suggests:      perl-DBD-mysql
74 Suggests:       perl-Digest-MD5
75 Suggests:       perl-Mail-DKIM >= 0.31
76 Suggests:       perl-Mail-SpamAssassin > 3.3.0
77 Suggests:       perl-Net-DNS
78 Suggests:       perl-Razor
79 Suggests:       perl-SAVI
80 Suggests:       perl-ldap
81 #Suggests:      rar
82 #Suggests:      ripole
83 Suggests:       rpm-utils
84 Suggests:       tnef
85 Suggests:       unrar
86 Suggests:       unzoo
87 #Suggests:      zoo
88 Provides:       group(amavis)
89 Provides:       user(amavis)
90 Obsoletes:      AMaViS
91 Obsoletes:      amavis
92 Obsoletes:      amavisd
93 Obsoletes:      amavisd-daemon
94 Obsoletes:      amavisd-exim
95 Obsoletes:      amavisd-new-exim
96 Obsoletes:      amavisd-new-postfix
97 Obsoletes:      amavisd-new-qmail
98 Obsoletes:      amavisd-postfix
99 Obsoletes:      amavisd-qmail
100 Conflicts:      amavis-stats <= 0.1.12
101 Conflicts:      postfix < 2.7.0
102 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
103
104 %define         _tmpwatchdir    /etc/tmpwatch
105 %define         schemadir       /usr/share/openldap/schema
106
107 %description
108 AMaViS is a script that interfaces a mail transport agent (MTA) with
109 one or more virus scanners and SpamAssasin. This is daemonized version
110 of amavis.
111
112 %description -l pl.UTF-8
113 AMaViS to skrypt pośredniczący pomiędzy agentem transferu poczty (MTA)
114 a jednym lub więcej programów antywirusowych i SpamAssasinem. Wersja
115 zdemonizowana.
116
117 %package -n openldap-schema-amavisd-new
118 Summary:        Amavisd-new LDAP schema
119 Summary(pl.UTF-8):      Schemat LDAP dla amavisd-new
120 Group:          Networking/Daemons
121 Requires:       openldap-servers
122 %if "%{_rpmversion}" >= "5"
123 BuildArch:      noarch
124 %endif
125
126 %description -n openldap-schema-amavisd-new
127 This package contains LDAP schema for use with amavisd-new.
128
129 %description -n openldap-schema-amavisd-new -l pl.UTF-8
130 Ten pakiet zawiera schemat LDAP do używania z amavisd-new.
131
132 %prep
133 %setup -q -n amavis-v%{version}
134 %patch0 -p1
135 %patch1 -p1
136
137 %install
138 rm -rf $RPM_BUILD_ROOT
139 install -d $RPM_BUILD_ROOT%{_var}/spool/amavis/{runtime,virusmails,db} \
140         $RPM_BUILD_ROOT{%{_var}/run/amavisd,/etc/rc.d/init.d,%{_sbindir}} \
141         $RPM_BUILD_ROOT%{_tmpwatchdir}
142
143 install -p amavisd $RPM_BUILD_ROOT%{_sbindir}
144 install -p amavisd-agent $RPM_BUILD_ROOT%{_sbindir}
145 install -p amavisd-nanny $RPM_BUILD_ROOT%{_sbindir}
146 install -p amavisd-release $RPM_BUILD_ROOT%{_sbindir}
147 install -p amavisd-submit $RPM_BUILD_ROOT%{_sbindir}
148 cp -p amavisd.conf $RPM_BUILD_ROOT%{_sysconfdir}/amavisd.conf
149
150 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/amavisd
151 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_tmpwatchdir}/%{name}.conf
152
153 install -Dp LDAP.schema $RPM_BUILD_ROOT%{schemadir}/amavisd-new.schema
154
155 %clean
156 rm -rf $RPM_BUILD_ROOT
157
158 %pre
159 %groupadd -g 116 -r -f amavis
160 %useradd -u 97 -r -d %{_var}/spool/amavis -s /bin/false -c "Anti Virus Checker" -g amavis amavis
161
162 %postun
163 if [ "$1" = "0" ]; then
164         %userremove amavis
165         %groupremove amavis
166 fi
167
168 %post
169 /sbin/chkconfig --add amavisd
170 %service amavisd restart "Amavisd daemon"
171
172 %preun
173 if [ "$1" = "0" ]; then
174         %service amavisd stop
175         /sbin/chkconfig --del amavisd
176 fi
177
178 %post -n openldap-schema-amavisd-new
179 %openldap_schema_register %{schemadir}/amavisd-new.schema
180 %service -q ldap restart
181
182 %postun -n openldap-schema-amavisd-new
183 if [ "$1" = "0" ]; then
184         %openldap_schema_unregister %{schemadir}/amavisd-new.schema
185         %service -q ldap restart
186 fi
187
188 %files
189 %defattr(644,root,root,755)
190 %doc AAAREADME.first INSTALL RELEASE_NOTES README_FILES/* test-messages
191 %attr(755,root,root) %{_sbindir}/amavisd
192 %attr(755,root,root) %{_sbindir}/amavisd-agent
193 %attr(755,root,root) %{_sbindir}/amavisd-nanny
194 %attr(755,root,root) %{_sbindir}/amavisd-release
195 %attr(755,root,root) %{_sbindir}/amavisd-submit
196 %attr(754,root,root) /etc/rc.d/init.d/amavisd
197 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/amavisd.conf
198 %config(noreplace) %verify(not md5 mtime size) %{_tmpwatchdir}/%{name}.conf
199 %attr(750,amavis,amavis) %{_var}/spool/amavis
200 %attr(750,amavis,amavis) %{_var}/run/amavisd
201
202 %files -n openldap-schema-amavisd-new
203 %defattr(644,root,root,755)
204 %{schemadir}/*.schema