]> git.pld-linux.org Git - packages/amavisd-new.git/blob - amavisd-new.spec
f9a73935bec6f96b13129303c02b72ba50799058
[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 # Source0-size: 464713
16 Source1:        %{name}.init
17 Source2:        %{name}-milter.init
18 Patch0:         %{name}-config.patch
19 Patch1:         %{name}-dirperms.patch
20 Patch2:         %{name}-lib64.patch
21 Patch3:         %{name}-tools-dbdir.patch
22 URL:            http://www.ijs.si/software/amavisd/
23 BuildRequires:  autoconf
24 BuildRequires:  rpmbuild(macros) >= 1.159
25 BuildRequires:  sendmail-devel
26 Requires(pre):  /usr/bin/getgid
27 Requires(pre):  /bin/id
28 Requires(pre):  /usr/sbin/groupadd
29 Requires(pre):  /usr/sbin/useradd
30 Requires(postun):       /usr/sbin/userdel
31 Requires(postun):       /usr/sbin/groupdel
32 Requires(post,preun):   /sbin/chkconfig
33 Requires:       perl-Archive-Tar
34 Requires:       perl-Archive-Zip
35 Requires:       perl-Compress-Zlib
36 Requires:       perl-Convert-TNEF
37 Requires:       perl-Convert-UUlib
38 Requires:       perl-libnet
39 Requires:       perl-Mail-SpamAssassin
40 Requires:       perl-MIME-tools
41 Requires:       perl-Net-Server
42 Requires:       perl-Unix-Syslog
43 Requires:       sh-utils
44 Requires:       /usr/lib/sendmail
45 Provides:       group(amavis)
46 Provides:       user(amavis)
47 Obsoletes:      AMaViS
48 Obsoletes:      amavis
49 Obsoletes:      amavisd
50 Obsoletes:      amavisd-daemon
51 Obsoletes:      amavisd-postfix
52 Obsoletes:      amavisd-exim
53 Obsoletes:      amavisd-qmail
54 Obsoletes:      amavisd-new-postfix
55 Obsoletes:      amavisd-new-exim
56 Obsoletes:      amavisd-new-qmail
57 Conflicts:      amavis-stats <= 0.1.12
58 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60 %description
61 AMaViS is a script that interfaces a mail transport agent (MTA) with
62 one or more virus scanners and SpamAssasin. This is daemonized version
63 of amavis.
64
65 %description -l pl
66 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
67 a jednym lub wiêcej programów antywirusowych i SpamAssasinem. Wersja
68 zdemonizowana.
69
70 %package sendmail
71 Summary:        A Mail Virus Scanner with SpamAssasin support - sendmail backend
72 Summary(pl):    Antywirusowy skaner poczty elektronicznej - backend dla sendmaila
73 Group:          Applications/Mail
74 Requires:       %{name} = %{version}-%{release}
75 Requires:       sendmail
76
77 %description sendmail
78 AMaViS is a script that interfaces a mail transport agent (MTA) with
79 one or more virus scanners. This is daemonized version of amavis.
80
81 This package contains backend for sendmail.
82
83 %description sendmail -l pl
84 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
85 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
86
87 Pakiet ten zawiera back-end dla sendmaila.
88
89 %prep
90 %setup -q -n %{name}-%{_real_ver}
91 %patch0 -p1
92 # %patch1 -p1
93 %if "%{_lib}" == "lib64"
94 %patch2 -p1
95 %endif
96 %patch3 -p1
97
98 %build
99 cd helper-progs
100 %{__autoconf}
101 ./configure \
102         --with-sendmail=/usr/lib/sendmail \
103         --with-runtime-dir=/var/spool/amavis/runtime \
104         --with-sockname=/var/spool/amavis/runtime/amavisd.sock
105 %{__make}
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109 install -d $RPM_BUILD_ROOT{%{_var}/spool/amavis/{runtime,virusmails,db},%{_var}/run/amavisd,%{_sysconfdir}/rc.d/init.d,%{_sbindir}}
110
111 install amavisd $RPM_BUILD_ROOT%{_sbindir}
112 install amavisd-agent $RPM_BUILD_ROOT%{_sbindir}
113 install amavisd-nanny $RPM_BUILD_ROOT%{_sbindir}
114 install amavisd.conf-sample $RPM_BUILD_ROOT%{_sysconfdir}/amavisd.conf
115 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/amavisd
116 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/amavis-milter
117 install helper-progs/amavis $RPM_BUILD_ROOT%{_sbindir}
118 install helper-progs/amavis-milter $RPM_BUILD_ROOT%{_sbindir}
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %pre
124 if [ -n "`getgid amavis`" ]; then
125         if [ "`getgid amavis`" != "116" ]; then
126                 echo "Error: group amavis doesn't have gid=116. Correct this before installing amavisd-new." 1>&2
127                 exit 1
128         fi
129 else
130         echo "adding group amavis GID=116."
131         /usr/sbin/groupadd -g 116 -r -f amavis
132 fi
133
134 if [ -n "`id -u amavis 2>/dev/null`" ]; then
135         if [ "`id -u amavis`" != "97" ]; then
136                 echo "Error: user amavis doesn't have uid=97. Correct this before installing amavis." 1>&2
137                 exit 1
138         fi
139 else
140         /usr/sbin/useradd -u 97 -r -d %{_var}/spool/amavis -s /bin/false -c "Anti Virus Checker" -g amavis amavis 1>&2
141 fi
142
143 %postun
144 if [ "$1" = "0" ]; then
145         %userremove amavis
146         %groupremove 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 %defattr(644,root,root,755)
195 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/amavis-milter
196 %attr(755,root,root) %{_sbindir}/amavis
197 %attr(755,root,root) %{_sbindir}/amavis-milter
This page took 0.034095 seconds and 3 git commands to generate.