source: spec/trunk/SPECS/clamav.spec@ 1567

Last change on this file since 1567 was 913, checked in by Yuri Dario, 9 years ago

spec: clamav: Release version 0.99.2-2.

File size: 14.1 KB
Line 
1#define svn_url F:/rd/ports/clamav/trunk
2%define svn_url http://svn.netlabs.org/repos/ports/clamav/trunk
3%define svn_rev 1841
4
5Summary: End-user tools for the Clam Antivirus scanner
6Name: clamav
7Version: 0.99.2
8Release: 2%{?dist}
9
10License: proprietary
11Group: Applications/File
12URL: http://www.clamav.net
13
14Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
15
16BuildRoot: %_tmppath/%name-%version-%release-root
17
18Requires: clamav-lib = %version-%release
19#Requires: data(clamav)
20
21BuildRequires: curl-devel
22BuildRequires: zlib-devel bzip2-devel
23BuildRequires: ncurses-devel
24BuildRequires: json-c-devel pcre-devel openssl-devel libxml2-devel
25BuildRequires: libtool libtool-ltdl-devel
26#BuildRequires: bc
27
28%package lib
29Summary: Dynamic libraries for the Clam Antivirus scanner
30Group: System Environment/Libraries
31#Requires: data(clamav)
32
33%package devel
34Summary: Header files and libraries for the Clam Antivirus scanner
35Group: Development/Libraries
36Requires: clamav-lib = %version-%release
37#Requires: clamav-filesystem = %version-%release
38
39%package data
40Summary: Virus signature data for the Clam Antivirus scanner
41Group: Applications/File
42#Requires(pre): clamav-filesystem = %version-%release
43#Requires(postun): clamav-filesystem = %version-%release
44Provides: data(clamav) = full
45Conflicts: data(clamav) < full
46Conflicts: data(clamav) > full
47%{?noarch}
48
49%package update
50Summary: Auto-updater for the Clam Antivirus scanner data-files
51Group: Applications/File
52#Source200: freshclam-sleep
53#Source201: freshclam.sysconfig
54#Source202: clamav-update.cron
55#Requires: clamav-filesystem = %version-%release
56#Requires(pre): /etc/cron.d
57#Requires(postun): /etc/cron.d
58#Requires(post): %__chown %__chmod
59#Requires(post): group(%username)
60
61%package server
62Summary: Clam Antivirus scanner server
63Group: System Environment/Daemons
64Requires: data(clamav)
65#Requires: clamav-filesystem = %version-%release
66Requires: clamav-lib = %version-%release
67
68%package server-sysvinit
69Summary: SysV initscripts for clamav server
70Group: System Environment/Daemons
71Provides: init(clamav-server) = sysv
72Requires: clamav-server = %version-%release
73#Requires(pre): %_initrddir
74#Requires(postun): %_initrddir
75Provides: clamav-server-sysv = %version-%release
76Obsoletes: clamav-server-sysv < %version-%release
77%{?noarch}
78
79
80%package scanner
81Summary: Clamav scanner daemon
82Group: System Environment/Daemons
83Requires: init(clamav-scanner)
84Provides: user(%scanuser) = 49
85Provides: group(%scanuser) = 49
86Requires: clamav-server = %version-%release
87%{?noarch}
88
89%package scanner-sysvinit
90Summary: SysV initscripts for clamav scanner daemon
91Group: System Environment/Daemons
92Provides: init(clamav-scanner) = sysv
93Requires: clamav-server-sysvinit = %version-%release
94Requires: clamav-scanner = %version-%release
95#Requires(pre): %_initrddir
96#Requires(postun): %_initrddir initscripts
97#Requires(post): chkconfig
98#Requires(preun): chkconfig initscripts
99%{?noarch}
100
101#%package scanner-upstart
102#Summary: Upstart initscripts for clamav scanner daemon
103#Group: System Environment/Daemons
104#Source410: clamd.scan.upstart
105#Provides: init(clamav-scanner) = upstart
106#Requires: clamav-scanner = %version-%release
107#Requires(pre): /etc/init
108#Requires(post): /usr/bin/killall
109#Requires(postun): /sbin/initctl
110#%{?noarch}
111
112
113%description
114Clam AntiVirus is an anti-virus toolkit for UNIX. The main purpose of this
115software is the integration with mail servers (attachment scanning). The
116package provides a flexible and scalable multi-threaded daemon, a command
117line scanner, and a tool for automatic updating via Internet. The programs
118are based on a shared library distributed with the Clam AntiVirus package,
119which you can use with your own software. The virus database is based on
120the virus database from OpenAntiVirus, but contains additional signatures
121(including signatures for popular polymorphic viruses, too) and is KEPT UP
122TO DATE.
123
124%description lib
125This package contains dynamic libraries shared between applications
126using the Clam Antivirus scanner.
127
128%description devel
129This package contains headerfiles and libraries which are needed to
130build applications using clamav.
131
132
133%description data
134This is an empty package to fulfill inter-package dependencies of the
135clamav suite.
136
137
138%description update
139This package contains programs which can be used to update the clamav
140anti-virus database automatically. It uses the freshclam(1) utility for
141this task. To activate it, uncomment the entry in /etc/cron.d/clamav-update.
142
143%description server
144ATTENTION: most users do not need this package; the main package has
145everything (or depends on it) which is needed to scan for virii on
146workstations.
147
148This package contains files which are needed to execute the clamd-daemon.
149This daemon does not provide a system-wide service. Instead of, an instance
150of this daemon should be started for each service requiring it.
151
152See the README file how this can be done with a minimum of effort.
153
154
155%description server-sysvinit
156SysV initscripts template for the clamav server
157
158
159%description scanner
160This package contains a generic system wide clamd service which is
161e.g. used by the clamav-milter package.
162
163%description scanner-sysvinit
164The SysV initscripts for clamav-scanner.
165
166
167%debug_package
168
169
170## ------------------------------------------------------------
171
172%prep
173%if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
174%setup -q
175%else
176%setup -n "%{name}-%{version}" -Tc
177svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
178rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
179(cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
180%endif
181
182sed -i -e 's!_VERSION_!%version!g;' \
183 -e 's!_BUILD_!%release!g;' \
184 ReadMe.txt
185
186#sed -ri \
187# -e 's!^#?(LogFile ).*!#\1/var/log/clamd.<SERVICE>!g' \
188# -e 's!^#?(LocalSocket ).*!#\1/var/run/clamd.<SERVICE>/clamd.sock!g' \
189# -e 's!^(#?PidFile ).*!\1/var/run/clamd.<SERVICE>/clamd.pid!g' \
190# -e 's!^#?(User ).*!\1<USER>!g' \
191# -e 's!^#?(AllowSupplementaryGroups|LogSyslog).*!\1 yes!g' \
192# -e 's! /usr/local/share/clamav,! %homedir,!g' \
193# etc/clamd.conf
194
195#sed -ri \
196# -e 's!^#?(UpdateLogFile )!#\1!g;' \
197# -e 's!^#?(LogSyslog).*!\1 yes!g' \
198# -e 's!(DatabaseOwner *)clamav$!\1%username!g' etc/freshclam.conf
199
200
201## ------------------------------------------------------------
202
203%build
204export CFLAGS="$RPM_OPT_FLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations"
205export LDFLAGS="-Zomf -Zmap -Zbin-files -Zhigh-mem -Zargs-wild -Zargs-resp"
206export LIBS="-lurpo -lcx0 -lpthread"
207# YD this is required for make llvm configure to work...
208export PATH_SEPARATOR=";"
209
210autoreconf -fvi
211
212%configure \
213 --disable-milter \
214 --disable-rpath \
215 --with-dbdir=/@unixroot/var/lib/clamav \
216 --with-xml=/@unixroot/usr \
217 --with-openssl=/@unixroot/usr \
218 --with-libcurl=/@unixroot/usr \
219 --with-zlib=/@unixroot/usr \
220 --with-libjson=/@unixroot/usr \
221 --enable-languages=c,c++ --disable-ltdl-install --disable-fdpassing \
222 --disable-clamav \
223 --disable-check \
224 --enable-llvm \
225 --enable-shared --disable-static
226
227# TODO: check periodically that CLAMAVUSER is used for freshclam only
228
229make %{?_smp_mflags}
230
231
232## ------------------------------------------------------------
233
234%install
235rm -rf "$RPM_BUILD_ROOT" _doc*
236make DESTDIR="$RPM_BUILD_ROOT" install
237
238#cp libclamav/clamav.dll $RPM_BUILD_ROOT%{_libdir}
239cp clamd/clamd.ico $RPM_BUILD_ROOT%{_sbindir}
240
241#LogFile must be readable to submit stats
242sed -i 's!#LogFileUnlock yes!LogFileUnlock yes!g;' \
243 $RPM_BUILD_ROOT%{_sysconfdir}/clamd.conf.sample
244
245
246rm $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8
247
248#install -d -m755 \
249# ${RPM_BUILD_ROOT}%_sysconfdir/{mail,clamd.d,cron.d,logrotate.d,sysconfig,init} \
250# ${RPM_BUILD_ROOT}%_var/log \
251# ${RPM_BUILD_ROOT}%milterstatedir \
252# ${RPM_BUILD_ROOT}%pkgdatadir/template \
253# ${RPM_BUILD_ROOT}%_initrddir \
254# ${RPM_BUILD_ROOT}%homedir \
255# ${RPM_BUILD_ROOT}%scanstatedir
256
257#rm -f ${RPM_BUILD_ROOT}%_sysconfdir/clamd.conf \
258# ${RPM_BUILD_ROOT}%_libdir/*.la
259
260rm -f ${RPM_BUILD_ROOT}%_libdir/*.la
261rm -f ${RPM_BUILD_ROOT}%_libdir/clamunrar*
262
263mkdir -p $RPM_BUILD_ROOT%{_var}/lib/clamav
264touch $RPM_BUILD_ROOT%{_var}/lib/clamav/daily.cld
265touch $RPM_BUILD_ROOT%{_var}/lib/clamav/daily.cvd
266touch $RPM_BUILD_ROOT%{_var}/lib/clamav/main.cld
267touch $RPM_BUILD_ROOT%{_var}/lib/clamav/main.cvd
268touch $RPM_BUILD_ROOT%{_var}/lib/clamav/bytecode.cld
269touch $RPM_BUILD_ROOT%{_var}/lib/clamav/bytecode.cvd
270touch $RPM_BUILD_ROOT%{_var}/lib/clamav/mirrors.dat
271
272
273## prepare the server-files
274#mkdir _doc_server
275#install -m644 -p %SOURCE2 _doc_server/clamd.sysconfig
276#install -m644 -p %SOURCE3 _doc_server/clamd.logrotate
277#install -m755 -p %SOURCE7 _doc_server/clamd.init
278#install -m644 -p %SOURCE5 _doc_server/README
279#install -m644 -p etc/clamd.conf _doc_server/clamd.conf
280
281#install -m644 -p %SOURCE1 $RPM_BUILD_ROOT%pkgdatadir
282#install -m755 -p %SOURCE100 $RPM_BUILD_ROOT%pkgdatadir
283#cp -pa _doc_server/* $RPM_BUILD_ROOT%pkgdatadir/template
284#ln -s %pkgdatadir/clamd-wrapper $RPM_BUILD_ROOT%_initrddir/clamd-wrapper
285
286#smartsubst 's!/usr/share/clamav!%pkgdatadir!g' $RPM_BUILD_ROOT%pkgdatadir/clamd-wrapper
287
288
289## prepare the update-files
290#install -m644 -p %SOURCE6 ${RPM_BUILD_ROOT}%_sysconfdir/logrotate.d/clamav-update
291#install -m755 -p %SOURCE8 ${RPM_BUILD_ROOT}%_sbindir/clamav-notify-servers
292#touch ${RPM_BUILD_ROOT}%freshclamlog
293
294#install -p -m0755 %SOURCE200 $RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep
295#install -p -m0644 %SOURCE201 $RPM_BUILD_ROOT%_sysconfdir/sysconfig/freshclam
296#install -p -m0600 %SOURCE202 $RPM_BUILD_ROOT%_sysconfdir/cron.d/clamav-update
297
298#smartsubst 's!webmaster,clamav!webmaster,%username!g;
299# s!/usr/share/clamav!%pkgdatadir!g;
300# s!/usr/bin!%_bindir!g;
301# s!/usr/sbin!%_sbindir!g;' \
302# $RPM_BUILD_ROOT%_sysconfdir/cron.d/clamav-update \
303# $RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep
304
305
306### The scanner stuff
307#sed -e 's!<SERVICE>!scan!g;s!<USER>!%scanuser!g' \
308# etc/clamd.conf > $RPM_BUILD_ROOT%_sysconfdir/clamd.d/scan.conf
309
310#sed -e 's!<SERVICE>!scan!g;' $RPM_BUILD_ROOT%pkgdatadir/template/clamd.init \
311# > $RPM_BUILD_ROOT%_initrddir/clamd.scan
312
313#install -p -m 644 %SOURCE410 $RPM_BUILD_ROOT%_sysconfdir/init/clamd.scan.conf
314
315#touch $RPM_BUILD_ROOT%scanstatedir/clamd.sock
316
317
318%{!?with_upstart:rm -rf $RPM_BUILD_ROOT%_sysconfdir/init}
319
320## ------------------------------------------------------------
321
322%clean
323rm -rf "$RPM_BUILD_ROOT"
324
325%post
326%wps_object_create_begin
327CLAMAV_README:WPShadow|Readme 1st|<CLAMAV_FOLDER>|SHADOWID=((%_defaultdocdir/%name-%version/ReadMe.txt))
328%wps_object_create_end
329
330%postun
331%wps_object_delete_all
332
333# -lib is installed first/uninstalled last, create folder here
334%post lib
335%wps_object_create_begin -n %{name}-lib
336CLAMAV_FOLDER:WPFolder|ClamAV %version|<WP_DESKTOP>|TITLE=ClamAV %version;
337%wps_object_create_end
338
339%postun lib
340%wps_object_delete_all -n %{name}-lib
341
342%post server
343%wps_object_create_begin -n %{name}-server
344CLAMAV_CLAMD:WPProgram|ClamAV daemon|<CLAMAV_FOLDER>|EXENAME=((%_sbindir/clamd.exe));STARTUPDIR=((%_sbindir));ICONFILE=((%_sbindir/clamd.ico));TITLE=ClamAV daemon;
345CLAMAV_CLAMD_CONF:WPShadow|clamd.conf|<CLAMAV_FOLDER>|SHADOWID=((%_sysconfdir/clamd.conf))
346%wps_object_create_end
347
348%postun server
349%wps_object_delete_all -n %{name}-server
350
351%post update
352%wps_object_create_begin -n %{name}-update
353CLAMAV_FRESHCLAM:WPProgram|Freshclam|<CLAMAV_FOLDER>|EXENAME=((%_bindir/freshclam.exe));STARTUPDIR=((%_bindir));TITLE=Freshclam;NOAUTOCLOSE=YES;
354CLAMAV_FRESHCLAM_CONF:WPShadow|freshclam.conf|<CLAMAV_FOLDER>|SHADOWID=((%_sysconfdir/freshclam.conf))
355%wps_object_create_end
356
357%postun update
358%wps_object_delete_all -n %{name}-update
359
360## ------------------------------------------------------------
361
362%files
363%defattr(-,root,root,-)
364%doc AUTHORS BUGS COPYING ChangeLog FAQ NEWS README UPGRADE
365%doc ReadMe.txt
366%doc docs/*.pdf
367%_bindir/*.exe
368%_mandir/man[15]/*
369%exclude %_bindir/clamav-config
370%exclude %_bindir/freshclam.exe
371%exclude %_mandir/*/freshclam*
372
373## -----------------------
374
375%files lib
376%defattr(-,root,root,-)
377%_libdir/*.dll
378
379## -----------------------
380
381%files devel
382%defattr(-,root,root,-)
383%_includedir/*
384%_libdir/*.a
385#%pkgdatadir/template
386#%pkgdatadir/clamd-gen
387%_libdir/pkgconfig/*
388%_bindir/clamav-config
389
390## -----------------------
391
392%files data
393%defattr(-,%username,%username,-)
394%ghost %attr(0664,%username,%username) %{_var}/lib/clamav/*.cvd
395%ghost %attr(0664,%username,%username) %{_var}/lib/clamav/*.cld
396%ghost %attr(0664,%username,%username) %{_var}/lib/clamav/*.dat
397
398
399## -----------------------
400
401%files update
402%defattr(-,root,root,-)
403%_bindir/freshclam.exe
404%_mandir/*/freshclam*
405#%pkgdatadir/freshclam-sleep
406%config(noreplace) %verify(not mtime) %_sysconfdir/freshclam.conf.sample
407#%config(noreplace) %verify(not mtime) %_sysconfdir/logrotate.d/*
408#%config(noreplace) %_sysconfdir/cron.d/*
409#%config(noreplace) %_sysconfdir/sysconfig/freshclam
410
411#%ghost %attr(0664,root,%username) %verify(not size md5 mtime) %freshclamlog
412%ghost %attr(0664,%username,%username) %{_var}/lib/clamav/*.cld
413%ghost %attr(0664,%username,%username) %{_var}/lib/clamav/*.cvd
414%ghost %attr(0664,%username,%username) %{_var}/lib/clamav/*.dat
415
416
417## -----------------------
418
419%files server
420%defattr(-,root,root,-)
421#%doc _doc_server/*
422%_mandir/man[58]/clamd*
423%_sbindir/*.exe
424%_sbindir/*.ico
425#%pkgdatadir/clamd-wrapper
426#%dir %_sysconfdir/clamd.d
427%config(noreplace) %verify(not mtime) %_sysconfdir/clamd.conf.sample
428
429
430%files server-sysvinit
431%defattr(-,root,root,-)
432#%_initrddir/clamd-wrapper
433
434
435## -----------------------
436
437%files scanner
438%defattr(-,root,root,-)
439#%dir %attr(0710,%scanuser,%scanuser) %scanstatedir
440#%config(noreplace) %_sysconfdir/clamd.d/scan.conf
441#%ghost %scanstatedir/clamd.sock
442
443%files scanner-sysvinit
444#%attr(0755,root,root) %config %_initrddir/clamd.scan
445
446%if 0%{?with_upstart:1}
447%files scanner-upstart
448%defattr(-,root,root,-)
449%config(noreplace) %_sysconfdir/init/clamd.scan*
450%endif
451
452%changelog
453* Tue Nov 29 2016 yd <yd@os2power.com> 0.99.2-2
454- enable c++ interface, llvm engine.
455
456* Mon Nov 28 2016 yd <yd@os2power.com> 0.99.2-1
457- use libcx0 mmap code, new libtool generation.
458- r1834, update of source code to 0.99.21.
459
460* Thu Feb 05 2015 yd <yd@os2power.com> 0.98.6-6
461- r1001, update of source code to 0.98.6.
462
463* Thu Nov 24 2011 yd
464- fixed missing mmap check in build
Note: See TracBrowser for help on using the repository browser.