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