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