]> git.pld-linux.org Git - packages/clamav.git/blob - clamav.spec
982c30d6326862ebb05443e2a1cc5f2b5ac36459
[packages/clamav.git] / clamav.spec
1 %define         database_version 20030207
2 Summary:        An anti-virus utility for Unix
3 Summary(pl):    Antywirusowe narzêdzie dla Unixów
4 Name:           clamav
5 Version:        0.54
6 Release:        4
7 License:        GPL
8 Group:          Applications
9 Source0:        http://clamav.elektrapro.com/stable/%{name}-%{version}.tar.gz
10 # Source0-md5:  1c2e2adffe9ed4d15fe2167dd7bad591
11 Source1:        %{name}.init
12 Source2:        %{name}.sysconfig
13 # gziped from http://clamav.elektrapro.com/database/:
14 Source3:        %{name}-database-%{database_version}.tar.gz
15 URL:            http://clamav.elektrapro.com/
16 Requires:       %{name}-database
17 BuildRequires:  autoconf
18 BuildRequires:  automake
19 BuildRequires:  zlib-devel
20 Requires(post,preun):   /sbin/chkconfig
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %description
24 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
25 AMaViS, compressed files, uses the virus database from
26 OpenAntivirus.org, and includes a program for auto-updating. The
27 scanner is multithreaded, written in C, and POSIX compliant.
28
29 %description -l pl
30 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
31 uniksowych. Wspiera on AMaViSa, skompresowane pliki, u¿ywa bazy
32 wirusów z OpenAntivirus.org, i posiada system automatycznej
33 aktualizacji. Skaner jest wielow±tkowy, napisany w C i zgodny z
34 POSIXem.
35
36 %package libs
37 Summary:        Shared libraries for clamav
38 Summary(pl):    Biblioteki dzielone clamav
39 Group:          Libraries
40
41 %description libs
42 Shared libraries for clamav.
43
44 %description libs -l pl
45 Biblioteki dzielone clamav.
46
47 %package devel
48 Summary:        clamav - Development header files and libraries
49 Summary(pl):    clamav - Pliki nag³ówkowe i biblioteki dla programistów
50 Group:          Development/Libraries
51 Requires:       %{name}-libs = %{version}
52
53 %description devel
54 This package contains the development header files and libraries
55 necessary to develop clamav client applications.
56
57 %description devel -l pl
58 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
59 klienckich clamav.
60
61 %package static
62 Summary:        clamav staic libraris
63 Summary(pl):    Biblioteki statyczne clamav
64 Group:          Development/Libraries
65 Requires:       %{name}-devel = %{version}
66
67 %description static
68 clamav static libraris.
69
70 %description static -l pl
71 Biblioteki statyczne clamav.
72
73 %package database
74 Summary:        Virus database for clamav
75 Summary(pl):    Bazy wirusów dla clamav
76 Group:          Applications
77 Version:        %{version}.%{database_version}
78 Requires:       %{name}
79
80 %description database
81 Virus database for clamav (updated %{database_version})
82
83 %description database -l pl
84 Bazy wirusów dla clamav (aktualizowana %{database_version})
85
86 %prep
87 %setup -q -a 3
88
89 %build
90 rm -f missing
91 %{__aclocal}
92 %{__autoconf}
93 %{__automake}
94 %configure \
95         --disable-clamav \
96         --with-dbdir=/var/lib/%{name}
97 %{__make}
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig}
102 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/cron.daily,%{_var}/log}
103
104 %{__make} install \
105         DESTDIR=$RPM_BUILD_ROOT
106
107 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
108 #!/bin/sh
109 umask 022
110 %{_bindir}/freshclam --quiet -l %{_var}/log/%{name}.log --daemon-notify
111 EOF
112
113 touch $RPM_BUILD_ROOT%{_var}/log/%{name}.log
114
115 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
116 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
117 install etc/clamav.conf $RPM_BUILD_ROOT%{_sysconfdir}/
118
119 %clean
120 rm -rf $RPM_BUILD_ROOT
121
122 %pre
123 if [ -n "`getgid clamav`" ]; then
124         if [ "`getgid clamav`" != "43" ]; then
125                 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
126                 exit 1
127         fi
128 else
129        echo "Adding group clamav GID=43"
130         /usr/sbin/groupadd -g 43 -r -f clamav
131 fi
132 if [ -n "`id -u clamav 2>/dev/null`" ]; then
133        if [ "`id -u clamav`" != "43" ]; then
134                echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
135                exit 1
136        fi
137 else
138        echo "Adding user clamav UID=43"
139        /usr/sbin/useradd -u 43 -r -d /tmp  -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
140 fi
141
142 %post
143 touch %{_var}/log/%{name}.log && chmod 640 %{_var}/log/%{name}.log && chown clamav %{_var}/log/%{name}.log
144 /sbin/chkconfig --add clamd
145 if [ -f /var/lock/subsys/clamd ]; then
146         /etc/rc.d/init.d/clamd restart >&2
147 else
148         echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
149 fi
150
151 %preun
152 if [ "$1" = "0" ]; then
153         if [ -f /var/lock/subsys/clamd ]; then
154                 /etc/rc.d/init.d/clamd stop
155         fi
156         /sbin/chkconfig --del clamd
157 fi
158
159 %postun
160 if [ "$1" = "0" ]; then
161        echo "Removing user clamav"
162        /usr/sbin/userdel clamav
163        echo "Removing group clamav"
164        /usr/sbin/groupdel clamav
165 fi
166
167 %post   libs -p /sbin/ldconfig
168 %postun libs -p /sbin/ldconfig
169
170 %files
171 %defattr(644,root,root,755)
172 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
173 %attr(755,root,root) %{_bindir}/*
174 %attr(755,root,root) %{_sbindir}/*
175 %attr(755,clamav,root) %dir /var/lib/%{name}
176 %attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
177 %attr(750,root,root) %{_sysconfdir}/cron.daily/%{name}
178 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*.conf
179 %attr(754,root,root) /etc/rc.d/init.d/clamd
180 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
181 %{_mandir}/man?/*
182
183 %files libs
184 %defattr(644,root,root,755)
185 %attr(755,root,root) %{_libdir}/lib*.so.*.*
186
187 %files devel
188 %defattr(644,root,root,755)
189 %attr(755,root,root) %{_libdir}/lib*.so
190 %{_libdir}/lib*.la
191 %{_includedir}/*.h
192
193 %files static
194 %defattr(644,root,root,755)
195 %{_libdir}/*.a
196
197 %files database
198 %defattr(644,root,root,755)
199 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.db*
This page took 0.04067 seconds and 3 git commands to generate.