# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils kernel-mod AV_VERS_1="antivir-workstation-2.1.3" AV_VERS_2="antivir-workstation-prof-2.1.3" AV_DIR="/usr/lib/AntiVir" MY_P="${P/antivir-/}" MY_P="${MY_P/_pre/-pre}" S="${WORKDIR}/${AV_VERS_2}" DESCRIPTION="H+BEDV AntiVir for UNIX Workstation - Background Daemon" SRC_URI="http://dl.antivir.de/dateien/antivir/release/${AV_VERS_2}.tar.gz http://www.dazuko.org/files/${MY_P}.tar.gz" HOMEPAGE="http://www.hbedv.com/" KEYWORDS="x86" LICENSE="H+BEDV GPL-2 BSD" SLOT="0" IUSE="" RDEPEND="=app-antivirus/${AV_VERS_1} virtual/linux-sources" DEPEND="${RDEPEND}" RESTRICT="nostrip" pkg_setup() { kernel-mod_check_modules_supported kernel-mod_getversion # Emulating KV_OBJ because it is not in kernel-mod eclass if [ "${KV_MAJOR}" -eq 2 -a "${KV_MINOR}" -gt 4 ] then KV_OBJ="ko" else KV_OBJ="o" fi } src_unpack() { unpack ${AV_VERS_2}.tar.gz cd ${S}/src unpack ${MY_P}.tar.gz } src_compile() { cd ${S}/src/${MY_P} if kernel-mod_configoption_present DEVFS_FS then einfo "Kernel with /dev file system support" myconf="--enable-devfs" else einfo "Kernel not using /dev file system support" myconf="" fi ./configure --enable-event-unlink --enable-event-rmdir --enable-event-close-modified ${myconf} || die "Could not configure module" set_arch_to_kernel kernel-mod_src_compile || die "Could not build module" set_arch_to_portage } src_install() { dodir ${AV_DIR} exeinto ${AV_DIR} doexe sh/avguard insinto /etc doins conf/avguard.conf dosed "s:/home/unwanted:${AV_DIR}/quarantine:g" /etc/avguard.conf dodir /etc/init.d exeinto /etc/init.d doexe ${FILESDIR}/avguard dosym ${AV_DIR}/configantivir ${AV_DIR}/configavguard dodir /usr/bin dosym ${AV_DIR}/configavguard /usr/bin/configavguard dodoc legal/LICENSE.dazuko src/HOWTO-Dazuko cd ${S}/src/${MY_P} if kernel-mod_configoption_present SMP then einfo "Kernel with symmetric multi-processing support (SMP)" POSTFIX="-smp" else einfo "Kernel not using symmetric multi-processing support (SMP)" POSTFIX="" fi dodir ${AV_DIR}/linux-${KV_VERSION_FULL}${POSTFIX} exeinto ${AV_DIR}/linux-${KV_VERSION_FULL}${POSTFIX} doexe dazuko.${KV_OBJ} dodoc COPYING LICENSE.BSD LICENSE.GPL README chown -R root:antivir ${D}${AV_DIR} } pkg_postinst() { einfo "How to use H+BEDV AntiVir for UNIX Workstation" einfo einfo "To start the background antivirus daemon on" einfo "system start up, type:" einfo einfo "rc-update add avguard boot" einfo einfo "To configure H+BEDV AntiVir for UNIX Workstation," einfo "type:" einfo einfo "configantivir" einfo einfo "or edit the file /etc/avguard.conf manually." echo sleep 10 }