# uses webapp.eclass to create directories with right permissions # probably slight overkill but works well inherit confutils eutils webapp db-use WEBAPP_MANUAL_SLOT="yes" MY_PV=${PV/.01/-01} MY_P=${PN}-${MY_PV} DESCRIPTION="Webserver log file analyzer" HOMEPAGE="http://www.mrunix.net/webalizer/" SRC_URI="ftp://ftp.mrunix.net/pub/webalizer/${MY_P}-src.tar.bz2" LICENSE="GPL-2" KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86" IUSE="bzip2 geoip nls" SLOT="0" DEPEND=">=sys-libs/db-4.1 >=sys-libs/zlib-1.1.4 >=media-libs/libpng-1.2 >=media-libs/gd-1.8.3 geoip? ( dev-libs/geoip ) bzip2? ( app-arch/bzip2 )" S="${WORKDIR}"/${MY_P} pkg_setup() { webapp_pkg_setup confutils_require_built_with_all media-libs/gd png # USE=nls has no real meaning if LINGUAS isn't set if use nls && [[ -z "${LINGUAS}" ]]; then ewarn "you must set LINGUAS in /etc/make.conf" ewarn "if you want to USE=nls" die "please either set LINGUAS or do not use nls" fi } src_compile() { # really dirty hack; necessary due to a really gross ./configure # basically, it just sets the natural language the program uses # unfortunatly, this program only allows for one lang, so only the first # entry in LINGUAS is used if use nls; then local longlang="$(grep ^${LINGUAS:0:2} "${FILESDIR}"/webalizer-language-list.txt)" local myconf="${myconf} --with-language=${longlang:3}" else local myconf="${myconf} --with-language=english" fi econf --enable-dns \ --with-db=$(db_includedir) \ --with-dblib=$(db_libname) \ $(use_enable geoip) \ $(use_enable bzip2 bz2) \ ${myconf} \ || die "econf failed" emake || die "emake failed" } src_install() { webapp_src_preinst dobin webalizer dosym webalizer /usr/bin/webazolver doman webalizer.1 dodoc CHANGES *README* INSTALL sample.conf webapp_src_install } pkg_postinst() { if [[ ${#LINGUAS} -gt 2 ]] && use nls; then ewarn ewarn "You have more than one language in LINGUAS" ewarn "Due to the limitations of this packge, it was built" ewarn "only with ${LINGUAS:0:2} support. If this is not what" ewarn "you intended, please place the language you desire" ewarn "_first_ in the list of LINGUAS in /etc/make.conf" ewarn fi webapp_pkg_postinst }