]> git.pld-linux.org Git - packages/amavisd-new.git/blob - amavisd-new.spec
04ccad0bb7292250bcd912369e14653b1db3ac41
[packages/amavisd-new.git] / amavisd-new.spec
1 # TODO:
2 # - Add polish info mail templates
3 # - Some perl master check what Patch1 did 
4 %include        /usr/lib/rpm/macros.perl
5 %define         _real_ver       2.1.2
6 Summary:        A Mail Virus Scanner with SpamAssassin support - daemon
7 Summary(pl):    Antywirusowy skaner poczty elektronicznej z obs³ug± SpamAssasina - demon
8 Name:           amavisd-new
9 Version:        20040906
10 Release:        2
11 License:        GPL
12 Group:          Applications/Mail
13 Source0:        http://www.ijs.si/software/amavisd/%{name}-%{_real_ver}.tar.gz
14 # Source0-md5:  d24bafbe84668dec71a38a074b6bb920
15 Source1:        %{name}.init
16 Source2:        %{name}-milter.init
17 Patch0:         %{name}-config.patch
18 Patch1:         %{name}-dirperms.patch
19 Patch2:         %{name}-lib64.patch
20 Patch3:         %{name}-tools-dbdir.patch
21 URL:            http://www.ijs.si/software/amavisd/
22 BuildRequires:  autoconf
23 BuildRequires:  rpmbuild(macros) >= 1.159
24 BuildRequires:  sendmail-devel
25 Requires(pre):  /usr/bin/getgid
26 Requires(pre):  /bin/id
27 Requires(pre):  /usr/sbin/groupadd
28 Requires(pre):  /usr/sbin/useradd
29 Requires(postun):       /usr/sbin/userdel
30 Requires(postun):       /usr/sbin/groupdel
31 Requires(post,preun):   /sbin/chkconfig
32 Requires:       arc
33 Requires:       bzip2
34 Requires:       file
35 Requires:       lha
36 Requires:       ncompress
37 Requires:       perl-Archive-Tar
38 Requires:       perl-Archive-Zip
39 Requires:       perl-Compress-Zlib
40 Requires:       perl-Convert-TNEF
41 Requires:       perl-Convert-UUlib
42 Requires:       perl-libnet
43 Requires:       perl-Mail-SpamAssassin
44 Requires:       perl-MIME-tools
45 Requires:       perl-Net-Server
46 Requires:       perl-Unix-Syslog
47 Requires:       sh-utils
48 Requires:       unarj
49 Requires:       unrar
50 Requires:       zoo
51 Requires:       /usr/lib/sendmail
52 Provides:       group(amavis)
53 Provides:       user(amavis)
54 Obsoletes:      AMaViS
55 Obsoletes:      amavis
56 Obsoletes:      amavisd
57 Obsoletes:      amavisd-daemon
58 Obsoletes:      amavisd-postfix
59 Obsoletes:      amavisd-exim
60 Obsoletes:      amavisd-qmail
61 Obsoletes:      amavisd-new-postfix
62 Obsoletes:      amavisd-new-exim
63 Obsoletes:      amavisd-new-qmail
64 Conflicts:      amavis-stats <= 0.1.12
65 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67 %description
68 AMaViS is a script that interfaces a mail transport agent (MTA) with
69 one or more virus scanners and SpamAssasin. This is daemonized version
70 of amavis.
71
72 %description -l pl
73 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
74 a jednym lub wiêcej programów antywirusowych i SpamAssasinem. Wersja
75 zdemonizowana.
76
77 %package sendmail
78 Summary:        A Mail Virus Scanner with SpamAssasin support - sendmail backend
79 Summary(pl):    Antywirusowy skaner poczty elektronicznej - backend dla sendmaila
80 Group:          Applications/Mail
81 Requires:       %{name} = %{version}-%{release}
82 Requires:       sendmail
83
84 %description sendmail
85 AMaViS is a script that interfaces a mail transport agent (MTA) with
86 one or more virus scanners. This is daemonized version of amavis.
87
88 This package contains backend for sendmail.
89
90 %description sendmail -l pl
91 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
92 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
93
94 Pakiet ten zawiera back-end dla sendmaila.
95
96 %prep
97 %setup -q -n %{name}-%{_real_ver}
98 %patch0 -p1
99 # %patch1 -p1
100 %if "%{_lib}" == "lib64"
101 %patch2 -p1
102 %endif
103 %patch3 -p1
104
105 %build
106 cd helper-progs
107 %{__autoconf}
108 ./configure \
109         --with-sendmail=/usr/lib/sendmail \
110         --with-runtime-dir=/var/spool/amavis/runtime \
111         --with-sockname=/var/spool/amavis/runtime/amavisd.sock
112 %{__make}
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116 install -d $RPM_BUILD_ROOT{%{_var}/spool/amavis/{runtime,virusmails,db},%{_var}/run/amavisd,%{_sysconfdir}/rc.d/init.d,%{_sbindir}}
117
118 install amavisd $RPM_BUILD_ROOT%{_sbindir}
119 install amavisd-agent $RPM_BUILD_ROOT%{_sbindir}
120 install amavisd-nanny $RPM_BUILD_ROOT%{_sbindir}
121 install amavisd.conf-sample $RPM_BUILD_ROOT%{_sysconfdir}/amavisd.conf
122 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/amavisd
123 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/amavis-milter
124 install helper-progs/amavis $RPM_BUILD_ROOT%{_sbindir}
125 install helper-progs/amavis-milter $RPM_BUILD_ROOT%{_sbindir}
126
127 %clean
128 rm -rf $RPM_BUILD_ROOT
129
130 %pre
131 if [ -n "`getgid amavis`" ]; then
132         if [ "`getgid amavis`" != "116" ]; then
133                 echo "Error: group amavis doesn't have gid=116. Correct this before installing amavisd-new." 1>&2
134                 exit 1
135         fi
136 else
137         echo "adding group amavis GID=116."
138         /usr/sbin/groupadd -g 116 -r -f amavis
139 fi
140
141 if [ -n "`id -u amavis 2>/dev/null`" ]; then
142         if [ "`id -u amavis`" != "97" ]; then
143                 echo "Error: user amavis doesn't have uid=97. Correct this before installing amavis." 1>&2
144                 exit 1
145         fi
146 else
147         /usr/sbin/useradd -u 97 -r -d %{_var}/spool/amavis -s /bin/false -c "Anti Virus Checker" -g nobody amavis 1>&2
148 fi
149
150 %postun
151 if [ "$1" = "0" ]; then
152         %userremove amavis
153         %groupremove amavis
154 fi
155
156 %post
157 /sbin/chkconfig --add amavisd
158 if [ -f /var/lock/subsys/amavisd ]; then
159         /etc/rc.d/init.d/amavisd restart >&2
160 else
161         echo "Run \"/etc/rc.d/init.d/amavisd start\" to start Amavisd daemon."
162 fi
163
164 %preun
165 if [ "$1" = "0" ];then
166         if [ -f /var/lock/subsys/amavisd ]; then
167                 /etc/rc.d/init.d/amavisd stop >&2
168         fi
169         /sbin/chkconfig --del amavisd
170 fi
171
172 %post sendmail
173 /sbin/chkconfig --add amavis-milter
174 if [ -f /var/lock/subsys/amavis-milter ]; then
175         /etc/rc.d/init.d/amavis-milter restart >&2
176 else
177         echo "Run \"/etc/rc.d/init.d/amavis-milter start\" to start Amavis-milter daemon."
178 fi
179
180
181 %preun sendmail
182 if [ "$1" = "0" ];then
183         if [ -f /var/lock/subsys/amavis-milter ]; then
184                 /etc/rc.d/init.d/amavis-milter stop >&2
185         fi
186         /sbin/chkconfig --del amavis-milter
187 fi
188
189
190
191 %files
192 %defattr(644,root,root,755)
193 %doc AAAREADME.first INSTALL RELEASE_NOTES README_FILES/* test-messages
194 %attr(755,root,root) %{_sbindir}/amavisd*
195 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/amavisd
196 %config(noreplace) %{_sysconfdir}/amavisd.conf
197 %attr(750,amavis,amavis) %{_var}/spool/amavis
198 %attr(755,amavis,root) %{_var}/run/amavisd
199
200 %files sendmail
201 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/amavis-milter
202 %attr(755,root,root) %{_sbindir}/amavis
203 %attr(755,root,root) %{_sbindir}/amavis-milter
This page took 0.032644 seconds and 2 git commands to generate.