# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # uses webapps to create directories with right permissions # probably slight overkil but works well inherit eutils depend.apache webapp MY_PV=${PV/.10/-10} MY_P=${PN}-${MY_PV} S=${WORKDIR}/${MY_P} DESCRIPTION="Webserver log file analyzer" HOMEPAGE="http://www.webdruid.org/" SRC_URI="http://www.webdruid.org/download/source/${MY_P}.tar.bz2" LICENSE="GPL-2" KEYWORDS="~x86" IUSE="apache2 nls" DEPEND="=sys-libs/db-4.1* >=sys-libs/zlib-1.1.4 >=media-libs/libpng-1.2 >=media-libs/gd-1.8.3 >=media-gfx/graphviz-2.6 >=media-fonts/freefonts-0.10" pkg_setup() { webapp_pkg_setup if ! built_with_use media-libs/gd png; then ewarn "media-libs/gd must be built with png for this package" ewarn "to function." die "recompile gd with USE=\"png\"" fi } src_unpack() { unpack ${A} ; cd ${S} sed -i -e "s,db_185.h,db.h," configure } src_compile() { local myconf # method of lookup established myconf="${myconf} --enable-dns" # stupid broken configuration file autoconf econf \ --with-db=/usr/include/db4.1/ \ ${myconf} || die "econf failed" emake || die "make failed" } src_install() { webapp_src_preinst into /usr dobin webdruid dosym webdruid /usr/bin/webdruidolver doman webdruid.1 insinto /usr/share/webdruid doins ${FILESDIR}/${PV}/engines.list insinto /etc/webdruid doins ${FILESDIR}/${PV}/webdruid.conf use apache2 && sed -i -e "s/apache/apache2/g" ${D}/etc/webdruid/webdruid.conf if use apache2; then insinto ${APACHE2_MODULES_CONFDIR} else insinto ${APACHE1_MODULES_CONFDIR} fi newins ${FILESDIR}/${PV}/apache.webdruid 55_webdruid.conf dodoc README* CHANGES Copyright sample.conf webapp_hook_script ${FILESDIR}/${PV}/reconfig webapp_src_install } pkg_postinst(){ einfo einfo "It is suggested that you restart apache before using webdruid" einfo einfo "Just type webalizer to generate your stats." einfo "You can also use cron to generate them e.g. every day." einfo "They can be accessed via http://localhost/webdruid" einfo webapp_pkg_postinst }