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 \
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/"
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"
23 SRC_URI = "${SOURCEFORGE_MIRROR}/clamav/clamav-${PV}.tar.gz;name=clamav-${PV} \
24 file://clamav-daemon.init \
25 file://clamav-freshclam.init \
27 file://freshclam.conf \
28 file://volatiles.03_clamav-data \
29 file://volatiles.03_clamav-daemon \
30 file://volatiles.03_clamav-freshclam"
32 inherit autotools update-rc.d binconfig
34 # Don't check for clamav uid/gid - they don't exist on the host
35 # Put virus definitions in /var/lib not /usr/lib
36 EXTRA_OECONF = "--disable-clamav \
37 --with-zlib=${STAGING_DIR_HOST}${layout_prefix} \
39 --with-dbdir=${localstatedir}/lib/clamav \
40 --program-transform-name='' \
44 install -m 0755 -d ${D}${sysconfdir}/default/volatiles \
45 ${D}${sysconfdir}/init.d ${D}${docdir}/clamav
47 # Save the installed clamd.conf in the doc dir and then install our new one
48 install -m 0755 ${D}${sysconfdir}/clamd.conf ${D}${docdir}/clamav/clamd.conf.example
49 install -m 0755 ${WORKDIR}/clamd.conf ${D}${sysconfdir}/clamd.conf
51 # Save the installed freshclam.conf in the doc dir and then install our new one
52 install -m 0755 ${D}${sysconfdir}/freshclam.conf ${D}${docdir}/clamav/freshclam.conf.example
54 # Install our config files and init scripts
55 install -m 0755 ${WORKDIR}/freshclam.conf ${D}${sysconfdir}/freshclam.conf
56 install -m 0755 ${WORKDIR}/clamav-daemon.init ${D}${sysconfdir}/init.d/clamav-daemon
57 install -m 0755 ${WORKDIR}/clamav-freshclam.init ${D}${sysconfdir}/init.d/clamav-freshclam
59 # We need some /var directories
60 for i in 03_clamav-daemon 03_clamav-freshclam 03_clamav-data; do
61 install -m 0644 ${WORKDIR}/volatiles.$i ${D}${sysconfdir}/default/volatiles/$i
65 oe_libinstall -a -so libclamav ${STAGING_LIBDIR}
66 rm -f ${STAGING_LIBDIR}/libclamav.la
67 install -m 0644 libclamav/clamav.h ${STAGING_INCDIR}
70 PACKAGES += "${PN}-freshclam ${PN}-daemon ${PN}-conf ${PN}-data ${PN}-lib \
73 LEAD_SONAME = "libclamav.so.*"
74 FILES_${PN} = "${bindir}/clamscan \
77 FILES_${PN}-lib = "${libdir}/libclamav.so.* ${libdir}/libclamunrar.so* ${libdir}/libclamunrar_iface.so*"
78 FILES_${PN}-conf = "${sysconfdir}/clamd.conf"
79 FILES_${PN}-clamconf = "${bindir}/clamconf"
80 FILES_${PN}-freshclam = "${bindir}/freshclam \
81 ${sysconfdir}/freshclam.conf \
82 ${sysconfdir}/init.d/clamav-freshclam \
83 ${sysconfdir}/default/volatiles/03_clamav-freshclam"
84 FILES_${PN}-daemon = "${sbindir}/clamd \
85 ${sysconfdir}/init.d/clamav-daemon \
86 ${sysconfdir}/default/volatiles/03_clamav-daemon"
87 FILES_${PN}-data = "${localstatedir}/lib/clamav/main.cvd \
88 ${localstatedir}/lib/clamav/daily.cvd \
89 ${sysconfdir}/default/volatiles/03_clamav-data"
90 FILES_${PN}-dev += "${bindir}/clamav-config"
92 # Add clamav's user and groups
93 pkg_postinst_${PN}-freshclam () {
94 grep -q clamav: /etc/group || addgroup clamav
95 grep -q clamav: /etc/passwd || \
96 adduser --disabled-password --home=/var/lib/clamav/ --system \
97 --ingroup clamav --no-create-home -g "ClamAV" clamav
98 /etc/init.d/populate-volatile.sh update
100 pkg_postinst_${PN}-daemon () {
101 grep -q clamav: /etc/group || addgroup clamav
102 grep -q clamav: /etc/passwd || \
103 adduser --disabled-password --home=/var/lib/clamav/ --system \
104 --ingroup clamav --no-create-home -g "ClamAV" clamav
105 /etc/init.d/populate-volatile.sh update
107 pkg_postinst_${PN}-data () {
108 grep -q clamav: /etc/group || addgroup clamav
109 grep -q clamav: /etc/passwd || \
110 adduser --disabled-password --home=/var/lib/clamav/ --system \
111 --ingroup clamav --no-create-home -g "ClamAV" clamav
112 /etc/init.d/populate-volatile.sh update
115 # Indicate that the default files are configuration files
116 CONFFILES_${PN}-conf = "${sysconfdir}/clamd.conf"
117 CONFFILES_${PN}-freshclam = "${sysconfdir}/freshclam.conf"
118 CONFFILES_${PN}-data = "${localstatedir}/lib/clamav/main.cvd \
119 ${localstatedir}/lib/clamav/daily.cvd"
121 INITSCRIPT_PACKAGES = "${PN}-daemon ${PN}-freshclam"
122 INITSCRIPT_NAME_${PN}-daemon = "clamav-daemon"
123 INITSCRIPT_NAME_${PN}-freshclam = "clamav-freshclam"
124 INITSCRIPT_PARAMS_${PN}-daemon = "defaults 50 50"
125 INITSCRIPT_PARAMS_${PN}-freshclam = "defaults 50 50"