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