]> git.pld-linux.org Git - packages/amavisd.git/blob - amavisd.spec
- added backends (for exim and postfix) in separate packages
[packages/amavisd.git] / amavisd.spec
1 %include        /usr/lib/rpm/macros.perl
2 Summary:        A Mail Virus Scanner - Daemon.
3 Summary(pl):    Antywirusowy skaner poczty elektronicznej - Demon
4 Name:           amavisd
5 Version:        20010714
6 Release:        5
7 License:        GPL
8 Group:          Applications/Mail
9 Source0:        http://www.amavis.org/dist/perl/%{name}-snapshot-%{version}.tar.gz
10 Source1:        %{name}.init
11 URL:            http://www.amavis.org/
12 BuildRequires:  arc
13 BuildRequires:  autoconf
14 BuildRequires:  bzip2
15 BuildRequires:  file
16 BuildRequires:  lha
17 BuildRequires:  ncompress
18 BuildRequires:  perl-Archive-Tar
19 BuildRequires:  perl-Archive-Zip
20 BuildRequires:  perl-Compress-Zlib
21 BuildRequires:  perl-MIME-tools
22 BuildRequires:  perl-Unix-Syslog
23 BuildRequires:  perl-Convert-UUlib
24 BuildRequires:  perl-Convert-TNEF
25 BuildRequires:  sh-utils
26 BuildRequires:  unarj
27 BuildRequires:  unrar
28 BuildRequires:  zoo
29 Obsoletes:      AMaViS
30 Obsoletes:      amavis
31 Requires:       %{_libdir}/sendmail
32 Requires:       arc
33 Requires:       bzip2
34 Requires:       file
35 Requires:       lha
36 Requires:       ncompress
37 Requires:       sh-utils
38 Requires:       unarj
39 Requires:       unrar
40 Requires:       zoo
41 Requires:       amavisd-daemon
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %description
45 AMaViS is a script that interfaces a mail transport agent (MTA) with
46 one or more virus scanners. This is daemonized version of amavis.
47
48 %description -l pl
49 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
50 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
51
52 %package postfix
53 Summary:        A Mail Virus Scanner - postfix back-end.
54 Summary(pl):    Antywirusowy skaner poczty elektronicznej - back-end dla postfiksa
55 Group:          Applications/Mail
56 Provides:       amavisd-daemon
57 Obsoletes:      amavisd-exim
58 Requires:       postfix
59
60 %description postfix
61 AMaViS is a script that interfaces a mail transport agent (MTA) with
62 one or more virus scanners. This is daemonized version of amavis.
63
64 This package contains backend for postfix.
65
66 %description postfix -l pl
67 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
68 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
69
70 Pakiet ten zawiera back-end dla postfiks.
71
72 %package exim
73 Summary:        A Mail Virus Scanner - exim backend.
74 Summary(pl):    Antywirusowy skaner poczty elektronicznej - backend dla exima
75 Group:          Applications/Mail
76 Provides:       amavisd-daemon
77 Obsoletes:      amavisd-postfix
78 Requires:       exim
79
80 %description exim
81 AMaViS is a script that interfaces a mail transport agent (MTA) with
82 one or more virus scanners. This is daemonized version of amavis.
83
84 This package contains backend for exim.
85
86 %description exim -l pl
87 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
88 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
89
90 Pakiet ten zawiera back-end dla exima.
91
92 %prep
93 %setup -q -n %{name}-snapshot-%{version}
94
95 %build
96 autoconf
97 %configure \
98         --enable-smtp \
99         --enable-postfix \
100         --enable-all \
101         --enable-syslog \
102         --with-runtime-dir=%{_var}/spool/amavis/runtime \
103         --with-virusdir=%{_var}/spool/amavis/virusmails \
104         --with-logdir=%{_var}/log \
105         --with-amavisuser=amavis \
106         --with-sockname=%{_var}/run/amavisd/amavisd.sock
107
108 %{__make}
109 mv amavis/amavisd amavis/amavisd.postfix
110
111 %configure \
112         --disable-smtp \
113         --enable-exim \
114         --enable-all \
115         --enable-syslog \
116         --with-runtime-dir=%{_var}/spool/amavis/runtime \
117         --with-virusdir=%{_var}/spool/amavis/virusmails \
118         --with-logdir=%{_var}/log \
119         --with-amavisuser=amavis \
120         --with-sockname=%{_var}/run/amavisd/amavisd.sock
121
122 %{__make}
123 cp amavis/amavisd amavis/amavisd.exim
124
125 gzip -9nf README* NEWS AUTHORS BUGS ChangeLog FAQ HINTS TODO doc/amavis.html
126
127 %install
128 rm -rf $RPM_BUILD_ROOT
129 install -d $RPM_BUILD_ROOT{%{_var}/spool/amavis,%{_var}/run/amavisd}
130
131 %{__make} install \
132         amavisuser=$(id -u) \
133         DESTDIR=$RPM_BUILD_ROOT
134 install -D %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}
135
136 install amavis/amavisd.{exim,postfix} $RPM_BUILD_ROOT%{_sbindir}
137
138 %files
139 %defattr(644,root,root,755)
140 %attr(755,root,root) %{_sbindir}/amavis
141 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/*
142 %config(noreplace) %{_sysconfdir}/amavisd.conf
143 %doc *.gz doc/*.gz doc/amavis.png
144 %attr(750,amavis,root) %{_var}/spool/amavis
145 %attr(755,amavis,root) %{_var}/run/amavisd
146
147 %files postfix
148 %defattr(644,root,root,755)
149 %attr(755,root,root) %{_sbindir}/amavisd.postfix
150
151 %files exim
152 %defattr(644,root,root,755)
153 %attr(755,root,root) %{_sbindir}/amavisd.exim
154
155 %pre
156 if [ -n "`id -u amavis 2>/dev/null`" ]; then
157         if [ "`id -u amavis`" != "97" ]; then
158                 echo "Warning: user amavis haven't uid=97. Correct this before installing amavis" 1>&2
159                 exit 1
160         fi
161 else
162         %{_sbindir}/useradd -u 97 -r -d %{_var}/spool/amavis  -s /bin/false -c "Anti Virus Checker" -g nobody  amavis 1>&2
163 fi
164
165 %postun
166 if [ "$1" = "0" ]; then
167         %{_sbindir}/userdel amavis
168 fi
169
170 %post
171 /sbin/chkconfig --add amavisd
172
173 if [ -f %{_var}/lock/subsys/amavisd ]; then
174         /etc/rc.d/init.d/amavisd restart >&2
175 else
176         echo "Run \"/etc/rc.d/init.d/amavisd start\" to start Amavisd daemon."
177 fi
178
179 %preun
180 if [ "$1" = "0" ];then
181         if [ -f %{_var}/lock/subsys/amavisd ]; then
182                 /etc/rc.d/init.d/amavisd stop >&2
183         fi
184         /sbin/chkconfig --del amavisd
185 fi
186
187 %post exim
188 if [ -f %{_sbindir}/amavisd ]; then
189     rm -f %{_sbindir}/amavisd
190 fi
191 ln -s amavisd.exim %{_sbindir}/amavisd
192
193 %postun exim
194 if [ -f %{_sbindir}/amavisd ]; then
195     rm -f %{_sbindir}/amavisd
196 fi
197
198 %post postfix
199 if [ -f %{_sbindir}/amavisd ]; then
200     rm -f %{_sbindir}/amavisd
201 fi
202 ln -s amavisd.postfix %{_sbindir}/amavisd
203
204 %postun postfix
205 if [ -f %{_sbindir}/amavisd ]; then
206     rm -f %{_sbindir}/amavisd
207 fi
208
209 %clean
210 rm -rf $RPM_BUILD_ROOT
This page took 0.077074 seconds and 4 git commands to generate.