# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit java-pkg DESCRIPTION="Java filtering proxy server for the World Wide Web" SRC_URI="mirror://sourceforge/${PN}/${PN}-${PV}a.tar.gz" HOMEPAGE="http://muffin.doit.org/" SLOT="0" LICENSE="GPL-2" KEYWORDS="~x86" DEPEND=">=virtual/jdk-1.4.1" REDEPEND=">=virtual/jre-1.4.1" IUSE="doc" S=${WORKDIR}/${PN}-${PV}a/ src_compile() { econf || die "Failed at configuration step !!!" CLASSPATH=${JDK_HOME}/lib/classes.zip make || \ die "Failed at compilation step !!!" } src_install() { local INSTALL=$(which install) einstall || die "Failed at installation step !!!" java-pkg_dojar src/*.jar || "Failed packaging Muffin !!!" dodoc BUGS ChangeLog COPYING MAILINGLIST NEWS README THANKS TODO if [ `use doc` ] then dodir /usr/share/doc/${PN}-${PV}/filter/ $INSTALL ${S}doc/filter/* ${D}usr/share/doc/${PN}-${PV}/filter/ fi } pkg_postinst() { local CAT=$(which cat) local ECHO=$(which echo) local GREP=$(which grep) local CLASSPATH_FILE=/etc/env.d/30java-finalclasspath if [ -z `$CAT $CLASSPATH_FILE | $GREP ${PN}` ] then einfo "Adding ${PN} to CLASSPATH..." local CLASSPATH=`$CAT $CLASSPATH_FILE` local MUFFIN_HOME=/usr/share/${PN}/lib/${PN}.jar $ECHO $CLASSPATH:$MUFFIN_HOME > $CLASSPATH_FILE ewarn "" ewarn "You might want to enter the following command:" ewarn " $ source /etc/profile" ewarn "to profit from the CLASSPATH support from now." ewarn "" fi } pkg_postrm() { local CAT=$(which cat) local ECHO=$(which echo) local GREP=$(which grep) local CLASSPATH_FILE=/etc/env.d/30java-finalclasspath if [ ! -z `$CAT $CLASSPATH_FILE | $GREP ${PN}` ] then einfo "Removing ${PN} from CLASSPATH..." local CLASSPATH=`$CAT $CLASSPATH_FILE` local MUFFIN_HOME=/usr/share/${PN}/lib/${PN}.jar $ECHO ${CLASSPATH//:$MUFFIN_HOME/} > $CLASSPATH_FILE ewarn "" ewarn "You might want to enter the following command:" ewarn " $ source /etc/profile" ewarn "to update your CLASSPATH variable now." ewarn "" fi }