]> git.pld-linux.org Git - packages/amavisd-new.git/blob - amavisd-new.spec
- Epoch 1, simplified prep
[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:        2.2.0
9 Release:        1
10 Epoch:          1
11 License:        GPL
12 Group:          Applications/Mail
13 Source0:        http://www.ijs.si/software/amavisd/%{name}-%{version}.tar.gz
14 # Source0-md5:  70af3c7b6d06de900b74e216cfcf12f7
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:       perl-Archive-Tar
33 Requires:       perl-Archive-Zip
34 Requires:       perl-Compress-Zlib
35 Requires:       perl-Convert-TNEF
36 Requires:       perl-Convert-UUlib
37 Requires:       perl-libnet
38 Requires:       perl-Mail-SpamAssassin
39 Requires:       perl-MIME-tools
40 Requires:       perl-Net-Server
41 Requires:       perl-Unix-Syslog
42 Requires:       sh-utils
43 Requires:       /usr/lib/sendmail
44 Provides:       group(amavis)
45 Provides:       user(amavis)
46 Obsoletes:      AMaViS
47 Obsoletes:      amavis
48 Obsoletes:      amavisd
49 Obsoletes:      amavisd-daemon
50 Obsoletes:      amavisd-postfix
51 Obsoletes:      amavisd-exim
52 Obsoletes:      amavisd-qmail
53 Obsoletes:      amavisd-new-postfix
54 Obsoletes:      amavisd-new-exim
55 Obsoletes:      amavisd-new-qmail
56 Conflicts:      amavis-stats <= 0.1.12
57 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
59 %description
60 AMaViS is a script that interfaces a mail transport agent (MTA) with
61 one or more virus scanners and SpamAssasin. This is daemonized version
62 of amavis.
63
64 %description -l pl
65 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
66 a jednym lub wiêcej programów antywirusowych i SpamAssasinem. Wersja
67 zdemonizowana.
68
69 %package sendmail
70 Summary:        A Mail Virus Scanner with SpamAssasin support - sendmail backend
71 Summary(pl):    Antywirusowy skaner poczty elektronicznej - backend dla sendmaila
72 Group:          Applications/Mail
73 Requires:       %{name} = %{version}-%{release}
74 Requires:       sendmail
75
76 %description sendmail
77 AMaViS is a script that interfaces a mail transport agent (MTA) with
78 one or more virus scanners. This is daemonized version of amavis.
79
80 This package contains backend for sendmail.
81
82 %description sendmail -l pl
83 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
84 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
85
86 Pakiet ten zawiera back-end dla sendmaila.
87
88 %prep
89 %setup -q
90 %patch0 -p1
91 # %patch1 -p1
92 %if "%{_lib}" == "lib64"
93 %patch2 -p1
94 %endif
95 %patch3 -p1
96
97 %build
98 cd helper-progs
99 %{__autoconf}
100 ./configure \
101         --with-sendmail=/usr/lib/sendmail \
102         --with-runtime-dir=/var/spool/amavis/runtime \
103         --with-sockname=/var/spool/amavis/runtime/amavisd.sock
104 %{__make}
105
106 %install
107 rm -rf $RPM_BUILD_ROOT
108 install -d $RPM_BUILD_ROOT{%{_var}/spool/amavis/{runtime,virusmails,db},%{_var}/run/amavisd,%{_sysconfdir}/rc.d/init.d,%{_sbindir}}
109
110 install amavisd $RPM_BUILD_ROOT%{_sbindir}
111 install amavisd-agent $RPM_BUILD_ROOT%{_sbindir}
112 install amavisd-nanny $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 amavis amavis 1>&2
140 fi
141
142 %postun
143 if [ "$1" = "0" ]; then
144         %userremove amavis
145         %groupremove amavis
146 fi
147
148 %post
149 /sbin/chkconfig --add amavisd
150 if [ -f /var/lock/subsys/amavisd ]; then
151         /etc/rc.d/init.d/amavisd restart >&2
152 else
153         echo "Run \"/etc/rc.d/init.d/amavisd start\" to start Amavisd daemon."
154 fi
155
156 %preun
157 if [ "$1" = "0" ];then
158         if [ -f /var/lock/subsys/amavisd ]; then
159                 /etc/rc.d/init.d/amavisd stop >&2
160         fi
161         /sbin/chkconfig --del amavisd
162 fi
163
164 %post sendmail
165 /sbin/chkconfig --add amavis-milter
166 if [ -f /var/lock/subsys/amavis-milter ]; then
167         /etc/rc.d/init.d/amavis-milter restart >&2
168 else
169         echo "Run \"/etc/rc.d/init.d/amavis-milter start\" to start Amavis-milter daemon."
170 fi
171
172
173 %preun sendmail
174 if [ "$1" = "0" ];then
175         if [ -f /var/lock/subsys/amavis-milter ]; then
176                 /etc/rc.d/init.d/amavis-milter stop >&2
177         fi
178         /sbin/chkconfig --del amavis-milter
179 fi
180
181
182
183 %files
184 %defattr(644,root,root,755)
185 %doc AAAREADME.first INSTALL RELEASE_NOTES README_FILES/* test-messages
186 %attr(755,root,root) %{_sbindir}/amavisd*
187 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/amavisd
188 %config(noreplace) %{_sysconfdir}/amavisd.conf
189 %attr(750,amavis,amavis) %{_var}/spool/amavis
190 %attr(755,amavis,root) %{_var}/run/amavisd
191
192 %files sendmail
193 %defattr(644,root,root,755)
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.041043 seconds and 4 git commands to generate.