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