surpport seeking the recorded video
[vuplus_openembedded] / recipes / clamav / clamav.inc
1 DESCRIPTION = "Clam AntiVirus is a GPL anti-virus toolkit for UNIX. The main \
2 purpose of this software is the integration with mail servers (attachment \
3 scanning)."
4 DESCRIPTION_${PN}-lib = "The dynamic library that is shared between all of \
5 the Clam AntiVirus components"
6 DESCRIPTION_${PN}-freshclam = "An automatic virus signature update \
7 application for Clam AntiVirus"
8 DESCRIPTION_${PN}-data = "Static antivirus signature database for Clam AntiVirus"
9 DESCRIPTION_${PN}-daemon = "An on-demand file scanning service for Clam AntiVirus"
10 HOMEPAGE = "http://www.clamav.net/"
11 SECTION = "network"
12 LICENSE = "GPL"
13 DEPENDS = "zlib bzip2 gmp curl virtual/libintl"
14 RDEPENDS_${PN} = "${PN}-data"
15 RDEPENDS_${PN}-daemon = "${PN}-data ${PN}-conf"
16 RDEPENDS_${PN}-freshclam = "${PN}-conf"
17 RRECOMMENDS_${PN} = "${PN}-freshclam"
18 RRECOMMENDS_${PN}-daemon = "${PN}-freshclam"
19 RPROVIDES_${PN}-freshclam = "${PN}-data"
20
21 SRC_URI = "${SOURCEFORGE_MIRROR}/clamav/clamav-${PV}.tar.gz \
22           file://clamav-daemon.init \
23           file://clamav-freshclam.init \
24           file://clamd.conf \
25           file://freshclam.conf \
26           file://volatiles.03_clamav-data \
27           file://volatiles.03_clamav-daemon \
28           file://volatiles.03_clamav-freshclam"
29
30 inherit autotools update-rc.d binconfig
31
32 # Don't check for clamav uid/gid - they don't exist on the host
33 # Put virus definitions in /var/lib not /usr/lib
34 EXTRA_OECONF = "--disable-clamav \
35                 --with-zlib=${STAGING_DIR_HOST}${layout_prefix} \
36                 --with-libcurl \
37                 --with-dbdir=${localstatedir}/lib/clamav"
38
39 do_install_append() {
40         install -m 0755 -d ${D}${sysconfdir}/default/volatiles \
41                            ${D}${sysconfdir}/init.d ${D}${docdir}/clamav
42
43         # Save the installed clamd.conf in the doc dir and then install our new one
44         install -m 0755 ${D}${sysconfdir}/clamd.conf ${D}${docdir}/clamav/clamd.conf.example
45         install -m 0755 ${WORKDIR}/clamd.conf ${D}${sysconfdir}/clamd.conf
46
47         # Save the installed freshclam.conf in the doc dir and then install our new one
48         install -m 0755 ${D}${sysconfdir}/freshclam.conf ${D}${docdir}/clamav/freshclam.conf.example
49
50         # Install our config files and init scripts
51         install -m 0755 ${WORKDIR}/freshclam.conf ${D}${sysconfdir}/freshclam.conf
52         install -m 0755 ${WORKDIR}/clamav-daemon.init ${D}${sysconfdir}/init.d/clamav-daemon
53         install -m 0755 ${WORKDIR}/clamav-freshclam.init ${D}${sysconfdir}/init.d/clamav-freshclam
54
55         # We need some /var directories
56         for i in 03_clamav-daemon 03_clamav-freshclam 03_clamav-data; do
57           install -m 0644 ${WORKDIR}/volatiles.$i ${D}${sysconfdir}/default/volatiles/$i
58         done
59 }
60 do_stage () {
61         oe_libinstall -a -so libclamav ${STAGING_LIBDIR}
62         rm -f ${STAGING_LIBDIR}/libclamav.la
63         install -m 0644 libclamav/clamav.h ${STAGING_INCDIR}
64 }
65
66 PACKAGES += "${PN}-freshclam ${PN}-daemon ${PN}-conf ${PN}-data ${PN}-lib \
67              ${PN}-clamconf"
68
69 LEAD_SONAME = "libclamav.so.*"
70 FILES_${PN} = "${bindir}/clamscan \
71                ${bindir}/sigtool \
72                ${bindir}/clamdscan"
73 FILES_${PN}-lib = "${libdir}/libclamav.so.* ${libdir}/libclamunrar.so* ${libdir}/libclamunrar_iface.so*"
74 FILES_${PN}-conf = "${sysconfdir}/clamd.conf"
75 FILES_${PN}-clamconf = "${bindir}/clamconf"
76 FILES_${PN}-freshclam = "${bindir}/freshclam \
77                          ${sysconfdir}/freshclam.conf \
78                          ${sysconfdir}/init.d/clamav-freshclam \
79                          ${sysconfdir}/default/volatiles/03_clamav-freshclam"
80 FILES_${PN}-daemon = "${sbindir}/clamd \
81                       ${sysconfdir}/init.d/clamav-daemon \
82                       ${sysconfdir}/default/volatiles/03_clamav-daemon"
83 FILES_${PN}-data = "${localstatedir}/lib/clamav/main.cvd \
84                     ${localstatedir}/lib/clamav/daily.cvd \
85                     ${sysconfdir}/default/volatiles/03_clamav-data"
86 FILES_${PN}-dev += "${bindir}/clamav-config"
87
88 # Add clamav's user and groups
89 pkg_postinst_${PN}-freshclam () {
90         grep -q clamav: /etc/group || addgroup clamav
91         grep -q clamav: /etc/passwd || \
92             adduser --disabled-password --home=/var/lib/clamav/ --system \
93                     --ingroup clamav --no-create-home -g "ClamAV" clamav
94         /etc/init.d/populate-volatile.sh update
95 }
96 pkg_postinst_${PN}-daemon () {
97         grep -q clamav: /etc/group || addgroup clamav
98         grep -q clamav: /etc/passwd || \
99             adduser --disabled-password --home=/var/lib/clamav/ --system \
100                     --ingroup clamav --no-create-home -g "ClamAV" clamav
101         /etc/init.d/populate-volatile.sh update
102 }
103 pkg_postinst_${PN}-data () {
104         grep -q clamav: /etc/group || addgroup clamav
105         grep -q clamav: /etc/passwd || \
106             adduser --disabled-password --home=/var/lib/clamav/ --system \
107                     --ingroup clamav --no-create-home -g "ClamAV" clamav
108         /etc/init.d/populate-volatile.sh update
109 }
110
111 # Indicate that the default files are configuration files
112 CONFFILES_${PN}-conf = "${sysconfdir}/clamd.conf"
113 CONFFILES_${PN}-freshclam = "${sysconfdir}/freshclam.conf"
114 CONFFILES_${PN}-data = "${localstatedir}/lib/clamav/main.cvd \
115                         ${localstatedir}/lib/clamav/daily.cvd"
116
117 INITSCRIPT_PACKAGES = "${PN}-daemon ${PN}-freshclam"
118 INITSCRIPT_NAME_${PN}-daemon = "clamav-daemon"
119 INITSCRIPT_NAME_${PN}-freshclam = "clamav-freshclam"
120 INITSCRIPT_PARAMS_${PN}-daemon = "defaults 50 50"
121 INITSCRIPT_PARAMS_${PN}-freshclam = "defaults 50 50"