# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit eutils MY_P=${P/_p/-} DESCRIPTION="Symantec AntiVirus" HOMEPAGE="http://www.symantec.com/" SRC_URI="x86? ( ${MY_P}.i386.deb ) amd64? ( ${MY_P}.amd64.deb )" LICENSE="Symantec" SLOT="0" KEYWORDS="-* ~amd64 ~x86" IUSE="" RESTRICT="fetch strip" S=${WORKDIR} pkg_setup() { enewgroup avdefs } src_unpack() { unpack "${A}" unpack ./data.tar.gz } src_prepare() { echo '[Symantec Shared]' > ./etc/Symantec.conf echo 'BaseDir=/opt/Symantec' >> ./etc/Symantec.conf echo 'JAVA_HOME=/etc/java-config-2/current-system-vm/bin/' >> ./etc/Symantec.conf echo 'LDPATH=/opt/Symantec/symantec_antivirus' > ./99symantec sed -i "s:120:2000:g" ./etc/sysconfig/rtvscand sed -i "s:120:2000:g" ./etc/sysconfig/symcfgd chown :avdefs ./opt/Symantec/bin/navdefutil chown -R :avdefs ./opt/Symantec/virusdefs } src_install() { insinto "${ROOT}"/etc doins ./etc/Symantec.conf insinto "${ROOT}"/etc/symantec doins ./etc/symantec/dec3.cfg insinto "${ROOT}"/etc/symantec/NLS/15 doins ./etc/symantec/NLS/15/rtvscan.msg doenvd ./99symantec doconfd ./etc/sysconfig/{rtvscand,symcfgd} doinitd "${FILESDIR}"/{rtvscand,symcfgd} exeinto "${ROOT}"/opt/Symantec/symantec_antivirus doexe ./opt/Symantec/symantec_antivirus/{libecomlodrlin.so,libpatchapp.so,rtvscand,sadiag.sh,sav,symcfg,symcfgd,symcfgpop} insinto "${ROOT}"/opt/Symantec/symantec_antivirus doins ./opt/Symantec/symantec_antivirus/symcfgdata.inf into "${ROOT}"/opt/Symantec dobin ./opt/Symantec/bin/navdefutil dodir /opt/Symantec/virusdefs /var/{log,run}/symantec /var/symantec/{Logs,Quarantine} chown :avdefs "${D}"/opt/Symantec/virusdefs doman ./usr/share/man/man1/sav.1.gz ./usr/share/man/man8/* dodoc ./opt/Symantec/symantec_antivirus/docs/* } pkg_postinst() { ebegin "Populating the configuration file" cd /opt/Symantec/symantec_antivirus/ && /opt/Symantec/symantec_antivirus/symcfgpop symcfgdata.inf eend $? ebegin "Installing initial virus definition files" /opt/Symantec/bin/navdefutil --install "${S}"/opt/Symantec/virusdefs/temp eend $? ebegin "Registering initial virus definitions with AntiVirus" /opt/Symantec/bin/navdefutil -n SAV_LINUX eend $? if [ -f /opt/Symantec/LiveUpdate/jlu.jar ] ; then ebegin "Symantec LiveUpdate detected, registering AntiVirus with it" java -cp /opt/Symantec/LiveUpdate/jlu.jar com.symantec.liveupdate.ProductInventory RegisterProduct A6F58F43-19F2-40F7-890D-B9DBA4D0AE03 "Avenge MicroDefs25 SavCorp10 Linux" MicroDefsB.CurDefs SymAllLanguages HubDefs 0 && \ java -cp /opt/Symantec/LiveUpdate/jlu.jar com.symantec.liveupdate.ProductInventory RegisterProduct 3B6F0D1D-CF6B-4d68-8FC7-3B003E6D52C5 "Avenge MicroDefs25 SavCorp10 Linux" MicroDefsB.CurDefs SymAllLanguages CurDefs 0 eend $? fi }