]> git.pld-linux.org Git - packages/amavis.git/blob - amavis.spec
e566c13e3f9aea60dfc96778b7d53117b8703808
[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:        1.%{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:  autoconf >= 2.52
19 BuildRequires:  automake
20 BuildRequires:  perl-modules
21 BuildRequires:  perl-Convert-UUlib
22 BuildRequires:  perl-Convert-TNEF
23 BuildRequires:  perl-Unix-Syslog
24 BuildRequires:  perl-Archive-Tar
25 BuildRequires:  perl-Archive-Zip
26 BuildRequires:  perl-Compress-Zlib
27 BuildRequires:  perl-MIME-tools
28 BuildRequires:  file
29 BuildRequires:  sh-utils
30 BuildRequires:  arc
31 BuildRequires:  bzip2
32 BuildRequires:  lha
33 BuildRequires:  unarj
34 BuildRequires:  ncompress
35 BuildRequires:  unrar
36 BuildRequires:  zoo
37 Requires(pre):  /bin/id
38 Requires(pre):  /usr/sbin/groupadd
39 Requires(pre):  /usr/sbin/useradd
40 Requires(postun):       /usr/sbin/groupdel
41 Requires(postun):       /usr/sbin/userdel
42 Requires:       file
43 Requires:       sh-utils
44 Requires:       arc
45 Requires:       bzip2
46 Requires:       lha
47 Requires:       unarj
48 Requires:       ncompress
49 Requires:       unrar
50 Requires:       zoo
51 Obsoletes:      amavisd
52 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54 %description
55 AMaViS is a script that interfaces a mail transport agent (MTA) with
56 one or more virus scanners.
57
58 %description -l pl
59 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
60 a jednym lub wiêcej programów antywirusowych.
61
62 %package courier
63 Summary:        A Mail Virus Scanner - courier backend
64 Summary(pl):    Antywirusowy skaner poczty elektronicznej - backend dla couriera
65 Group:          Applications/Mail
66 Requires:       amavis = %{version}-%{release}
67 Requires:       courier
68 Provides:       amavis-courier
69
70 %description courier
71 AMaViS is a script that interfaces a mail transport agent (MTA) with
72 one or more virus scanners. This package contains backend for courier.
73
74 %description courier -l pl
75 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
76 a jednym lub wiêcej programów antywirusowych.
77
78 %prep
79 %setup -q -n %{name}-%{version}%{sub_ver}
80 %patch0 -p1
81 install -d m4
82 install %{SOURCE2} m4/acx_pthread.m4
83
84 %build
85 %{__libtoolize}
86 %{__aclocal} -I m4
87 %{__autoheader}
88 %{__autoconf}
89 %{__automake}
90 %configure \
91         --enable-all \
92         --with-sendmail-wrapper=%{_sbindir}/sendmail \
93         --with-runtime-dir=/var/spool/amavis/runtime \
94         --with-virusdir=/var/spool/amavis/virusmails \
95         --with-mailto="postmaster" \
96         --enable-courier \
97         --with-amavisuser=amavis \
98         --with-perl=%{__perl}
99
100 %{__make}
101
102 cp amavis/amavis amavis/amavis.courier
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106
107 %{__make} install \
108         amavisuser=$(id -u) \
109         DESTDIR=$RPM_BUILD_ROOT
110
111 install -d $RPM_BUILD_ROOT%{_sysconfdir}
112 install %{SOURCE1} ./README.courier
113 install amavis/amavis.courier $RPM_BUILD_ROOT%{_sbindir}
114 install amavis/amavis.conf $RPM_BUILD_ROOT%{_sysconfdir}/amavis.conf
115
116 # remove unneccessary files
117 rm -f $RPM_BUILD_ROOT%{_sbindir}/amavis
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 amavis." 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         echo "adding user amavis UID=97."
140         /usr/sbin/useradd -u 97 -r -d /var/spool/amavis  -s /bin/false -c "Anti Virus Checker" -g nobody  amavis 1>&2
141 fi
142
143 %postun
144 if [ "$1" = "0" ]; then
145         echo "Removing group amavis."
146         /usr/sbin/groupdel amavis
147         echo "Removing user amavis."
148         /usr/sbin/userdel amavis
149 fi
150
151 %files
152 %defattr(644,root,root,755)
153 %doc README README.scanners AUTHORS BUGS ChangeLog FAQ TODO doc/amavis.html doc/amavis.png
154 %attr(751,amavis,amavis) %dir /var/spool/amavis
155 %attr(753,amavis,amavis) %dir /var/spool/amavis/runtime
156 %attr(753,amavis,amavis) %dir /var/spool/amavis/virusmails
157 %attr(644,amavis,amavis) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/amavis.conf
158
159 %files courier
160 %defattr(644,root,root,755)
161 %doc README.courier
162 %attr(755,root,root) %{_sbindir}/amavis.courier
This page took 0.054057 seconds and 2 git commands to generate.