DESCRIPTION="MIMEDefang is a program for inspecting and modifying e-mail messages as they pass through your mail relay." HOMEPAGE="http://www.roaringpenguin.com/mimedefang/" LICENSE="GPL-2" DEPEND="sendmail MIME-tools IO-stringy MIME-Base64 MailTools Digest-SHA1 gd? ( GD GDGraph MLDBM Storable >=apache-2* )" # use for gd to add graphdefng support SRC_URI="http://www.roaringpenguin.com/mimedefang/${P}.tar.gz" IUSE="" SLOT="0" KEYWORDS="~x86" S="${WORKDIR}/${P}" # Had to disable SANDBOX because the make install portion needed # to make some adjustments to /var/spool/MIMEDefang. Otherwise # I would have to do the process manually which would be lots of work. SANDBOX_DISABLED="1" src_compile() { cd "${S}" ./configure --prefix=/ --mandir=/usr/share/man --infodir=/usr/share/info emake || die } src_install() { cd "${S}" einstall || die exeinto /etc/init.d newexe ${S}/examples/init-script mimedefang-init || die if [ "`use gd`" ] then einfo "" einfo "Adding perl modules Date::Parse, Date::Format, and File::ReadBackwards" perl -MCPAN -e 'install Date::Parse' perl -MCPAN -e 'install Date::Format' perl -MCPAN -e 'install File::ReadBackwards' dodir /home/httpd/htdocs/graphdefang cat ${S}/contrib/graphdefang-*/web/graphdefang.cgi | \ sed "s/my \$GRAPHDEFANGDIR = '\/home\/jpk\/graphdefang';/my \$GRAPHDEFANGDIR = '\/etc\/graphdefang';/" >\ graphdefang.cgi-new || die mv graphdefang.cgi-new \ ${S}/contrib/graphdefang-*/web/graphdefang.cgi || die exeinto /home/httpd/htdocs/graphdefang doexe ${S}/contrib/graphdefang-*/web/graphdefang.cgi || die dodir /etc/graphdefang exeinto /etc/graphdefang doexe ${S}/contrib/graphdefang-*/graphdefang.pl || die doexe ${S}/contrib/graphdefang-*/graphdefanglib.pl || die doexe ${S}/contrib/graphdefang-*/reset-max-date.pl || die insinto /etc/graphdefang doins ${S}/contrib/graphdefang-*/graphdefang-config-gshield-example || die doins ${S}/contrib/graphdefang-*/graphdefang-config-spamd-example || die doins ${S}/contrib/graphdefang-*/graphdefang-config-mimedefang-example || die doins ${FILESDIR}/graphdefang-config || die dodir /etc/graphdefang/event cp -Rdp \ ${S}/contrib/graphdefang-*/event/* \ ${D}/etc/graphdefang/event || die insinto /etc/apache2/conf/modules.d doins ${FILESDIR}/120_graphdefang.conf || die einfo "" fi } pkg_postinst() { einfo "" einfo "For Graphdefang support you will need to add \"gd\" to the use flags" einfo "and restart apache2 to access http://$HOSTNAME/graphdefang/graphdefang.cgi." einfo "" einfo "To generate a report" einfo "cd /etc/graphdefang" einfo "./graphdefang.pl" einfo "" einfo "This will generate a report from /var/log/mail/current." einfo "" einfo "You may also want to add a cron script to /etc/cron.hourly to run" einfo "graphdefang.pl automatically." einfo "" }