]> git.pld-linux.org Git - packages/amavis.git/blob - amavis.spec
0f69874a9fefbacc1a3c4ed7813da8f62f2b8503
[packages/amavis.git] / amavis.spec
1 %include        /usr/lib/rpm/macros.perl
2 %define         sub_ver pre2
3
4 Summary:        A Mail Virus Scanner
5 Summary(pl):    Antywirusowy skaner poczty elektronicznej
6 Name:           amavis
7 Version:        0.3.13
8 Release:        2.%{sub_ver}
9 URL:            http://www.amavis.org/
10 Source0:        http://www.amavis.org/dist/perl/%{name}-%{version}%{sub_ver}.tar.gz
11 # Source0-md5:  2b90dba30a5ea2b73c2b348e26967f30
12 Source1:        %{name}-README.courier
13 Source2:        %{name}-acx_pthread.m4
14 Patch0:         %{name}-config.patch
15 License:        GPL
16 Group:          Applications/Mail
17 Obsoletes:      AMaViS
18 BuildRequires:  arc
19 BuildRequires:  autoconf >= 2.52
20 BuildRequires:  automake
21 BuildRequires:  bzip2
22 BuildRequires:  file
23 BuildRequires:  lha
24 BuildRequires:  libtool
25 BuildRequires:  ncompress
26 BuildRequires:  perl-modules
27 BuildRequires:  perl-Convert-UUlib
28 BuildRequires:  perl-Convert-TNEF
29 BuildRequires:  perl-Unix-Syslog
30 BuildRequires:  perl-Archive-Tar
31 BuildRequires:  perl-Archive-Zip
32 BuildRequires:  perl-Compress-Zlib
33 BuildRequires:  perl-MIME-tools
34 BuildRequires:  rpmbuild(macros) >= 1.159
35 BuildRequires:  sendmail-devel
36 BuildRequires:  sh-utils
37 BuildRequires:  unarj
38 BuildRequires:  unrar
39 BuildRequires:  zoo
40 Requires(pre):  /bin/id
41 Requires(pre):  /usr/sbin/groupadd
42 Requires(pre):  /usr/sbin/useradd
43 Requires(postun):       /usr/sbin/groupdel
44 Requires(postun):       /usr/sbin/userdel
45 Requires:       arc
46 Requires:       bzip2
47 Requires:       file
48 Requires:       lha
49 Requires:       ncompress
50 Requires:       sh-utils
51 Requires:       unarj
52 Requires:       unrar
53 Requires:       zoo
54 Provides:       group(amavis)
55 Provides:       user(amavis)
56 Obsoletes:      amavisd
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.
62
63 %description -l pl
64 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
65 a jednym lub wiêcej programów antywirusowych.
66
67 %package courier
68 Summary:        A Mail Virus Scanner - courier backend
69 Summary(pl):    Antywirusowy skaner poczty elektronicznej - backend dla couriera
70 Group:          Applications/Mail
71 Requires:       amavis = %{version}-%{release}
72 Requires:       courier
73 Provides:       amavis-courier
74
75 %description courier
76 AMaViS is a script that interfaces a mail transport agent (MTA) with
77 one or more virus scanners. This package contains backend for courier.
78
79 %description courier -l pl
80 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
81 a jednym lub wiêcej programów antywirusowych.
82
83 %prep
84 %setup -q -n %{name}-%{version}%{sub_ver}
85 %patch0 -p1
86 install -d m4
87 install %{SOURCE2} m4/acx_pthread.m4
88
89 %build
90 %{__libtoolize}
91 %{__aclocal} -I m4
92 %{__autoheader}
93 %{__autoconf}
94 %{__automake}
95 %configure \
96         --enable-all \
97         --with-sendmail-wrapper=%{_sbindir}/sendmail \
98         --with-runtime-dir=/var/spool/amavis/runtime \
99         --with-virusdir=/var/spool/amavis/virusmails \
100         --with-mailto="postmaster" \
101         --enable-courier \
102         --with-amavisuser=amavis \
103         --with-perl=%{__perl}
104
105 %{__make}
106
107 cp amavis/amavis amavis/amavis.courier
108
109 %install
110 rm -rf $RPM_BUILD_ROOT
111
112 %{__make} install \
113         amavisuser=$(id -u) \
114         DESTDIR=$RPM_BUILD_ROOT
115
116 install -d $RPM_BUILD_ROOT%{_sysconfdir}
117 install %{SOURCE1} ./README.courier
118 install amavis/amavis.courier $RPM_BUILD_ROOT%{_sbindir}
119 install amavis/amavis.conf $RPM_BUILD_ROOT%{_sysconfdir}/amavis.conf
120
121 # remove unneccessary files
122 rm -f $RPM_BUILD_ROOT%{_sbindir}/amavis
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127 %pre
128 if [ -n "`getgid amavis`" ]; then
129         if [ "`getgid amavis`" != "116" ]; then
130                 echo "Error: group amavis doesn't have gid=116. Correct this before installing amavis." 1>&2
131                 exit 1
132         fi
133 else
134         echo "adding group amavis GID=116."
135         /usr/sbin/groupadd -g 116 -r -f amavis
136 fi
137
138 if [ -n "`id -u amavis 2>/dev/null`" ]; then
139         if [ "`id -u amavis`" != "97" ]; then
140                 echo "Error: user amavis doesn't have uid=97. Correct this before installing amavis." 1>&2
141                 exit 1
142         fi
143 else
144         echo "adding user amavis UID=97."
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         %userremove amavis
151         %groupremove amavis
152 fi
153
154 %files
155 %defattr(644,root,root,755)
156 %doc README README.scanners AUTHORS BUGS ChangeLog FAQ TODO doc/amavis.html doc/amavis.png
157 %attr(751,amavis,amavis) %dir /var/spool/amavis
158 %attr(753,amavis,amavis) %dir /var/spool/amavis/runtime
159 %attr(753,amavis,amavis) %dir /var/spool/amavis/virusmails
160 %attr(644,amavis,amavis) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/amavis.conf
161
162 %files courier
163 %defattr(644,root,root,755)
164 %doc README.courier
165 %attr(755,root,root) %{_sbindir}/amavis.courier
This page took 0.061434 seconds and 2 git commands to generate.