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