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