tinc: Recipe for 1.0.9
[openembedded/mini2440.git] / recipes / clamav / clamav.inc
blob49b8023a5366d38c4b77568e6f3004f9bcd43877
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"
21 SRC_URI = "${SOURCEFORGE_MIRROR}/clamav/clamav-${PV}.tar.gz \
22           file://cross-compile-fix.patch;patch=1 \
23           file://clamav-daemon.init \
24           file://clamav-freshclam.init \
25           file://clamd.conf \
26           file://freshclam.conf \
27           file://volatiles.03_clamav-data \
28           file://volatiles.03_clamav-daemon \
29           file://volatiles.03_clamav-freshclam"
31 inherit autotools update-rc.d binconfig
33 # Don't check for clamav uid/gid - they don't exist on the host
34 # Put virus definitions in /var/lib not /usr/lib
35 EXTRA_OECONF = "--disable-clamav \
36                 --with-zlib=${STAGING_DIR_HOST}${layout_prefix} \
37                 --with-libcurl \
38                 --with-dbdir=${localstatedir}/lib/clamav"
40 do_install_append() {
41         install -m 0755 -d ${D}${sysconfdir}/default/volatiles \
42                            ${D}${sysconfdir}/init.d ${D}${docdir}/clamav
44         # Save the installed clamd.conf in the doc dir and then install our new one
45         install -m 0755 ${D}${sysconfdir}/clamd.conf ${D}${docdir}/clamav/clamd.conf.example
46         install -m 0755 ${WORKDIR}/clamd.conf ${D}${sysconfdir}/clamd.conf
48         # Save the installed freshclam.conf in the doc dir and then install our new one
49         install -m 0755 ${D}${sysconfdir}/freshclam.conf ${D}${docdir}/clamav/freshclam.conf.example
51         # Install our config files and init scripts
52         install -m 0755 ${WORKDIR}/freshclam.conf ${D}${sysconfdir}/freshclam.conf
53         install -m 0755 ${WORKDIR}/clamav-daemon.init ${D}${sysconfdir}/init.d/clamav-daemon
54         install -m 0755 ${WORKDIR}/clamav-freshclam.init ${D}${sysconfdir}/init.d/clamav-freshclam
56         # We need some /var directories
57         for i in 03_clamav-daemon 03_clamav-freshclam 03_clamav-data; do
58           install -m 0644 ${WORKDIR}/volatiles.$i ${D}${sysconfdir}/default/volatiles/$i
59         done
61 do_stage () {
62         oe_libinstall -a -so libclamav ${STAGING_LIBDIR}
63         rm -f ${STAGING_LIBDIR}/libclamav.la
64         install -m 0644 libclamav/clamav.h ${STAGING_INCDIR}
67 PACKAGES += "${PN}-freshclam ${PN}-daemon ${PN}-conf ${PN}-data ${PN}-lib \
68              ${PN}-clamconf"
70 FILES_${PN} = "${bindir}/clamscan \
71                ${bindir}/sigtool \
72                ${bindir}/clamdscan"
73 FILES_${PN}-lib = "${libdir}/libclamav.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"
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
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
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
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"
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"