# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ DESCRIPTION="Opennap NG is a further developement of the well known opennap-server created by drscholl." HOMEPAGE="http://opennap-ng.sourceforge.net/" SRC_URI="mirror://sourceforge/opennap-ng/${P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="debug zlib" IUSE="${IUSE} chroot noinvalidclients noinvalidnicks nologchan nonroot resume router" RESTRICT="nomirror" DEPEND="virtual/libc zlib? ( sys-libs/zlib )" #S=${WORKDIR}/${P} pkg_setup() { if use nonroot ; then if [ -z "$(grep opennap /etc/group)" ]; then eerror "use-flag \"nonroot\" is set but no group" eerror "\"opennap\" can be found in /etc/group" eerror "please create group \"opennap\"" eerror "then restart emerge" die elif [ -z "$(grep opennap /etc/passwd)" ]; then eerror "use-flag \"nonroot\" is set but no user" eerror "opennap can be found in /etc/passwd" eerror "please create user \"opennap\" with" eerror "home = /dev/null" eerror "group = opennap" eerror "shell = /bin/false" eerror "then restart emerge" die fi fi } src_compile() { local myconf="" use chroot && \ myconf="${myconf} --enable-chroot" use debug && \ myconf="${myconf} --enable-debug" use noinvalidclients && \ myconf="${myconf} --disable-invalid-clients" use noinvalidnicks && \ myconf="${myconf} --disable-invalid-nicks" use nologchan && myconf="${myconf} --disable-log-channel" use nonroot && \ myconf="${myconf} --with-uid=opennap --with-gid=opennap" || \ myconf="${myconf} --with-uid=root --with-gid=root" use resume && \ myconf="${myconf} --enable-resume" use router && \ myconf="${myconf} --enable-router" use zlib || \ myconf="${myconf} --disable-csc" econf \ --prefix=/usr \ --enable-email \ ${myconf} || \ die "econf failed" emake || die "emake failed" } src_install() { einstall || die if [ ! -d /usr/share/${PN} ]; then dodir /usr/share/${PN} keepdir /usr/share/${PN} fi insinto /usr/share/${PN} doins ${S}/doc/examples/* use nonroot && fowners opennap:opennap /usr/share/${PN} use nonroot && fowners opennap:opennap /usr/share/${PN}/* exeinto /etc/init.d doexe ${FILESDIR}/opennap dodoc AUTHORS COPYING ChangeLog NEWS README docinto scripts dodoc ${S}/doc/scripts/* cd ${S}/doc dohtml manual.html rm -rf manual.html win98se_max_conn.reg examples scripts docinto doc dodoc * cd ${S} } pkg_postinst() { einfo "the config dir is /usr/share/${PN}" einfo "" einfo "please run /usr/sbin/setup before you" einfo "start ${PN} for the first time" }