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