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